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

Write VRP instances #14

Closed
leonlan opened this issue Nov 5, 2022 · 11 comments · Fixed by #17 or #109
Closed

Write VRP instances #14

leonlan opened this issue Nov 5, 2022 · 11 comments · Fixed by #17 or #109
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@leonlan
Copy link
Member

leonlan commented Nov 5, 2022

It would be nice to have a function that could also write VRP instances. This was provided in the EURO-NeurIPS competition.

@leonlan leonlan added the enhancement New feature or request label Nov 19, 2022
@leonlan leonlan self-assigned this Nov 19, 2022
@leonlan leonlan mentioned this issue Nov 19, 2022
@leonlan
Copy link
Member Author

leonlan commented Nov 19, 2022

I made a start for writing instances.

  • Find the original VRPLIB reference
  • Check for inconsistencies across the VRPLIB instances
  • Think about the interface: how do we infer from instance which attributes should be written?

@leonlan
Copy link
Member Author

leonlan commented Nov 19, 2022

See http://www.bernabe.dorronsoro.es/vrp/index.html?/Problem_Instances/VRPLIBDesc.html for the original VRPLIB descrption.

@leonlan
Copy link
Member Author

leonlan commented Nov 19, 2022

LKH-3 VRPLIB convention

LKH-3 is very well maintained, so I think it's good to support reading those files as well (perhaps long term but not now?)

@leonlan

This comment was marked as resolved.

@leonlan

This comment was marked as outdated.

@leonlan leonlan mentioned this issue Nov 20, 2022
6 tasks
@leonlan leonlan added this to the V1.0 milestone Nov 20, 2022
@leonlan

This comment was marked as resolved.

@leonlan
Copy link
Member Author

leonlan commented Feb 5, 2023

I have removed the write module because this wasn't ready yet, and I want to speed up the release of V1. So this is an open issue again.

@leonlan leonlan reopened this Feb 5, 2023
@leonlan leonlan removed this from the V1.0 milestone Feb 5, 2023
@leonlan leonlan modified the milestones: V1.1, V1.2 Mar 7, 2023
@leonlan
Copy link
Member Author

leonlan commented May 2, 2023

See this commit for the (removed) write module 885f9cc#diff-6fa8cb67482a47a8390d40bcd32b10d53f6ffd7a723f412d71a486039267557f.

@N-Wouda
Copy link
Member

N-Wouda commented Sep 30, 2023

This is periodically useful for the PyVRP instances as well (I'm running into this now with multi-depot VRP). Do you want to be really strict about what's written? A simple dict -> specification/section type writer is easy enough: every value that's iterable becomes a section, and every value that's not becomes a specification. The onus would then be on the user to ensure that data encodes a valid VRPLIB instances, but to be fair, that's on the user anyway when they're writing instances.

@leonlan
Copy link
Member Author

leonlan commented Oct 2, 2023

Yeah that seems like a good solution to me. I'll try to make this feature later this week.

@leonlan
Copy link
Member Author

leonlan commented Oct 6, 2023

@N-Wouda I implemented the write_instance and write_solution functions. Hopefully, they are useful!

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.

2 participants