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

Force shipment delivery order #581

Closed
rand-hazem525k opened this issue Sep 21, 2021 · 10 comments
Closed

Force shipment delivery order #581

rand-hazem525k opened this issue Sep 21, 2021 · 10 comments
Labels

Comments

@rand-hazem525k
Copy link

I'm using optimization and send shipment ONLY (no jobs) in the request
sometimes I have a shipment with high priority and I need to deliver first even if it isn't the optimized route
I used priority but it doesn't give the expected result, after reading the documentation about priority I figure out it mean priority to assign to to route deliver

SO, how can I achieve this?

In the request below, I want to deliver shipment-1 before shipment-2...

sample request

{ "shipments": [ { "priority": 80, "pickup": { "id": 1, "location": [ 39.242778, 21.538049 ], "service": 930, "time_windows": [ [ 1630213200, 1630234800 ] ], "description": "5ec1f41d-f622-48d3-836d-94b00e53fb65" }, "delivery": { "id": 2, "location": [ 41.073056, 19.124722 ], "service": 930, "time_windows": [ [ 1630213200, 1630231200 ], [ 1630299600, 1630317600 ], [ 1630386000, 1630404000 ], [ 1630472400, 1630490400 ] ], "description": "1d4932ca-7802-46f2-a123-4f5bf7f4e0f8" } }, { "priority": 0, "pickup": { "id": 3, "location": [ 39.24635, 21.5324901 ], "service": 930, "time_windows": [ [ 1630213200, 1630234800 ] ], "description": "Location_5ec1f41d-f622-48d3-836d-94b0avd3fb65" }, "delivery": { "id": 4, "location": [ 39.235461, 21.584299 ], "service": 3600, "time_windows": [ [ 1630207800, 1630234800 ], [ 1630294200, 1630321200 ], [ 1630380600, 1630407600 ], [ 1630467000, 1630494000 ] ], "description": "6398bc70-8223-450a-ba30-030bcd792abb" } } ], "vehicles": [ { "id": 1, "profile": "driving-car", "description": "Vehicle type: REEFER", "start": [ 39.242778, 21.538049 ], "time_window": [ 1630213200, 1632013200 ] } ], "options": { "g": true } }

@drecchia
Copy link

Hi there,
In case of too much jobs, priority just select which one should be done on that day, its not a delivery order.

Regards,
Danilo

@rand-hazem525k
Copy link
Author

Is there any way to give optimization some shipments that have to be delivered first?
like I have 5 shipments, I want 2 to be delivered first regardless of the waiting time ..etc, and for the 3 other shipments openroute determine the optimized route
is there any way to do that? like a mix between optimization and direction

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2021

There is no way to set a "do this shipment before that one" rule, notwithstanding the fact that this would also imply having the shipments in the same route.

If things are a matter of timing (do this early and do this later), then you may have luck translating your business logic to time window constraints.

@rand-hazem525k
Copy link
Author

rand-hazem525k commented Sep 22, 2021

@jcoupey Thanks for clarifying, just to make sure also I can't do that using task or jobs, right?

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 22, 2021

Yes, that would be the same when using jobs instead of shipments.

@geocept
Copy link

geocept commented Nov 8, 2021

I have same problem. I would need a solution for skip loader tour optimization.
There are four types of shipments:

a.) get empty skip from depot (location 1), deliver it to customer and fetch full skip there (location 2), drive to emptying place (location 3) and put empty skip back to depot (location 4)

b.) fetch full skip at customer (location 1), drive to emptying place (location 2) and put empty skip back to customer (location 3)

c.) fetch full skip at customer (location 1), drive to emptying place (location 2) and put empty skip back to depot (location 3)

d.) get empty skip from depot (location 1), deliver it to customer (location 2)

Is there a way to put more than two locations in a shipment? Do you have an idea how to modify the source code of vroom to make this possible? It would be bad if skip loader drives to the disposal at first to transport the empty skip back to the depot - well even if route is longer at least the full skip would have the be fetched at the customer site first.

If the shipment of 4 location would have to be split in three pairs of 2 locations, would there be a way to set constraints to influence the sequence result? Yes I would like to define that shipment 1 has to be done before shipment 2 of the same "ordergroup".
No, time windows are no option, because it depends on the route optimization if is better to do a.), b.), c.)... or better to do first part b.) than first part a.) and continue with second part b.).....

I found several discussions of the past years about forcing shipments to be before others. I think a lot of people would be happy if vroom could do it. Do you think we might find a way how to enhance vroom in this way. My team would be willing to contribute in any way if somebody could give us hints and if this "feature" is wanted by maintainers.

BR,
Michael

@jcoupey
Copy link
Collaborator

jcoupey commented Nov 9, 2021

Is there a way to put more than two locations in a shipment?

No, shipments are made up from two locations to model a typical pickup & delivery scenario. That's pretty much hard-coded in every aspect and operation involving them internally, so there is no easy way to extend that.

Do you have an idea how to modify the source code of vroom to make this possible?

Probably the less painful road to this would be to try implementing a generic notion of precedence. The A -> B precedence constraint could express that task B should appear in the same route than A, but after. Then internally this would be a matter of:

  • making sure the chains of precedence constraints are followed when creating routes in the heuristic process
  • discarding any move breaking a precedence constraint.

Probably doable but would need considerable adjustments, especially for the local search process. Also I have no idea how efficient the current solving approach would be then, even if adjusted for this kind of setup.

@geocept
Copy link

geocept commented Nov 9, 2021

Hi Julien,

thanks for quick reply.
Good idea to just add new key called something like "subsequentID" to shipments or jobs.

We had a look at source code of vroom and actually out of the scratch we have no idea what would have to be modified to release the two rules you mentioned. But I would like to give it a try. Is it possible that you do it as a commissioned work for us? Do you have the time to do such a job? Well I don't have the budget to spent much money in it, but perhaps you could make an offer for small money and use the result yourself. We are located near Strasbourg it should be easy to exchange, even French is no problem.
Would be nice if you could email to [email protected] in case you are interested.

BR,
Michael

@jcoupey
Copy link
Collaborator

jcoupey commented Nov 9, 2021

even French is no problem

Oh boy, you're ready willing to do anything! ;-)

@jcoupey
Copy link
Collaborator

jcoupey commented May 11, 2022

Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants