torressa / cspy

A collection of algorithms for the (Resource) Constrained Shortest Path problem in Python / C++ / C#
https://torressa.github.io/cspy/
MIT License
77 stars 24 forks source link

Ability to disable some checks on the graph. #116

Open andrea-cassioli-maersk opened 1 year ago

andrea-cassioli-maersk commented 1 year ago

Is your feature request related to a problem? Please describe. Ability to disable some checks on the graph.

Describe the solution you'd like I can imagine the possibility to specify flags to disable for instance connectivity checks.

Describe alternatives you've considered N/A

Additional context In my case I know when source/sink are not connected, so I can skip the search and I do not need to every time check connectivity. Moreover, I run the same search with different cost/resources so connectivity will not change over several calls.

torressa commented 1 year ago

In my case I know when source/sink are not connected, so I can skip the search and I do not need to every time check connectivity.

That may not make much sense. If I assume the graph is connected between source and sink when it isn't and attempt to get a path between them, something will probably go wrong (will run indefinitely or segfault). If you already know this beforehand (which means you checked somehow), why not just skip it?

Moreover, I run the same search with different cost/resources so connectivity will not change over several calls.

This makes more sense and can be implemented as a re-optimize after an update. One option could be to keep the BiDirectional object in memory and call something like update_graph. Of course, another would be to completely disable preprocessing of all kinds at the users' risk (including running indefinitely or segfault).

torressa commented 1 year ago

I have no time to work on these feature requests so feel free to make PR.