Coder Social home page Coder Social logo

khaled-rahman / batchlayout Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 0.0 114.84 MB

Implementation of IEEE PacificVis 2020 paper titled "BatchLayout: A batch-parallel force-directed graph layout algorithm in shared memory"

Jupyter Notebook 90.29% C++ 8.44% Python 1.03% Gnuplot 0.04% Makefile 0.16% C 0.04%
graph-visualization scalable-graph-visualization parallel-implementations force-directed-graph scalable-layout-design visualization graph

batchlayout's Introduction

BatchLayout

Parallel Batch Update Algorithm for Force-Directed Graph Layout generation in Shared Memory. This tool generates layout of graphs using multicores which is generally faster than state-of-the-art algorithms. It comes with various features, e.g., it intializes layout using random technique as well as greedy technique (helps to converge faster), it provides several options like (a,r)-energy models and Edge weights, it can approximate repulsive forces by Barnes-Hut approximation and greedy technique. We assume that the input graph is undirected, connected and symmetric.

@@@@@                   @      @                                     
@    @                  @      @                                     
@  @   @@@@@@ @  @@@@@@ @      @      @@@@@@ @    @ @@@@@@ @    @ @  
@@@         @ @@ @    @ @@@@@@ @           @ @    @ @    @ @    @ @@ 
@  @   @@@@@@ @  @      @    @ @      @@@@@@ @@@@@@ @    @ @    @ @  
@    @ @    @ @  @      @    @ @      @    @      @ @    @ @    @ @  
@@@@@  @@@@@@ @@ @@@@@@ @    @ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@ 

System Requirements

Users need to have following softwares/tools installed in their PC. The source code was compiled and run successfully in both linux and macOS.

GCC version >= 4.9
OpenMP version >= 4.5
Python3 packages: matplotlib, scipy, networkx, numpy

Some helpful links for installation can be found at GCC, OpenMP and Environment Setup.

Compile and Run BatchLayout

Go to BatchLayoutCode directory and follow the instructions step by step. Once you have compiled and generated a executible file, you can run BatchLayout from this directory as following:

$ ./BatchLayoutCode/bin/BatchLayout -input ./datasets/input/3elt_dual.mtx -output ./datasets/output/ -iter 600 -batch 256 -threads 32 -algo 2

For more options, check out readme file in BatchLayoutCode folder or type ./BatchLayoutCode/bin/BatchLayout from this directory for help message.

Run othertools

We have also made other tools (ForceAtlas2, OpenOrd, and tsNET) available here to run. Please go to othertools folder and follow instructions step by step.

File conversion

Different tools takes different input format. To increase user friendly, We provide few python scripts for file conversion in fileconversion folder. User can check out corresponding readme file.

Aesthetic Metrics

To compute aesthetic metrics (edge crossing, min-angle, edge length variation, shape gabriel), users will need to have glam tool installed which has some other system requirements. There is another repository by Felice for computing measures such as Edge Uniformity, Stress, Neighborhood Preservation, etc. Users can check that as well.

Visualize layout

Users can check visualize.ipynb jupyter notebook for visualization. You can run jupyter notebook using following command provided that you have it installed on your machine. Then set appropriate directory for input and output files.

jupyter notebook visualize.ipynb
jupyter notebook FinalVis.ipynb

Acknowledgement

Authors would like to thank Kwon, Felice and J Dyer for making their repositories public. Those were helpful for building script for other tools and running aesthetic metrics.

Citation

If you find this repository helpful, please cite the following paper:

Md. Khaledur Rahman, M. Haque Sujon and Ariful Azad, "BatchLayout: A batch-parallel force-directed graph layout algorithm in shared memory", The 13th IEEE Pacific Visualization Symposium (PacificVis 2020), April, 2020, Tianjin, China.

@inproceedings{rahman2020batchlayout,
  title={BatchLayout: A Batch-Parallel Force-Directed Graph Layout Algorithm in Shared Memory},
  author={Rahman, Md Khaledur and Sujon, Majedul Haque and Azad, Ariful},
  booktitle={2020 IEEE Pacific Visualization Symposium (PacificVis)},
  pages={16--25},
  year={2020},
  organization={IEEE}
}

