A collection of some graph algorithms I wrote during my free time
They all contain pretty in-depth comments, so feel free to use as reference
Some of these were homework for my ALGO2 Class
-
Pathfinding Algorithms
- Dijkstra’s algorithm (Done!)
- Used to find smallest path from one node to any other node with non-negative weights on vertices. Some examples of its usage could be google maps to find shortest route.
- Bellman-Ford’s algorithm (Done!)
- Similar to Dijkstra, but it can handle negative weights. In return, it detect negative cycles.
- Dijkstra’s algorithm (Done!)
-
All Pairs Shortest Path Algorithms
- Floyd-Warshall’s algorithm (Done!)
- Used to find shortest path from all nodes to all other nodes (All Pair Shortest Paths (APSP))
- Floyd-Warshall’s algorithm (Done!)
-
Advanced Minimum Spanning Tree Algorithms
- Kruskal’s algorithm (Done!)
- Used to find minimum spanning tree (MST). It calculates shortest route that passes through all nodes.
- Prim’s algorithm (Done!)
- Used to find minimum spanning tree (MST), similar to Kruskals. Major difference is Prim scans by nodes, while Kruskals scans by vertices.
- Kruskal’s algorithm (Done!)
-
Maximum Flow Algorithms
- Ford-Fulkerson algorithm (TODO)
- Description TODO
- Dinic's algorithm (TODO)
- Description TODO
- Ford-Fulkerson algorithm (TODO)