-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated Readme.md to include description of Kosaraju's Algorithm
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,7 @@ If you are interested, please contact us at [email protected] or contribute to | |
- [Borůvka's Algorithm](#borůvkas-algorithm) | ||
- [Graph Slicing based on connectivity](#graph-slicing-based-on-connectivity) | ||
- [Ford-Fulkerson Algorithm](#ford-fulkerson-algorithm) | ||
- [Kosaraju Algorithm] (#kosaraju's-algo) | ||
- [Partition Algorithm Explanation](#partition-algorithm-explanation) | ||
- [Vertex-Cut](#vertex-cut) | ||
- [Edge Balanced Vertex-Cut](#edge-balanced-vertex-cut) | ||
|
@@ -491,6 +492,13 @@ This algorithm is used in garbage collection systems to decide which other objec | |
[Ford-Fulkerson Algorithm](https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm) is a greedy algorithm for finding a maximum flow in a flow network. | ||
The idea behind the algorithm is as follows: as long as there is a path from the source (start node) to the sink (end node), with available capacity on all edges in the path, we send flow along one of the paths. Then we find another path, and so on. A path with available capacity is called an augmenting path. | ||
|
||
### Kosaraju's Algorithm | ||
[Kosaraju's Algorithm] (https://en.wikipedia.org/wiki/Kosaraju%27s_algorithm) is a linear time algorithm to find the strongly connected components of a directed graph. It is based on the idea that if one is able to reach a vertex v starting from vertex u, then one should be able to reach vertex u starting from vertex v and if such is the case, one can say that vertices u and v are strongly connected - they are in a strongly connected sub-graph. Following is an example: | ||
|
||
1). Create an empty stack ‘S’ and do DFS traversal of a graph. In DFS traversal, after calling recursive DFS for adjacent vertices of a vertex, push the vertex to stack. | ||
2). Reverse directions of all arcs to obtain the transpose graph. | ||
3). One by one pop a vertex from S while S is not empty. Let the popped vertex be ‘v’. Take v as source and do DFS (call DFSUtil(v)). The DFS starting from v prints strongly connected component of v. | ||
|
||
## Partition Algorithm Explanation | ||
|
||
### Vertex-Cut | ||
|