Skip to content

Routing A -> B -> A #4583

Mar 4, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

To me it's a bit unclear what you want: maybe add an complete example including a solution.
But it sounds like you should not do any routing at all and just solve an assignment-problem / bipartite-matching problem.

ortools' routing-solver is very generic and might be able to do this but:

  • -1's need to be bigMs / int64_t:max() such that they worsen the objective if picked
    • Alternatively / additive: Holes in NextVar domains (underlying CP model of routing-solver) -> domain-filter will disallow moves
  • those invalid transitions surely are not that smooth / discontinuous and local-search might suffer

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mtygesen
Comment options

Answer selected by mtygesen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants