- "fruchterman_v3.cc" is the C++ source file that implements the fruchterman reingold algorithm and provides the interface between C++ and Python using C++ Boost. The name of interface Module is "fruchterman_v3".
- "Makefile" is the C++ compile file.
- "test2.py" is the simple test code from Python side.
- Make sure you installed the C++ boost library, and set the workspace correctly.
- Put "fruchterman_v3.cc", "Makefile" and "test2.py" together in the same directory (Also make sure that you have the file "/dist-packages/numpy/core/include/numpy/ndarrayobject.h" in Python directory, otherwise, please download the boost numpy lib).
- In "Makefile", please modify the values:
- python version "PYTHON_VERSION"
- python work space path "PYTHON_INC"
- python boost include path "BOOST_INC"
- python boost library path "BOOST_LIB"
- In the command line, type "make".
- When you call fruchterman source code in Python, please import the interface module name "fruchterman_v3". The "test2.py" shows a simple example for usage.
- data: The adjacency matrix of a network which is a 2-D numpy array.
- size: The vertices number in the network.
- width: Our desired width of the layout.
- height: Our desired height of the layout.
- iteration: The total iteration number of Fruchterman Reingold algorithm.