Releases: torressa/cspy
v1.0.3
v1.0.2
Changed
- Refactored Python and C++ unittests.
- Added C# interface.
- Moved documentation from readthedocs to github pages.
- Non-elementary checks for 2-cycles (
i->j->iare not allowed).
Added
- Logger using
sdplog.
Fixed
v1.0.1
Coauthored with @dvbuntu! 🚀
Changed
-
Fix minimum number of nodes on path condition for
PSOLGENT. -
Force node sorting to start with "Source" and end with "Sink" in
PSOLGENT. -
Force inclusion of Source and Sink nodes in
PSOLGENTpaths. -
Clean up:
BiDirectionalto use search objects again.labelling.*removeLabelExtensionunified withParams.
Added
-
Record
randvalue used to generatePSOLGENTpaths from positions. -
Make upper and lower bound of
PSOLGENTinitial positions optional arguments. -
2opt in
PSOLGENTfor better evaluation of solutions. -
Critical resource as a parameter to
BiDirectional -
[EXPERIMENTAL] Add critical resource preprocessing attempt using longest paths
Fixed
- Issue #79
v1.0.0
v1.0.0-alpha
Rewrite of the bidirectional algorithm in C++ interfaced with Python using SWIG.
Comparison
I compared the performance on a solomon instance using vrpy. The exact=True/False are attributes of vrpy that uses the threshold option.
Changed
The algorithm improvements include:
- Faster joining procedure (when
direction="both") with lower bounding and sorted labels - Bounds pruning using shortest path algorithm lower bounds and the primal bound obtained during the search (experimental).
- Backwards incompatible change to do with custom REFs. Now, instead of specifying each function separately, you can implement them in class that inherits from
REFCallback. and then pass them to the algorithm using theREF_callbackparameter. This change applies to all algorithms.
Note that:- the naming of the functions has to match (
REF_fwd,REF_bwdandREF_join) - so does the number of arguments (not necessarily the naming of the variables though)
- not all three have to be implemented. If for example, one is just using
direction="forward", then onlyREF_fwdwould suffice. In the case of the callback being passed and only part of the functions implemented, the default implementation will used for the missing ones.
- the naming of the functions has to match (
e.g.
from cspy import BiDirectional, REFCallback
class MyCallback(REFCallback):
def __init__(self, arg1, arg2):
# You can use custom arguments and save for later use
REFCallback.__init__(self) # Init parent
self._arg1: int = arg1
self._arg2: bool = arg2
def REF_fwd(self, cumul_res, tail, head, edge_res, partial_path,
cumul_cost):
res_new = list(cumul_res) # local copy
# do some operations on `res_new` maybe using `self._arg1/2`
return res_new
def REF_bwd(self, cumul_res, tail, head, edge_res, partial_path,
cumul_cost):
res_new = list(cumul_res) # local copy
# do some operations on `res_new` maybe using `self._arg1/2`
return res_new
def REF_join(self, fwd_resources, bwd_resources, tail, head, edge_res):
fwd_res = list(fwd_resources) # local copy
# do some operations on `res_new` maybe using `self._arg1/2`
return fwd_res
# Load G, max_res, min_res
alg = BiDirectional(G, max_res, min_res, REF_callback=MyCallback(1, True))Added
- Benchmarks (and comp results for BiDirectional) from Beasley and Christofides (1989)
Fixed
Removed
- BiDirectional python implementation (can be found here)
- BiDirectional
method="random"see issues (hopefully only temporary).
v0.1.2
JOSS Review
Release for JOSS paper.
Code changes include:
- BiDirectional Algorithm:
- Reverted backward REF as it is required for some problems.
- Added REF join parameter that is required when joining forward and backward labels using custom REFs. - Moved notes and examples from docstrings to the docs folder
v0.1.0
Added
- BiDirectional:
- Option to chose method for direction selection.
- vrpy submodule.
Changed
-
BiDirectional:
- Label storage, divided into unprocessed, generated and non-dominated labels
- Restricted join algorithm to non-dominated label
- Changed backward resource extensions to avoid complex and computationally costly inversion. Additionally, it removes the requirement of an explicit backward REF.
- Filtering for backward labels in join algorithm.
- Cleaned up unused label operator overloads.
- Removed costly comparison in
_propagate_label. - Changed generated labels attributes from dict of deques to dict of int with count.
-
Rework of path and algorithm attributes to avoid duplication
-
Replaced
networkx.astaralgorithm with a procedure that finds a short simple
path usingnetworkx.shortest_simple_paths.
v0.0.14
v0.0.13: Updated "join" algorithm in BiDirectional
Some bug fixes have led to the following changes in the BiDirectional
- Changed label comparison from weight to resource based.
- Simplified and cleaned up implementation (somewhat).
- Implemented full path joining procedure, Algorithm 3, from Righini and Salani (2006). This involved rectified the half-way check that I thought I'd implemented in v0.0.12.
- Parameterized some tests.
