Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 2.28 KB

README.md

File metadata and controls

70 lines (46 loc) · 2.28 KB

Concorde.jl

Build Status codecov

A Julia wrapper for the Concorde TSP Solver.

License

This Concorde.jl package is in MIT License. However, the underlying Concorde solver is available for free only for academic research as described in the Concorde website.

Installation

] add Concorde
] build Concorde

Currently, this package works in 64-bit operations systems of Windows 10, macOS, and Ubuntu.

Usage

Only symmetric problems are supported.

Using a distance matrix

using Concorde
M = [
     0  16   7  14
    16   0   3   5
     7   3   0  16
    14   5  16   0 
]
opt_tour, opt_len = solve_tsp(M)

The distance matrix M must be integer-valued.

Using coordinates

using Concorde
n_nodes = 10
x = rand(n_nodes) .* 10000
y = rand(n_nodes) .* 10000
opt_tour, opt_len = solve_tsp(x, y; dist="EUC_2D")

where dist is a choice of the distance function.

Available dist functions are listed in TSPLIB_DOC.pdf. (Some may have not been implemented in this package.)

Using an input file

Using the TSPLIB format:

opt_tour, opt_len = solve_tsp("gr17.tsp")

Related Projects