Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imagemlt/pygraphalgorithm

graph algorithms in python
https://github.com/imagemlt/pygraphalgorithm

Last synced: about 8 hours ago
JSON representation

graph algorithms in python

Awesome Lists containing this project

README

        

# PyGraphAlgorithm

This script contains a simple graph and some useful functions

### Function List
+ BFS
+ DFS
+ TopologicalSort\_indgree
+ TopologicalSort\_dfs
+ Kruskal
+ Prim
+ Dijikstra
+ Bellman-Ford
+ Floyd

### Usage
First,type in the vertices ,-1 for an end;
Then type in the edges in the format of vertice1 vertice2 cost line by line for an end;
then it will run the above functions.
*Unfortunately I don't know how to tell the loop in the nonrecurse method of dfs ToplogicalSort.
If you have good ideas please contact me.*

###### [My Wordpress](http://blog.imagemlt.ml)