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

Reindex sections based on indices #116

Open
N-Wouda opened this issue Mar 7, 2024 · 0 comments
Open

Reindex sections based on indices #116

N-Wouda opened this issue Mar 7, 2024 · 0 comments

Comments

@N-Wouda
Copy link
Member

N-Wouda commented Mar 7, 2024

Suppose my VRPLIB file has the following section:

NODE_SECTION
1  40  50
3  20  20
2  20  10

VRPLIB parses this as [[40, 50], [20, 20], [20, 10]], which ignores that the third and second node are provided in a different order in the data file. Thus, the parsed data are subtly wrong.

Additionally, the following

NODE_SECTION
1  40  50
2  20  20
4  20  10

is parsed in the same manner, despite node 3 never having been specified.

If we reindex the data based on the node indices, we get the correct order for free, and additionally, the second example will raise about 4 being out of range for the actual data. That means such an issue no longer fails silently.

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

No branches or pull requests

1 participant