Giter VIP home page Giter VIP logo

travellingsalesmanoptimization's Introduction

Traveling Salesman Optimization

GitHub Repo stars GitHub Issues or Pull Requests

Repository containing the project developed during the Operations Research 2 course in the academic year 2023/24.

The aim of the course is to explore different approaches for solving the famous Travelling Salesman Problem (TSP), ranging from very approximate solutions with heuristic algorithms down to exact methods employing CPLEX MIP solver.

๐Ÿ’ป Requirements

Install the following libraries to build the C program:

  • gnu make, v.3.81
  • gnuplot, v6.0
  • IBM ILOG CPLEX, v22.11
  • cmocka, v1.1.7 (optional)

For the profiling, install requirements with pip install scripts/requirements.txt.

Warning

Works only on Linux and MacOS

๐Ÿ› ๏ธ Usage

Once the repo is cloned, go to the folder and run make. Once it has finished, the executable will be located in make/bin.

To see the full list of commands, run

make/bin/tsp --help

Automated Profiling

To run profiling run:

python scripts/compare_algs.py {config file}

where config file is a configuration file in TOML format (for an example, see the TOML template). This will create a .csv file in /results with times for each algorithm and each dataset.

Once done, run the profiling with:

python scripts/perfprof.py results/{filename}.csv results/{outputfile}.pdf

๐Ÿ“บ Implemented Algorithms

  • HEURISTICS
    • Nearest Neighbour
    • All Nearest Neighbour
    • All Nearest Neighbour + 2OPT
    • Extra Mileage
  • META HEURISTICS
    • Tabu Search
    • Variable Neighborhood Search
  • EXACT METHODS
    • Benders Loop
    • Benders Loop with Patching
    • Branch & Cut
  • MATH HEURISTICS
    • Hard Fixing
    • Local Branching

Each algorithm has a set of hyper-parameters to change the behaviour or fine-tune the execution. Run the help command to see the full list.

๐Ÿ“ˆ Results

Heuristics perform exceptionally well with 2000 nodes, whereas exact models struggle even with 400 nodes. However, this speed advantage comes with a trade-off: the best metaheuristic (VNS) has a gap of less than 4% from the optimal solution. metaheuristics comparison

For exact solutions, the best choice, in terms of the time to reach the optimal solution, is Branch&Cut with fractional cuts and a heuristic initial solution. exact models comparison

Matheuristics are effective when exact models cannot find the optimal solution within a feasible time limit, enabling us to solve instances with more nodes by leveraging the CPLEX mathematical model. The best performing matheuristic is Hard Fixing, though it has a small gap compared to Local Branching. matheuristics comparison

Further results can be found in the project report

๐Ÿ›ก๏ธ License

GitHub License

travellingsalesmanoptimization's People

Contributors

enricobolzonello avatar rickyvendra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.