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

Why cannot set time and duration costs to zeros? #139

Open
ilibar-zpt opened this issue Nov 10, 2023 · 3 comments
Open

Why cannot set time and duration costs to zeros? #139

ilibar-zpt opened this issue Nov 10, 2023 · 3 comments

Comments

@ilibar-zpt
Copy link

Is it just a default assumption or is there a computational problem?
How does one model a problem where only fixed cost matters?

@reinterpretcat
Copy link
Owner

Initially, cost minimization objective was required to be present and setting costs to zero would lead that serving any location will be considered as having the same cost. Later I've added distance/duration objectives, so this requirement can be seen as deprecated. This could be done, I guess, just some validation rules have to be adapted

@ilibar-zpt
Copy link
Author

ilibar-zpt commented Nov 20, 2023

@reinterpretcat would that be sufficient (aside from doc/cleanup)? I'm willing to look into it

diff --git a/vrp-pragmatic/src/validation/vehicles.rs b/vrp-pragmatic/src/validation/vehicles.rs
index cb561e39..61699b11 100644
--- a/vrp-pragmatic/src/validation/vehicles.rs
+++ b/vrp-pragmatic/src/validation/vehicles.rs
@@ -344,7 +344,7 @@ pub fn validate_vehicles(ctx: &ValidationContext) -> Result<(), MultiFormatError
         check_e1303_vehicle_breaks_time_is_correct(ctx),
         check_e1304_vehicle_reload_time_is_correct(ctx),
         check_e1305_vehicle_dispatch_is_correct(ctx),
-        check_e1306_vehicle_has_no_zero_costs(ctx),
+        // check_e1306_vehicle_has_no_zero_costs(ctx),
         check_e1307_vehicle_required_break_rescheduling(ctx),
         check_e1308_vehicle_reload_resources(ctx),
     ])

@reinterpretcat
Copy link
Owner

reinterpretcat commented Nov 21, 2023

It should be sufficient to make it work, but for bringing it to master branch more steps are needed:

  • adjust documentation
  • validation rule considerations:
    • if zero costs are specified, then I think we need to make sure that min-distance or min-duration objectives are specified
    • min-cost is still needed, if fixed cost is specified: do we require it or not?

As workaround, you can simply specify a very small costs (0.0000000...001) for distance and duration.

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

2 participants