Contact

If you have questions or comments, please don't hesitate to ask me (Md. Khaledur Rahman) by sending email to [email protected].

batchlayout's People

Contributors

khaled-rahman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

batchlayout's Issues

UnboundLocalError: local variable 'outputdir' referenced before assignment

(keyword_extraction) E:\BatchLayout-master\BatchLayoutCode>python runBatchLayout.py -inf ./datasets/input/3elt_dual.mtx -outd ./datasets/output/ -iter 600 -threads 4

@@@@@ @ @
@ @ @ @
@ @ @@@@@@ @ @@@@@@ @ @ @@@@@@ @ @ @@@@@@ @ @ @
@@@ @ @@ @ @ @@@@@@ @ @ @ @ @ @ @ @ @@
@ @ @@@@@@ @ @ @ @ @ @@@@@@ @@@@@@ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@@@@@ @@@@@@ @@ @@@@@@ @ @ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@

Running Batchlayout...
./bin/BatchLayout -input ./datasets/input/3elt_dual.mtx -output ./datasets/output/ -iter 600 -batch 256 -algo 2 -init 0 -threads 4
'.' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Something went wrong in processing !!! Check error message and act accordingly.
Reading coordinates file...
Traceback (most recent call last):
File "runBatchLayout.py", line 130, in
X = readCoordinates(outputdirector)
File "runBatchLayout.py", line 62, in readCoordinates
corfile = open(filename)
TypeError: expected str, bytes or os.PathLike object, not NoneType

(keyword_extraction) E:\BatchLayout-master\BatchLayoutCode>python runBatchLayout.py -inf ./datasets/input/3elt_dual.mtx -outd ./datasets/output/ -iter 600 -threads 4

@@@@@ @ @
@ @ @ @
@ @ @@@@@@ @ @@@@@@ @ @ @@@@@@ @ @ @@@@@@ @ @ @
@@@ @ @@ @ @ @@@@@@ @ @ @ @ @ @ @ @ @@
@ @ @@@@@@ @ @ @ @ @ @@@@@@ @@@@@@ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@@@@@ @@@@@@ @@ @@@@@@ @ @ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@@@@@ @@

Running Batchlayout...
./bin/BatchLayout -input ./datasets/input/3elt_dual.mtx -output ./datasets/output/ -iter 600 -batch 256 -algo 2 -init 0 -threads 4
'.' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Something went wrong in processing !!! Check error message and act accordingly.
Traceback (most recent call last):
File "runBatchLayout.py", line 128, in
outputdirector = runBatchLayout(inputfile, outputfile, iteration, batch, algo, init, initf, threads, barnesth, energyth, weight)
File "runBatchLayout.py", line 59, in runBatchLayout
return outputdir
UnboundLocalError: local variable 'outputdir' referenced before assignment

Segmentation fault (core dumped)

Hello, I changed the first line of the test file from 10 10 13 to 12 12 13. This means that I've added two nodes that are not connected to other nodes. Then,I got this error when run the algorithm.

Reading input matrices in text (ascii)...
Input File Directory:./datasets/input/test.mtx
Matrix is symmetric
Converting matrix data from ASCII to COO format: 9.012105874717236e-05 seconds
Input Matrix: Rows = 12, Columns= 12, nnz = 26
Converting to csc ...
Segmentation fault (core dumped)

I suspect this is because the graph represented by the matrix is not connected graph. But when I changed the first line to 11 11 13, the algorithm runs successfully.

Reading input matrices in text (ascii)...
Input File Directory:./datasets/input/test.mtx
Matrix is symmetric
Converting matrix data from ASCII to COO format: 0.0001745698973536491 seconds
Input Matrix: Rows = 11, Columns= 11, nnz = 26
Converting to csc ...
80%% - 20%% BH - CB
BH-CACHE Approximation Energy:114.692
BH-CACHE Approximation Wall time required:0.0212087
Creating output file in following directory:./datasets/output/test.mtxBCAPPROX32PARAOUT600.txt

So what's the reason for this error. And how to deal with unconnected graphs with this algorithm.
Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.