Skip to content

Conversation

@ArpitaHanjagi
Copy link
Contributor

@ArpitaHanjagi ArpitaHanjagi commented Oct 20, 2025

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.

Copilot AI review requested due to automatic review settings October 20, 2025 19:12
Copy link

Copilot AI left a 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

Copy link
Member

@siriak siriak left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants