Skip to content

2.0.1

Latest
Compare
Choose a tag to compare
@fikisipi fikisipi released this 09 May 17:34
  • elkai.solve_int_matrix and elkai.solve_float_matrix are now deprecated.
  • The solver no longer uses LKH 2, now we use LKH 3
  • The cleaner API looks like this (note that we now include the last element as the departure to the first city):
import elkai

cities = elkai.Coordinates2D({
    'city1': (0, 0),
    'city2': (0, 4),
    'city3': (5, 0)
})

print(cities.solve_tsp()) # Output: ['city1', 'city2', 'city3', 'city1']
import elkai

cities = elkai.DistanceMatrix([
    [0, 4, 0],
    [0, 0, 5],
    [0, 0, 0]
])

print(cities.solve_tsp()) # Output: [0, 2, 1, 0]