Skip to content

A benchmarking toolkit for comparing Kruskal's and Prim's minimum spanning tree algorithms across various graph configurations, with visualization tools and performance analysis reports.

License

Notifications You must be signed in to change notification settings

RyannSQ14/MSTree-Bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 🌳 MSTree-Bench: Minimum Spanning Tree Benchmarking Toolkit

Welcome to MSTree-Bench! This repository offers a comprehensive toolkit for benchmarking and comparing Kruskal's and Prim's algorithms for finding minimum spanning trees (MST) across various graph configurations. With integrated visualization tools and performance analysis reports, MSTree-Bench enables users to explore the efficiency and effectiveness of these two fundamental algorithms.

---

## 📖 Table of Contents

- [Features](#features)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Algorithms](#algorithms)
- [Visualization](#visualization)
- [Performance Analysis](#performance-analysis)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

---

## 🚀 Features

- **Algorithm Comparison**: Directly compare the performance of Kruskal's and Prim's algorithms.
- **Benchmarking**: Evaluate algorithms using various graph configurations.
- **Visualization Tools**: Visualize the graph structures and the MSTs generated by both algorithms.
- **Performance Reports**: Analyze the time complexity and memory usage of each algorithm.

---

## 🛠️ Getting Started

To begin using MSTree-Bench, follow these steps:

1. **Clone the Repository**:
   ```bash
   git clone https://github.com/RyannSQ14/MSTree-Bench.git
   cd MSTree-Bench
  1. Install Required Packages: Use pip to install the necessary Python packages.

    pip install -r requirements.txt
  2. Download the Latest Release: Visit the Releases page to download the latest version. Execute the downloaded file to get started.


🖥️ Usage

To use MSTree-Bench, run the main script. You can specify various parameters to customize the graph configurations and algorithm choices.

python main.py --algorithm <kruskal|prim> --graph <type> --nodes <number>

Example Command

python main.py --algorithm kruskal --graph random --nodes 100

This command benchmarks Kruskal's algorithm on a random graph with 100 nodes.


🔍 Algorithms

Kruskal's Algorithm

Kruskal's algorithm finds a minimum spanning tree for a connected weighted graph. It operates by sorting the edges and adding them one by one, avoiding cycles.

Prim's Algorithm

Prim's algorithm builds a minimum spanning tree by starting with a single vertex and adding the shortest edge from the tree to a new vertex until all vertices are included.


📊 Visualization

MSTree-Bench includes built-in visualization tools to help you understand how each algorithm processes the graph. Visualize:

  • Graph Structures
  • Edges Added to the MST
  • Final Minimum Spanning Tree

Visualization Example

Visualization

Run the visualization tool with the following command:

python visualize.py --algorithm <kruskal|prim> --graph <type>

📈 Performance Analysis

MSTree-Bench generates performance analysis reports detailing:

  • Execution Time
  • Memory Usage
  • Comparison Charts

Reports are saved as CSV files for easy access and review.


🤝 Contributing

Contributions are welcome! If you have suggestions for improvements or new features, please fork the repository and submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.


📫 Contact

For any inquiries, please contact:


💡 Topics

This repository covers the following topics:

  • algorithm-comparison
  • algorithm-visualization
  • benchmarking
  • data-structures
  • graph-algorithms
  • kruskal-algorithm
  • minimum-spanning-tree
  • performance-analysis
  • prim-algorithm
  • python

Thank you for your interest in MSTree-Bench! Happy benchmarking!

About

A benchmarking toolkit for comparing Kruskal's and Prim's minimum spanning tree algorithms across various graph configurations, with visualization tools and performance analysis reports.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •