HPC · optimization · parallel computing
HPC: distributed Branch and Bound in Fortran and MPI
With two classmates, we wrote an exact solver for an asymmetric travelling salesman problem (a tour from Cotonou across 24 West African cities): a Branch and Bound parallelised with a dynamic master–worker scheme in Fortran 2008 and MPI, checked against Held-Karp, and measured with the laws of Amdahl and Gustafson.
- Period
- 2026–2027 academic year
- Status
- Group project (3 students) · Advanced Programming and MPI course
- Type
- Academic project
The project
Final project of the Advanced Programming and MPI course at ENSGMM, done as a group of three (AGRO Rachidi, BOUKARI Haboud, GNONLONFOUN Octave) and supervised by Dr Bruno S. DANDOGBESSI. The task: solve a routing problem exactly, parallelise the search with MPI, and audit its performance with the tools seen in class. The earlier MPI course exercises are linked below.
What I did, and what went wrong
- Model: 24 cities with geographic coordinates, asymmetric costs, Cotonou as the depot.
- Sequential core: depth-first Branch and Bound with a lower bound and a nearest-neighbour starting tour.
- Parallel version: the master splits the tree into subtrees sorted by bound and hands them out on demand. Workers report better tours with MPI_Isend; the master detects them with MPI_Iprobe, relays the new bound and prunes its queue.
- Verification: a separate Held-Karp program, used to check the optimum.
- Measurements: strong and weak scaling, three runs per point, analysed with speed-up, efficiency, Amdahl's and Gustafson's laws and the Karp-Flatt metric.
How I checked it
What I wanted to prove, the test I ran, and what I actually saw.
| What I wanted to prove | The test | What I saw |
|---|---|---|
| The solver finds the true optimum | Compared with the separate Held-Karp program on 15 instances | Same optimal cost on all 15 |
| The work is evenly shared | Nodes and busy time per worker rank | Balanced within about 1% |
Result
- 23-city instance (about 8.8 million nodes explored): 41.5 s sequentially, 21.8 s with 4 processes, a speed-up of about 1.9.
- 60% of the tasks are discarded by the master before being sent, because a better tour was found in the meantime.
Limits and next steps
- All measurements were made on a laptop with two physical cores (i5-4210M), where the speed-up stops near ×1.9. The report argues that this ceiling comes from the machine, not the program, but we haven't run it on a cluster yet.
- Group work: the code, report and slides belong to the three of us.
What I would do next
- Run the Slurm script on the university cluster to check the scaling beyond two cores.
Code and documents
- Repository github.com/AGRO-Rachidi/tsp-branch-and-bound-mpi
- Report (PDF, in French) github.com/AGRO-Rachidi/tsp-branch-and-bound-mpi/blob/main/rapport/Rapport_ILRO_PA.pdf
- MPI course exercises github.com/AGRO-Rachidi/hpc-fortran-mpi