-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added BFS algorithm. Tests on BFS. Added Test and some extreme cases …
…correction in the Dijkstra algorithm. Added the funtion that return the node set from the graph and tested. Signed-off-by: GitHub <[email protected]>
- Loading branch information
Showing
6 changed files
with
342 additions
and
37 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
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 |
---|---|---|
|
@@ -13,6 +13,23 @@ | |
|
||
## Algorithm Explanation | ||
|
||
#### Dijkstra | ||
[Graph Dijkstras Shortest Path Algorithm(Dijkstra's Shortest Path)](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) | ||
**Dijkstra's Algorithm** is used to find the shortest path from a source node to all other reachable nodes in the graph. The algorithm initially assumes all the nodes are unreachable from the given source node so we mark the distances of all nodes as infinity. | ||
(infinity) from source node (INF / infinity denotes unable to reach). | ||
|
||
#### BFS (Breadth First Search) | ||
[Breadth First Search Algorithm(Breadth First Search)](https://en.wikipedia.org/wiki/Breadth-first_search) | ||
**Breadth First Search**, also quoted as **BFS**, is a Graph Traversal Algorithm. Time Complexity O(|V| + |E|) where V are the number of vertices and E are the number of edges in the graph. | ||
Applications of Breadth First Search are : | ||
|
||
1. Finding shortest path between two vertices say u and v, with path length measured by number of edges (an advantage over depth first search algorithm) | ||
2. Ford-Fulkerson Method for computing the maximum flow in a flow network. | ||
3. Testing bipartiteness of a graph. | ||
4. Cheney's Algorithm, Copying garbage collection. | ||
|
||
And there are many more... | ||
|
||
WORK IN PROGRESS | ||
|
||
## Classes Explanation | ||
|
@@ -52,3 +69,8 @@ E-Mail : [email protected] | |
To support me just add ***Star*** the project [](https://GitHub.com/ZigRazor/CXXGraph/stargazers/) or ***follow me*** [](https://github.com/ZigRazor?tab=followers) | ||
|
||
To get updated ***watch*** the project [](https://GitHub.com/ZigRazor/CXXGraph/watchers/) | ||
|
||
|
||
## Credits | ||
|
||
Thanks to the community of [TheAlgorithms](https://github.com/TheAlgorithms) for some algorithm ispiration. |
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
Oops, something went wrong.