Closed slali-dev closed 1 year ago
A way to debug the issue is to use constraint_verifier
to verify that cut_long_edges
is working as expected; see https://github.com/optapy/optapy-quickstarts/blob/4bdf9cce4a5e1ed4ffb3691b940abb0168251d63/vehicle-routing/tests.py#L15-L22 for an example. I expect the issue is you only have 1 depot (which is in the lower right), meaning there will always be at least one long edge (since the depot is too far from the edges in the top left). You would need to add a depot in the top left, and assign some vehicles to it. As for why only single vehicle is being used in the above example, it because there are no constraints to encourage using multiple vehicles (since each vehicle will have at least one long edge because they all come from the lower right depot).
Hey @Christopher-Chianelli, thanks for your quick response.
You are right the issue here is having 1 depot IDK how I missed that, I've just solved it by updating get_long_edges
to ignore the distance between the depot and any other point.
Hello,
I've tried this demo locally and it's working fine. However, I want to use one constraint for a production use-case and the solver keeps violating this constraint.
method
get_long_edges
just loops through customer_list and accumulates the number of adjacent customers with distance > X.So I removed all the constraints and just kept this one
The score is
1Hard/0Soft
and it's using only 1 vehicle out of 11, which is weird because it's obvious that score0Hard/0Soft
is achievable with 11 vehicles and a timelimit of 600 seconds !!Here is the output:
Where have I gone wrong in the above scenario?
Thanks in advance.