Insert and Bind for TSP in Java

I wonder if there is a useful Java implementation for the Branch And Bound algorithm for TSP, or in general an OR structure that includes BnB for TSP.

Thank you for your help!

Marco

+3
source share
4 answers

BnB typically interacts with a complete subtask solver:

best_cost_soln_so_far = +inf
while (better_cost_soln = search_for_soln_cheaper_than(best_cost_soln_so_far))
{
    best_cost_soln_so_far = better_cost_soln
    backtrack_into_search
}

Thus, your search for sub-problems will return when the cost of any partial solution that he examines exceeds the binding established best_cost_soln_so_far. If the search for a subtask finds a better solution, it is updated best_cost_soln_so_far, and the search continues from where he left off, looking for an even better solution. This is pretty easy to implement.

, , TSP, - ; , .

+2

, "Java Javascript , Car and Carpet " , SimplexJS, MIP-, Javascript. ( 400 LOC), Java. TSP .

0

pdf. java- Branch and bound TSP

0
source

OptaPlanner (open source, Java) has an implementation of Branch and Bound. In particular, see the docs section on BaB. The implementation of the algorithm begins with this class , but it is difficult to understand.

It also has an example of TSP: although it is not configured with BaB by default, it’s trivial for this, adjusted tspSolverConfig.xmlas follows:

<solver>
  ...
  <exhaustiveSearch>
    <exhaustiveSearchType>BRANCH_AND_BOUND</exhaustiveSearchType>
  </exhaustiveSearch>
</solver>

There are additional optional parameters for controlling node sorting, the way node is searched, etc.

0
source

Source: https://habr.com/ru/post/1785969/


All Articles