[cpp] Clean up graph implementations

This commit is contained in:
2022-04-13 21:15:03 -04:00
parent 6986c73651
commit 4b47630548
11 changed files with 227 additions and 185 deletions

View File

@@ -1,8 +1,7 @@
/*##############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
## About: An example of a weighted graph implementation ##
## Algorithms in this example are found in MIT Intro to Algorithms ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## About: Driver program to test weighted graph implementation ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
################################################################################
@@ -105,7 +104,7 @@ int main (const int argc, const char * argv[])
// + Chapter 22, Figure 22.4 on DFS
// Unlike the simple-graph example, this final result matches MIT Algorithms
// + Aside from the placement of the watch node, which is not connected
// + This is because the node is visited after all other nodes are finished
// + This is because the node is visited after all other nodes are finished
std::vector<Node> order =
topologicalGraph.TopologicalSort(topologicalGraph.GetNodeCopy(6));
std::cout << "\nTopological order: ";