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

Verification functions #27

Closed
leonlan opened this issue Nov 27, 2022 · 4 comments
Closed

Verification functions #27

leonlan opened this issue Nov 27, 2022 · 4 comments
Labels
enhancement New feature or request long-term

Comments

@leonlan
Copy link
Member

leonlan commented Nov 27, 2022

It would be nice to provide functions that can verify any VRP-type solution. Of course, we need to make a verification function for each type of VRP-type problem.

I have no idea yet how the interface will look like. But here's an idea:

from cvrplib import read_instance, read_solution, verify

instance = read_instance(instance_path)
solution = read_solution(solution_path)

# Pass the solution and all relevant instance attributes
verify.cvrp(solution, instance['capacity']) 
verify.vrptw(solution, instance['capacity'], instance['duration_matrix'], instance['time_windows'])
@leonlan
Copy link
Member Author

leonlan commented Jan 7, 2023

I propose a more user-friendly interface:

verify(solution, instance, type=cvrp’) # verify CVRP solution
verify(solution, instance, type=vrptw’) # verify VRPTW solution

It’s not as explicit as the one I proposed before. But it’s way easier to use.

We should allow the first argument to be a file path or an actual solution object, and idem for the second argument.

@leonlan
Copy link
Member Author

leonlan commented Jan 7, 2023

In the verify module, we can write modular verification functions for each constraint.

  • verify/constraints/capacity.py
  • verify/constraints/time_windows.py

@leonlan
Copy link
Member Author

leonlan commented Feb 7, 2023

I'm in doubt whether this library should support verification of solutions. It may be doable for classical VRP variants, such as CVRP and VRPTW, but I don't know if it's feasible for other variants.

@leonlan
Copy link
Member Author

leonlan commented Feb 10, 2023

I have decided that this and #51 is not something we will support. Our library focuses on input/output of VRPLIB instances. Validating the instance content is outside the scope of this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term
Projects
None yet
Development

No branches or pull requests

1 participant