Python implementations of common network algorithms and network visualization through networkx
- Dijkstra's Shortest Path Algorithm
- Kruskal's Minimum Spanning Tree Algorithm
- Prim's Minimum Spanning Tree Algorithm
Networks are represented with an adjacency matrix e.g.
[0, 0, 5, 2],
[0, 0, 0, 4],
[5, 0, 0, 0],
[2, 4, 0, 0]
# Algorithms:
Dijkstra(Network N, int Starting Node, [int Finish Node]) # Run and Display Dijkstra's Algorithm
Kruskal(Network N) # Run and Display Kruskal's Algorithm
Prim(Network N) # Run and Display Prim's Algorithm
# Network:
Network(int[] AdjacencyMatrix, [int Seed]) # Initialize network with given adjacency matrix
Network.drawNetwork() # Show network through plotmatlib
Network.printNetwork() # Print network in terminal
# Arguments:
python main.py {seed}