vrp
vrp copied to clipboard
Why cannot set time and duration costs to zeros?
Is it just a default assumption or is there a computational problem? How does one model a problem where only fixed cost matters?
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
@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),
])
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.