Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing SwapChoice options #682

Closed
jcoupey opened this issue Mar 3, 2022 · 0 comments
Closed

Missing SwapChoice options #682

jcoupey opened this issue Mar 3, 2022 · 0 comments

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Mar 3, 2022

The SWAP* operator implemented back in #507 goes through a set of precomputed options that seem interesting cost-wise to exchange jobs between two routes (not necessarily in place). A SwapChoice object embeds the move information along with the estimated gain.

For each pair of ranks in source and target route, SwapChoice candidates are stored in a set (starting here). The good part of using a set here is that the candidates are sorted by decreasing gain. So when evaluating feasibility we can stop at the first valid move and discard further checks.

Now the problem is that storing in a set will also prevent inserting different moves with the same gain. The result is that an invalid move inserted first could "shadow" a valid move with same gain, whose validity won't be checked at all.

This problem is probably only theoretical in the wild since the probability of having different moves with the exact same gain using real travel times in seconds is close to zero. But I've confirmed that this actually happens on a regular basis with benchmarks (e.g. Solomon instances), probably due to the use of euclidean distances and grid-based points. In that case, we're missing some valid SwapChoice that were handy, simply because they were not considered at all since they show the same gain as another choice that turns out to be invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant