xiaoxiae / Grafatko

An app for creating and visualizing graphs and graph-related algorithms.
GNU General Public License v3.0
26 stars 7 forks source link
computer-science graph-algorithms graph-theory graph-visualizer pyqt5 python

Grafátko [gɾafɑtko]

An app for creating and visualizing graphs and graph-related algorithms.

Running Grafátko

First, install the app by running pip install grafatko. Then you can simply run the grafatko command from a terminal of your choice.


Another way to run Grafátko (albeit a little more difficult) is to first clone the repository, go to the base directory and run the project as a Python module:

xiaoxiae@thinkpad ~> git clone https://github.com/xiaoxiae/Grafatko.git
xiaoxiae@thinkpad ~> cd Grafatko/
xiaoxiae@thinkpad ~> pip install -r requirements.txt
xiaoxiae@thinkpad ~> python -m grafatko.__init__

Controls

Mouse

Keyboard

Other

Visualizing algorithms

The app allows for visualising custom algorithms on the currently edited graph. Examples of valid programs can be found in the examples/ folder.

After creating a graph, you can go to Algorithms -> Run and select the one you want to run on the graph. The program then calls a function with the same name as the file, the only parameter being the DrawableGraph object to run the algorithm on.

When the animation is running, you can use the pause, resume and clear to control it.

Importing/exporting graphs

The app uses a simple text-based format for importing and exporting graph. Each line of the file the format n1 [direction] n2 [weight], where:

Examples of valid graphs can be found in the examples/ folder.