Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Master SDNUM - Étude de cas

Exercices – ILP

Exercise 1 – Travelling Salesman Problem (TSP)


Problem statement : A Parisian salesman must program a tour in several cities. He must start from
Paris, visit each city exactly once and go back to Paris. We want the total distance travelled be minimal.

Here are the cities to visit and the distances (in kilometers) between them :

1-Bordeaux 2-Lille 3-Lyon 4-Marseille 5-Paris 6-Rennes 7-Roubaix 8-Toulouse 9-Dunkerque


1-Bordeaux 0 796 482 640 583 449 801 244 876
2-Lille 796 0 685 995 212 562 11 900 79
3-Lyon 482 685 0 309 463 761 701 538 763
4-Marseille 640 995 309 0 766 921 1011 405 1074
5-Paris 583 212 463 766 0 338 229 676 292
6-Rennes 449 562 761 921 338 0 579 699 569
7-Roubaix 801 11 701 1011 229 579 0 908 91
8-Toulouse 244 900 538 405 676 699 908 0 969
9-Dunkerque 876 79 763 1074 292 569 91 969 0

In the literature of Graph Theory, this problem consists of finding an hamiltonian cycle of minimal
length. The non directed graph that we consider is such that the vertices are the cities and the edge
beween a city i and a city j is valuated by the distance between i and j.

Propose a model of this problem using a mathematical program. Indication : use the following xij
variables : xij = 1 if the edge (i, j) is travelled and 0 otherwise (for all i and j such that i < j). Solve
the instance of the problem by using Julia/JuMP/Cbc.

1/1 E. S. - 2022

You might also like