Bumped into this while looking at #1281. Let's say we have an instance where:
- custom
durations matrices are provided;
- no custom
distances matrices are provided;
- distance should be used in optimization objective (one vehicle has a non-zero
costs.per_km value).
Then the distance matrix is filled with zeros in the else clause at:
|
// Custom durations matrix defined. |
|
if (!_distances_matrices.contains(profile)) { |
|
// No custom distances. |
|
if (_geometry) { |
|
// Get distances from routing engine later on since routing |
|
// is explicitly requested. |
|
_distances_matrices.try_emplace(profile); |
|
} else { |
|
// Routing-less optimization with no distances involved, |
|
// fill internal distances matrix with zeros. |
|
_distances_matrices.try_emplace(profile, durations_m->second.size(), 0); |
|
} |
|
} |
so the distance component in the cost is basically zero, contrary to the expectation. To make it worse: if costs.per_hour is zero and costs.per_km is non-zero, then basically any route will evaluate to zero (while one expects to optimize on distance only), yielding an arbitrary route ordering.
Bumped into this while looking at #1281. Let's say we have an instance where:
durationsmatrices are provided;distancesmatrices are provided;costs.per_kmvalue).Then the distance matrix is filled with zeros in the else clause at:
vroom/src/structures/vroom/input/input.cpp
Lines 957 to 969 in b31662a
so the distance component in the cost is basically zero, contrary to the expectation. To make it worse: if
costs.per_houris zero andcosts.per_kmis non-zero, then basically any route will evaluate to zero (while one expects to optimize on distance only), yielding an arbitrary route ordering.