VeRyPy has a proven implementation of 3-opt* that operates on the entire solutions (which resides in local_search/solution_operators.py. Proven here means that it is able to replicate results from the literature.
3-opt was one of the trickiest heuristics to implement, and, hence, there were many attempts, some of which remain incomplete. These were left where they were, because, even if the 3-opt solution operation is verified to work through replication of Stewart & Golden results, VeRyPy would benefit from supporting implementations. For example, the 2 and 3 route heuristics as incompletely implemented in the do_3optstar_2route_move and do_3optstar_3route_move would allow a more convenient use of the 3-opt in some special occasions. Another advantage would a unified interface to 3-opt although with a slight performance and maintenance penalty.
While you, good reader, are at it, please also consider writing the do_naive_3optstar_move. In fact, thinking about it, that would be perfect place to start!
VeRyPy has a proven implementation of 3-opt* that operates on the entire solutions (which resides in local_search/solution_operators.py. Proven here means that it is able to replicate results from the literature.
3-opt was one of the trickiest heuristics to implement, and, hence, there were many attempts, some of which remain incomplete. These were left where they were, because, even if the 3-opt solution operation is verified to work through replication of Stewart & Golden results, VeRyPy would benefit from supporting implementations. For example, the 2 and 3 route heuristics as incompletely implemented in the do_3optstar_2route_move and do_3optstar_3route_move would allow a more convenient use of the 3-opt in some special occasions. Another advantage would a unified interface to 3-opt although with a slight performance and maintenance penalty.
While you, good reader, are at it, please also consider writing the do_naive_3optstar_move. In fact, thinking about it, that would be perfect place to start!