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

Max distance With relevance to tasks #1118

Open
zahert opened this issue Jun 2, 2024 · 5 comments
Open

Max distance With relevance to tasks #1118

zahert opened this issue Jun 2, 2024 · 5 comments
Labels

Comments

@zahert
Copy link

zahert commented Jun 2, 2024

Hi I have a problem and not sure if VROOM can solve this specific case:-

we have max_distance & max_tasks parameters

The objective is to try to make sure that the distance between each of the tasks does not exceed a certain distance eg. max 5 KM per task. or even decide if the solution must have a certain max distance depending on the trips tasks that I will get out of the solution. is there any workaround to get this result

@zahert zahert changed the title Max distance With relevance to Tasks Max distance With relevance to tasks Jun 2, 2024
@jcoupey
Copy link
Collaborator

jcoupey commented Jun 3, 2024

The objective is to try to make sure that the distance between each of the tasks does not exceed a certain distance eg. max 5 KM per task

There is no way to enforce this currently, as the max_distance parameter applies to the full route. Can you expand on the use-case/reason to discard route legs over a given threshold?

@RegularnaMatrica
Copy link

You could get distance matrix between the points (ex. using OSRM) and then put large number (ex. max_distance) for values that are higher than 5 in matrix and pass this custom matrix to VROOM.

@zahert
Copy link
Author

zahert commented Jun 23, 2024

@RegularnaMatrica Can you please elaborate, the proposed solution and how it could impact VROOM solution

@jcoupey
Copy link
Collaborator

jcoupey commented Jul 10, 2024

The suggestion as I understand it would be to prefetch the matrices, then modify them by setting a huge cost for values that you want to avoid (e.g. those representing edges over 5km) before feeding them into VROOM. This may lead to solutions with less "long" legs since those would be highly penalized. The drawbacks are:

  • a more complex setup (handling and tuning the matrices customization);
  • if you change the matrices, you mess with the values returned in output (e.g. distance estimates);
  • you still have no absolute guarantee to avoid route legs over 5km (think a situation with an isolated location that is more than 5km away from any other location).

@RegularnaMatrica
Copy link

@jcoupey I thought that max_distance is maximum distance of the entire route, so setting all distances in matrix that are higher than 5 to value max_distance+1 should make such transitions yield unfeasible solution. You are right that this approach requires much more setup.

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

3 participants