Skip to content

alperenunlu/graphius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphius

Graphius is a python library for creating and visualizing graphs. It has algorithms for finding shortest paths, minimum spanning trees, and more. You can visualize the graphs and algorithms step by step. You can use graphius with Jupyter notebooks or as a standalone application.

For examples see the examples notebook.

Installation

pip install graphius

If you want to use the visualization features you need to install graphviz. See graphviz.org/download for installation instructions.

Usage

from graphius import Graph

adjacency_list = {
    's': [('t', 10), ('y', 5)],
    't': [('x', 1), ('y', 2)],
    'x': [('z', 4)],
    'y': [('t', 3), ('x', 9), ('z', 2)],
    'z': [('s', 7), ('x', 6)]
}

g = Graph(adjacency_list, weighted=True, directed=True)
g.dijkstra('s', visualized=True, gif_path='dijkstra.gif')

dijsktra.gif:

dijkstra

This project is licensed under the MIT License - see the LICENSE file for details

About

A simple graph library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages