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

Pass custom distance rounding functions #7

Closed
leonlan opened this issue Jul 8, 2022 · 1 comment · Fixed by #28
Closed

Pass custom distance rounding functions #7

leonlan opened this issue Jul 8, 2022 · 1 comment · Fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@leonlan
Copy link
Member

leonlan commented Jul 8, 2022

For the non-integral CVRP instances and VRPTW instances, I am unable to compute the same cost as given by the solution.

@leonlan leonlan added the bug Something isn't working label Nov 19, 2022
@leonlan leonlan self-assigned this Nov 19, 2022
@leonlan
Copy link
Member Author

leonlan commented Nov 27, 2022

I now know why this is going wrong. Each CVRPLIB instance has an EDGE_WEIGHT_TYPE attribute, which is used to calculate the solution values. CVRPLIB makes a distinction between EUC_2D, which are Euclidean distances, and EXPLICIT, meaning that the distance matrix is explicit.

The problem is with EUC_2D. Some instance sets, e.g., the X set, use integral rounding of the distances following the VRPLIB convention. Other sets, such as Li, do not use integral rounding, because they were proposed before the VRPLIB standards. However, both instance sets use EUC_2D as edge weight type, so there's no way to make a distinction which rounding function to use.

LKH-3 has two different types of edge weight types: EXACT_2D, meaning that we compute the distances exactly (no rounding), or FLOOR_2D, meaning that we use the floor function.

Since there are so many different rounding standards, I think it's useful to allow users to pass-in their own rounding functions.

@leonlan leonlan changed the title Distance calculation incorrect for non-integral instances Pass custom distance rounding functions Nov 27, 2022
@leonlan leonlan added enhancement New feature or request and removed bug Something isn't working labels Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant