VROOM-Project / vroom

Vehicle Routing Open-source Optimization Machine
http://vroom-project.org/
BSD 2-Clause "Simplified" License
1.35k stars 340 forks source link

Algorithm customization #1151

Closed AlirezaAzizi14 closed 2 months ago

AlirezaAzizi14 commented 2 months ago

Your project is incredibly useful and excellent for addressing VRP problems. Is it possible to customize this project for solving our own challenges without having to deal directly with the code?

Problems:

  1. If a courier refuses to collect or deliver an order once, that courier should not be assigned the same order in the next round.

    • Important note: If a courier refuses or fails to collect order number 1, that courier should not be assigned order number 1 again. However, other orders can still be assigned to the courier.
  2. Couriers have specified Time Windows. A courier may not be working during a specific time within the provided Time Window. During this time, if a request arises and the courier is available, the assignment should be prevented.

  3. Couriers have designated Break Times. This means that a courier may be unavailable due to personal reasons such as lunch or other issues. During this period, no orders should be assigned to the courier.

  4. If a courier has active packages, the number of packages should be checked. If it is the last package and the courier is near the store, the courier can be selected for a new order.

  5. If the last package held by the courier requires more time for collection than other packages, the courier should not be assigned a new order due to the time constraint.

  6. Couriers have specific working shifts. If a courier is not available during their shift, no orders should be assigned to them.

  7. If a courier has the ability to carry important packages such as medicine or food, these high-priority packages should be assigned to couriers active in that domain.

  8. If a courier encounters an issue during delivery (e.g., an accident or breakdown), the orders assigned to that courier should be prioritized for reassignment and delivery.

  9. If the algorithm uses internal services for finding the best courier based on coordinates, it should also provide the cost for each stage.

    • Important note: It would be ideal if the algorithm could take an input specifying the cost calculation for each type of vehicle.
  10. If multiple orders from the same customer are registered at different times, the algorithm should be able to recognize that the first package for customer number 1 was assigned to courier number 10. If the courier still has capacity, the second package for customer number 1 should also be assigned to the same courier.

Can I customize this project to address the issues that were raised?

jcoupey commented 2 months ago

In order to get relevant solutions from VROOM for your use-case, you have to translate the above list of business constraints into modeling items. The way to do that can be more or less straightforward based on your situation and workflow.

You would not have to touch any of the code, so it's more like tuning the input model rather than customizing the algorithm. Did you lookup the docs? You'll find info on many things covering your requirements: time windows, breaks, capacity restrictions, priorities, skills etc.

chrishampel88 commented 2 months ago

@jcoupey hi! I wanted to make a vroom query, I have the following example and I want to know how to use the priority issue correctly, since setting the priority always gives me the same answer without counting the priority

{ "jobs":[ {"id":31,"service":0,"amount":[1],"pickup":[1],"priority":10,"location":[-58.45744963265306,-34.61729655102041],"skills":[1]}, {"id":125,"service":0,"amount":[1],"pickup":[1],"priority":100,"location":[-58.268590775510205,-34.73307893877551],"skills":[1]} ], "vehicles":[ {"id":73,"profile":"driving-car","start":[-58.427480432982065,-34.602852512056955],"end":[-58.517882043905,-34.642935504561],"capacity":[250],"skills":[1],"color":"#EA4A28"} ] }

greetings from Argentina

jcoupey commented 2 months ago

I don't really get the problem here: can you provide some more detail on the solution you get and what you'd expect to be different?

AlirezaAzizi14 commented 2 months ago

Do you mean that I should consider my own list of business constraints and provide the input model based on that?
And if the inputs that your model receives are not sufficient, how do you suggest I adjust the model according to what I need so that it works based on my inputs and criteria and provides the highest accuracy and the best output?

The problem I have is: which algorithms exactly have you used in this project for routing and assignment? Also, what inputs do those algorithms take? And what values should I provide for those inputs to get the highest accuracy and the best output?

jcoupey commented 2 months ago

Do you mean that I should consider my own list of business constraints and provide the input model based on that?

Yes, that would be the only way for VROOM to account for the needs of your scenario.

And if the inputs that your model receives are not sufficient

Most of what you mention is covered, please check the docs with the keywords I mentioned in my message above. I would start modeling based on what is supported (probably everything) before worrying about what's missing.

The problem I have is: which algorithms exactly have you used in this project for routing and assignment?

There are a couple tickets here discussing heuristics and the solving approach in general. If you want to know more, you'll have to read the code and refer to existing VRP papers for context.

But that is beside the point: if you simply want to use the project, you don't really need to understand the internals, just the input model logic.

Also, what inputs do those algorithms take?

https://github.com/VROOM-Project/vroom/blob/master/docs/API.md

AlirezaAzizi14 commented 2 months ago

which algorithms exactly have you used in this project for routing and assignment?

jcoupey commented 2 months ago

which algorithms exactly have you used in this project for routing and assignment?

Quoting from my previous reply: "There are a couple tickets here discussing heuristics and the solving approach in general." If you really want to learn more (again you don't have to in order to simply use the project), then please take at least some time to search from past issues to look them up. Happy to answer more precise questions on any of these afterward.

jcoupey commented 2 months ago

Closing as answered. Feel free to open additional tickets for follow-up questions on some of the features I hinted to, but please make them specific.