Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Education and Culture Executive Agency (EACEA). Neither the European Union nor EACEA can be held responsible for them.

Algorithms

2-Opt Search Algorithm for Travelling Salesman Problem

Users: 1 - Average Rating: 4.00


In optimization, 2-opt is a simple local search algorithm with a special swapping mechanism that suits well to solve the traveling salesman problem. This algorithm is sensitive to the initial point of search, i.e., its final results get changed by different initial points.

Scientific Area:
Python

Language/Environments:
Learning, Optimization

Target Group:
Basic


Cite as:
Ataee, P., 2020. Py2opt: How to solve the traveling salesman problem with the 2-opt algorithm. PyPI. Available at: https://pypi.org/project/py2opt/ [Acessed 17 November 2022]

Author of the review:
Gabriel Amaral
IPB


Reviews

You have to login to leave a comment. If you are not registered click here

Eligius Hendrix


This is really a very old and basic idea wic is good to explain the concept of local search. If we switch two nodes in a route and accept the switch if the route gets shorter, we can get to a better route that is not necessarily the best one which exists. Of course, to find the best one is basically NP hard.