Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
ideaAfter some meditation I was able to improve the lower bound considerably.The idea is simple, in an undirected graph each edge appears twice in the incidence matrix.² Taking the OP's data structure that means 2 values from each row¹! Except the first and the last row, since it's not a closed Hamilton circle (otherwise we would additionally have an edge (0,23) (or (23,0) respectively) to close the path ) So if we sum up all these values we get exactly the double of the path length. (see also Double_counting_(proof_technique)) So taking the first and second shortest edge, we can estimate for each inner row edge1 + edge2 >= shortest1 + shortest2 for the start and stop row we get edge1 >= shortest1 Including shortest2 improves the bound considerably and we get 79592.5. That is an optimal solution must be bigger or equal 79593
codehere the code if someone needs to reproduce it:
I hacked also a lower_bound2() routine taking advantage of more constraints, but this didn't improve the result that much (about 150). I doubt that this complicated approach is of much interest.
what forGood lower bound estimations are important to cut of subtrees in branch-and-bound algorithms! If you know that e.g. the remaining 22 edges have a length of at least 76000 and you know already a temporary optimum of 84000, it doesn't worth it to check starting edges of length 8000 or more. And so on. Since for each generation differences to the rows shortest sum up, the possible subtree get constantly smaller and a full solution comes into reach.
immediate consequenceThe OP's specific problem is not a very hard example of the TSP. hdb was able to produce a temporary solution of 84860 within 30 seconds, which is how we know now within a 5% margin of the optimum, if not already the optimum. For practical use this is more than acceptable.
Cheers Rolf ( addicted to the Perl Programming Language) ¹) starting indexing with 0
update²) contrived example
In reply to Re: Travelling problem (lower bound >= 79593) (+ example)
by LanX
|
|