-
Notifications
You must be signed in to change notification settings - Fork 202
Implement Kruskal's Minimum Spanning Tree Algorithm #12942
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
Open
holinkasa
wants to merge
1
commit into
koii-network:main
Choose a base branch
from
holinkasa:task/issue-12926-20250518-220334
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Implement Kruskal's Minimum Spanning Tree Algorithm #12942
holinkasa
wants to merge
1
commit into
koii-network:main
from
holinkasa:task/issue-12926-20250518-220334
Conversation
This file contains hidden or 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
Implements koii-network#12926 Implements koii-network#12916 Implements koii-network#12885 Implements koii-network#12820 Implements koii-network#12741 Implements koii-network#12740 Implements koii-network#12718 Implements koii-network#12633 # Implement Kruskal's Minimum Spanning Tree Algorithm ## Task Implement Kruskal's algorithm to find the Minimum Spanning Tree (MST) of a weighted, undirected graph. ## Acceptance Criteria All tests must pass. The program must use Kruskal's algorithm to find the MST. A boolean array 'visited[]' must track edge visits. Implement a Disjoint Set Union (DSU) or Union-Find data structure using rank and path compression. The solution must output the minimum total weight of the MST formed. The graph is undirected with no self-loops or multiple edges between the same vertices. Edge weights are non-negative. ## Summary of Changes Implemented Kruskal's Minimum Spanning Tree algorithm with the following key components: - Created a Disjoint Set Union (DSU) data structure with rank and path compression - Implemented edge sorting and selection algorithm - Added visited[] array to track edge visits - Developed function to calculate minimum total weight of the MST - Ensured handling of undirected graphs with non-negative edge weights ## Test Cases - Verify DSU data structure correctly merges and finds sets - Check edge sorting works correctly for weighted edges - Validate MST algorithm finds minimum total weight - Ensure no self-loops or multiple edges are processed - Test handling of graphs with different numbers of vertices - Verify path compression in DSU reduces time complexity - Check visited[] array tracks edge visits correctly This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
holinkasa
pushed a commit
to holinkasa/prometheus-beta
that referenced
this pull request
May 18, 2025
Implements koii-network#12942 Implements koii-network#12926 Implements koii-network#12916 Implements koii-network#12885 Implements koii-network#12820 Implements koii-network#12741 Implements koii-network#12740 Implements koii-network#12718 Implements koii-network#12633 # Implement Kruskal's Minimum Spanning Tree Algorithm ## Task Implement Kruskal's algorithm to find the Minimum Spanning Tree (MST) of a weighted, undirected graph. ## Acceptance Criteria All tests must pass. The program must use Kruskal's algorithm to find the MST. A boolean array 'visited[]' must track edge visits. Implement a Disjoint Set Union (DSU) or Union-Find data structure using rank and path compression. The solution must output the minimum total weight of the MST formed. The graph is undirected with no self-loops or multiple edges between the same vertices. Edge weights are non-negative. ## Summary of Changes Implemented Kruskal's Minimum Spanning Tree algorithm with the following key components: - Created a Disjoint Set Union (DSU) data structure with rank and path compression - Implemented edge sorting and selection algorithm - Added visited[] array to track edge visits - Developed function to calculate minimum total weight of the MST - Ensured handling of undirected graphs with non-negative edge weights ## Test Cases - Verify DSU data structure correctly merges and finds sets - Check edge sorting works correctly for weighted edges - Validate MST algorithm finds minimum total weight - Ensure no self-loops or multiple edges are processed - Test handling of graphs with different numbers of vertices - Verify path compression in DSU reduces time complexity - Check visited[] array tracks edge visits correctly This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
holinkasa
pushed a commit
to holinkasa/prometheus-beta
that referenced
this pull request
May 18, 2025
Implements koii-network#12953 Implements koii-network#12942 Implements koii-network#12926 Implements koii-network#12916 Implements koii-network#12885 Implements koii-network#12820 Implements koii-network#12741 Implements koii-network#12740 Implements koii-network#12718 Implements koii-network#12633 # Implement Kruskal's Minimum Spanning Tree Algorithm ## Task Implement Kruskal's algorithm to find the Minimum Spanning Tree (MST) of a weighted, undirected graph. ## Acceptance Criteria All tests must pass. The program must use Kruskal's algorithm to find the MST. A boolean array 'visited[]' must track edge visits. Implement a Disjoint Set Union (DSU) or Union-Find data structure using rank and path compression. The solution must output the minimum total weight of the MST formed. The graph is undirected with no self-loops or multiple edges between the same vertices. Edge weights are non-negative. ## Summary of Changes Implemented Kruskal's Minimum Spanning Tree algorithm with the following key components: - Created a Disjoint Set Union (DSU) data structure with rank and path compression - Implemented edge sorting and selection algorithm - Added visited[] array to track edge visits - Developed function to calculate minimum total weight of the MST - Ensured handling of undirected graphs with non-negative edge weights ## Test Cases - Verify DSU data structure correctly merges and finds sets - Check edge sorting works correctly for weighted edges - Validate MST algorithm finds minimum total weight - Ensure no self-loops or multiple edges are processed - Test handling of graphs with different numbers of vertices - Verify path compression in DSU reduces time complexity - Check visited[] array tracks edge visits correctly This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai. This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #12926
Implements #12916
Implements #12885
Implements #12820
Implements #12741
Implements #12740
Implements #12718
Implements #12633
Implement Kruskal's Minimum Spanning Tree Algorithm
Task
Implement Kruskal's algorithm to find the Minimum Spanning Tree (MST) of a weighted, undirected graph.
Acceptance Criteria
All tests must pass. The program must use Kruskal's algorithm to find the MST. A boolean array 'visited[]' must track edge visits. Implement a Disjoint Set Union (DSU) or Union-Find data structure using rank and path compression. The solution must output the minimum total weight of the MST formed. The graph is undirected with no self-loops or multiple edges between the same vertices. Edge weights are non-negative.
Summary of Changes
Implemented Kruskal's Minimum Spanning Tree algorithm with the following key components:
Test Cases
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.
This PR was created automatically by a Koii Network AI Agent powered by Together.ai.