Giter Site home page Giter Site logo

simom0 / tsp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 16.56 MB

TSP optimization, Operations Research 2 project, UniPD 2022/23

C 98.72% CMake 1.28%
optimization travelling-salesman-problem tsp gnuplot 2-opt grasp nearest-neighbors extra-mileage operations-research tabu-search variable-neighborhood-search metaheuristics cplex genetic-algorithm simulated-annealing benders branch-and-cut concorde

tsp's Introduction

Travelling Salesman Problem (TSP) Optimization

Repository for the Operations Research 2 project regarding the TSP optimization, UniPD 2022/23.

The goal of the project is to solve the Travelling Salesman Problem with different approaches such as constructive heuristics, refinement heuristics, metaheuristics, exact methods, matheuristics ...

Project Structure

TSP
├── CMakeLists.txt          Project CMakeLists
├── README.md               Project README
├── build                   Generated by CMake
│   ├── ...
│   ├── main                Main executable file
├── data                    TSP data file
│   └── att48.tsp           Example .tsp file
├── include                 Header files
│   ├── ...
│   ├── tsp.h
│   └── utils.h
├── plot                    Plot files
│   └── att48.png           Example plot file
└── src                     Source files
    ├── ...
    ├── main.c
    └── utils.c

Requirements

  • Gnuplot: a portable command-line driven graphing utility
  • CPLEX: IBM CPLEX Optimizer
  • Concorde: TSP solver

Installation

  • Create the build directory using mkdir build
  • Navigate into the build directory with cd build
  • Run the command cmake .. to configure the project
  • Execute the make command to build the project

Usage

Input data are in .tsp from TSPLIB. Some of them are already stored in the data directory.

Run the main program with the following command and set the desired parameters:

./main -file <filepath> -solver <solver> -time_limit <tl> -seed <s> -verbose <v>

Example: solve the TSP regarding the att48 instance stored in the ../data/att48.tsp file with the greedy algorithm, running the command:

./main -file ../data/att48.tsp -solver GREEDY -time_limit 60 -seed 10 -verbose 10

To list all the parameters and solvers available run ./main -help or ./main --help

To create a random testbed run ./main -testbed <num_instances> <num_points> where num_instances is the number of TSP instances to be generated and num_points the size of each instance.

tsp's People

Contributors

giuliapisacreta avatar simom0 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

tanmoyie

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.