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

Redesing of BiDirectional #43

Closed torressa closed 3 years ago

torressa commented 4 years ago

Given there's a fair few extensions to make, I think it's worth changing the structure a bit so that working on them is a bit easier.

Improvements/Features/Bugs include:

The current structure doesn't lend itself that well to all of the above, therefore, I propose to split the current BiDirectional object into two. A Search helper object (for both backward and forward searches) and a modified BiDirectional object which will just orchestrate the searches and output the results.

Helper Search object

Purposes:

Individual Attributes (not shared)

Modified BiDirectional object

Purposes:

Individual Attributes:

torressa commented 4 years ago

Initial commit in branch patch43. Structure mostly set, just need to fix the interactions with the helper object.

torressa commented 4 years ago

Things ticked above are nearly done but need further testing:

torressa commented 4 years ago

Also, there should probably be a base object since there are a number of attributes that are shared between the the helper object and BiDirectional

torressa commented 4 years ago

Latest commit fixes unit tests! Parallel needs more testing

torressa commented 4 years ago

Elementary version doesn't work for the vrpy solomon instances.

torressa commented 4 years ago

Merge into dev as unittests passing, still needs work.

torressa commented 4 years ago

Works now on the solomon instances, like 10x slower than the old release...

torressa commented 4 years ago

https://github.com/Kuifje02/vrpy/issues/9#issuecomment-654394619

torressa commented 3 years ago

New work in branch patch43-v0.1.1. Reverted back to the latest release due to the slowness of the structure outline in the description of this issue. Will carry on with further speed up techniques to the future C++ version. There are some label pruning techniques that are really easy to implement and will provide an improvement (happens in python too if the problem is big enough); for instance see Lozano et al (2015) and Feillet et al (2004).

Will have to think about applying pruning techniques outside the algorithm, therefore allowing for other labelling algorithms to be easily implemented.

Time limit :heavy_check_mark: Threshold :heavy_check_mark: Dominance frequency :heavy_check_mark: Parallel :x: (deferred) Label elimination :x: (deferred)

torressa commented 3 years ago

Time limit going over quite significantly for large problems. Will release after fixing

torressa commented 3 years ago

Just committed work on the cpp branch

Remains to be done:

in tools/dev/ running ./build -p -r should create the python package and run the unit tests, however the dlls in .libs are not found by the python package.

torressa commented 3 years ago

Callbacks now working! Fails for bidirectional by I think it's a merging labels issue as it works for direction="forward". See example 8ac45b7fc4b69a11a4097f6e530a0042122bcd31 Broken python unittests: issue20, issue22, issue38 and issue41

torressa commented 3 years ago

Python unittests working on ubuntu! Once benchmarks are working we'll be good to go

torressa commented 3 years ago

Finally got it working on the solomon instances! @Kuifje02 old_vs_new