-
-
Notifications
You must be signed in to change notification settings - Fork 342
Gomory hu tree #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Gomory hu tree #276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds the Gomory-Hu Tree algorithm implementation to the repository, along with numerous other graph algorithms, dynamic programming solutions, and documentation files. The Gomory-Hu Tree algorithm constructs a tree representing all-pairs minimum cuts in an undirected weighted graph.
Key changes:
- Added Gomory-Hu Tree algorithm implementation
- Added multiple graph algorithms (Kruskal's MST, Prim's MST, Dijkstra, BFS/DFS, Floyd-Warshall, etc.)
- Added dynamic programming algorithms (0/1 Knapsack, LCS, LIS, etc.)
- Added machine learning documentation and examples
Reviewed Changes
Copilot reviewed 140 out of 220 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Desktop/open-source/R/graph_algorithms/gomory_hu_tree.r | Implements Gomory-Hu Tree algorithm with placeholder min-cut function |
| Desktop/open-source/R/graph_algorithms/kruskal_mst.r | Implements Kruskal's MST algorithm with Union-Find |
| Desktop/open-source/R/graph_algorithms/prim_mst.r | Implements Prim's MST algorithm |
| Desktop/open-source/R/graph_algorithms/dijkstra_shortest_path.r | Implements Dijkstra's algorithm with priority queue |
| Desktop/open-source/R/dynamic_programming/0/1_knapsack_problem.r | Implements 0/1 Knapsack problem solution |
| Desktop/open-source/R/dynamic_programming/coin_change.r | Implements coin change problem solution |
| Desktop/open-source/R/documentation/*.md | Machine learning algorithm documentation files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have changed 220 files, check your changes
Algorithm: Gomory-Hu Tree
Purpose: Represents all-pairs minimum cuts in an undirected weighted graph as a tree.
Theory:
Each edge in the tree corresponds to a minimum cut between its endpoints.
Any min-cut between two vertices in the original graph is the minimum weight on the path connecting them in the tree.
Time Complexity: O(V * max-flow) (depends on the max-flow algorithm used).
Space Complexity: O(V + E).
Input: Weighted undirected graph as adjacency list.
Output: Parent array and edge weights representing the Gomory-Hu tree.