|
4 | 4 |
|
5 | 5 | This repo covers basic graph algorithms for directed and undirected graphs with/without weights on edges. Graph description is read from a file with ascii format.
|
6 | 6 |
|
7 | | -Base graph data structure is targeted for **sparse graphs** efficiency. For example, it maintains adjancy list and pointrs. |
| 7 | +Base graph data structure is targeted for **sparse graphs** efficiency. For example, it maintains adjancy list and pointrs. Here are big O time and space complexities. |
| 8 | + |
| 9 | + |
| 10 | +| | RAM | node-add | edge-add | node-remove | edge-remove | query | |
| 11 | +| --------------- |:---------:|:--------:|:--------:|:-----------:|:-----------:|:---------:| |
| 12 | +| Adjacency List | [n]+[e] | 1 | 1 | [n]+[e] | [e] | [e] | |
| 13 | +| Incident List | [n]+[e] | 1 | 1 | [e] | [e] | [e] | |
| 14 | + |
| 15 | +Legend: |
| 16 | +* Two vertices are called adjacent if they are connected by an edge. |
| 17 | +* Two edges are called incident, if they share a vertex. |
8 | 18 |
|
9 | 19 | ## Algorithms Covered
|
10 | 20 |
|
11 | 21 | * DFS
|
| 22 | +* Transpose |
12 | 23 | * Topological Sort
|
| 24 | +* Strongly Connected Components |
13 | 25 | * Prim's Mimimal Spanning Tree
|
14 | 26 | * Kruskal's Mimimal Spanning Tree
|
15 | 27 | * Dijkstra's Single Source Shortest Path to All Nodes
|
@@ -87,5 +99,5 @@ n3 3 [n2 n3 1]
|
87 | 99 |
|
88 | 100 | ## Disclaimer
|
89 | 101 |
|
90 | | -This is a quick and dirty code produced over a weekend. Main objective behind this repository is purely educational. It has quite a bit of room for improvement. Feel free to reach out if you spot weakness, bug, enancement or simply a suggestion. |
| 102 | +This is a quick and dirty code produced over weekends. Main objective behind this repository is purely educational. It has quite a bit of room for improvement. Feel free to reach out if you spot weakness, bug, enancement or simply a suggestion. |
91 | 103 |
|
0 commit comments