- Python 3.0
-
src/graph/*
-- Implementation of the Vertex, Edge & Graph classes with appropriate Data-Structures -
src/algorithms/*
-- Implementation of the Algorithms that utilize the Graph objects fromsrc/graph/Graph.py
-
This is a repository that shall contain the following :
-
Implementation of the
Graph
,Vertex
andEdge
Classes -
Implementation of Shortest-Path (Djikstra & Bellman-Ford), All-pairs Shortest-Path (Floyd-Warshall) Algorithms
-
Implementation of 2 Minimum Spanning Tree Algorithms (Kruskal & Prim)
-
Implementation of a 2-partite-ness predictor (Predicts whether a Graph is Bi-Partite)
-
Implementation of Matching Algorithms
-
-
Clone the repo:
git clone git@github.com:jssandh2/graph_algorithms.git
in a suitable local directory. -
You can instantiate new Graph Classes by adding a
main
method inGraph.py
. Example:
if __name__ == "__main__":
graph_a = Graph(["a", "b", "c", "d"], [["a", "b", 3], ["b", "d"], ["d", "a", 2], ["a", "c", 5]])
graph_a.add_vertex("e")
graph_a.add_edge(["b", "e", 6])
- You can also remove edges & vertices, along with use the Graph object to implement Algorithms (Coming Soon!)