https://github.com/imagemlt/pygraphalgorithm
graph algorithms in python
https://github.com/imagemlt/pygraphalgorithm
Last synced: 5 months ago
JSON representation
graph algorithms in python
- Host: GitHub
- URL: https://github.com/imagemlt/pygraphalgorithm
- Owner: imagemlt
- Created: 2017-06-12T08:31:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-15T08:03:20.000Z (almost 9 years ago)
- Last Synced: 2024-12-30T02:46:38.553Z (over 1 year ago)
- Language: Python
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)