routing solver dropping nodes, but leaving vehicles unused

239 views
Skip to first unread message

J. E. Marca

unread,
May 9, 2019, 5:50:42 PM5/9/19
to or-tools-discuss
I have a strange situation in the routing solver in which nodes are being dropped when grouped together, but can each be served individually. 

I have a case with three pickup and delivery pairs.  If I load a problem with 5 vehicles and just one of the three pairs, in every case the solver assigns the pickup and delivery pair to a route.

If I run all three pairs at once with 5 vehicles, one of the pickup and delivery pairs is dropped every time, even though there are three vehicles doing nothing.

I realize without looking at my code it is difficult to help, but I'm wondering why the solver isn't trying harder to load that third demand pair on an unused vehicle.  It is always the exact same pair, and the only constraint I am placing on the vehicles is that they have a capacity of one (pickup, then deliver), and a time window from 0 to simulation horizon.

The vehicles are not *unused*, but rather go from the start node to the end node.  An example output string of an empty vehicle is:

Route for vehicle 4:
node 0, mapnode 0, Load 0,  Time(0:00:00,10 days, 10:00:00) Slack(0:00:00,10 days, 10:00:00) Time(0:00:00)  Link (Time 0:00:00, distance 0 mi), visits: 0
 -> 0 Load(0)  Time(0:00:00,10 days, 10:00:00)  Link time(0:00:00) Link distance(0 mi), visits 1
Distance of the route: 0 miles
Loads served by route: 0
Time of the route: 0:00:00

My "visits" variable is a counting dimension, so the vehicle has left the starting depot and traveled to the destination depot node in order to increment that count.  But the solver could assign the vehicle to pickup the remaining trip pair, and would knock back the objective value significantly by removing the disjunction penalty from those un-visited nodes.

Any advice on how to convince the solver to try harder?

Thanks,
James

J. E. Marca

unread,
May 9, 2019, 7:52:30 PM5/9/19
to or-tools-discuss
Never mind, I think I just figured out how my constraints are conflicting.  As usual, I get a clue after posting...

Trans Lation

unread,
Jul 31, 2020, 7:26:45 AM7/31/20
to or-tools-discuss
Hi
Could you please tell us how you solved it ? I am kind of in similar situation. Using Python wrapper

blind.lin...@gmail.com

unread,
Jul 31, 2020, 11:15:17 AM7/31/20
to or-tools-discuss
Well, this was a long time ago, but looking at time stamps and git commit messages, I *think* I found the right project and issue.

It really was just conflicting constraints.  Looking at my git commits, I figured it out by dumping diagnostic print messages about time windows and constraints, and I was able to see that I was generating conflicting constraints that could not be resolved.  

There was no special trick or ORTools hack that solved the problem.  It was just my logic about setting up my modeling rules was wrong.  When I dumped out exactly what was going on before I set the constraints, it was obvious that my logic was wrong.

Post your issue and code.
Reply all
Reply to author
Forward
0 new messages