This project implements parallel algorithms for solving the Multi-Objective Shortest Path (MOSP) problem using distributed and shared-memory parallelism. The implementation leverages:
- MPI for inter-node communication.
- OpenMP for intra-node parallelism.
- METIS for graph partitioning.
The goal is to efficiently compute Pareto-optimal solutions for large-scale graphs while analyzing scalability and performance across different system configurations.
This project was developed as part of a course on Parallel and Distributed Computing at FAST NUCES. It demonstrates the effective use of modern parallel computing techniques to solve challenging graph problems.
- Objectives
- Features
- Dependencies
- Directory Structure
- Usage
- Scalability Analysis
- Datasets
- Contributing
- License
- Acknowledgments
The primary objectives of this project are:
- Correctness: Implement a parallel algorithm for solving the MOSP problem that produces accurate results.
- Efficiency: Optimize the algorithm for performance using MPI and OpenMP.
- Scalability: Evaluate how the algorithm scales with increasing graph sizes and system configurations.
- Graph Partitioning: Use METIS to partition the graph and facilitate efficient parallel processing.
- Documentation: Maintain clear documentation and version control to track progress and ensure reproducibility.
- Multi-Objective Optimization: Supports multiple objectives (e.g., distance, cost, time) for shortest path computation.
- Parallelism:
- MPI: Distributes graph partitions across multiple nodes.
- OpenMP: Exploits shared-memory parallelism within each node.
- Graph Partitioning: Uses METIS to divide the graph into balanced subgraphs.
- Dynamic Updates: Handles dynamic changes to the graph (e.g., edge insertions or deletions).
- Performance Metrics: Measures execution time, FLOPs, and MFLOPS to evaluate performance.
To compile and run the project, you need the following dependencies:
- C++ Compiler: GCC or Clang with C++17 support.
- MPI: OpenMPI or MPICH.
- OpenMP: Included with most modern C++ compilers.
- METIS: For graph partitioning (install from METIS GitHub).
- Python (Optional): For preprocessing or validation scripts.
project-root/
├── src/ # Source code files
│ ├── parallel_update.cpp # Main implementation of the parallel MOSP algorithm
│ └── utils.cpp # Utility functions for parsing and debugging
├── datasets/ # Input graph and partition files
│ ├── dummy_100_nodes.txt # Example graph file in METIS format
│ └── dummy_100_nodes.txt.part.4 # Partition file generated by METIS
├── results/ # Output files (Pareto fronts, logs, etc.)
├── scripts/ # Scripts for preprocessing or analysis
├── LICENSE # License file
└── README.md # This file
Ensure you have the required dependencies installed. For example:
sudo apt-get install gcc g++ openmpi-bin libopenmpi-dev metisNavigate to the project directory and compile the source code:
mpic++ -std=c++17 -fopenmp src/parallel_update.cpp -o parallel_updateUse METIS to partition the graph:
gpmetis datasets/dummy_100_nodes.txt 4This will generate a partition file named dummy_100_nodes.txt.part.4.
Run the program using MPI:
mpirun -np 4 ./parallel_update datasets/dummy_100_nodes.txt datasets/dummy_100_nodes.txt.part.4The program outputs Pareto-optimal solutions and performance metrics to the results/ directory. Logs for each MPI rank are stored in separate files (output_rank*.txt).
To evaluate the scalability of the algorithm:
- Use graphs of varying sizes (e.g., 100, 1,000, 10,000 vertices).
- Experiment with different numbers of MPI processes and OpenMP threads.
- Measure execution time, speedup, and efficiency.
Example command for scalability testing:
mpirun -np 8 ./parallel_update datasets/large_graph.txt datasets/large_graph.txt.part.8The project includes example datasets in the datasets/ directory. You can also use publicly available graph datasets such as:
Ensure that the graph files are converted to the METIS format before use.
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
We would like to thank:
- Our instructor and teaching assistants for their guidance throughout the project.
- The authors of the research papers and tools (e.g., METIS, MPI) that inspired this work.
- The open-source community for providing valuable resources and libraries.
If you have any questions or suggestions, feel free to open an issue or contact us directly. Thank you for your interest in our project! 🚀