All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fixed #108: Non-elementary checks for 2-cycles (
i->j->iare not allowed). Thanks @felizce
- 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)
- Logger using
sdplog.
- Issue: Bidirectional algorithm is not finding valid paths when using non-zero minimum resource values #89
- Issue: Bidirectional not finding valid path when using negative resource consumption # 90
- Issue: Dominance check for elementary paths #94
-
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.
-
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
- Issue #79
- Graph implementation replaced with LEMON. This brings significant improvement.
- Benchmarks against boost's r_c_shortest_paths (#65)
- Issues #66, #68, #69, #72
Rewrite of the bidirectional algorithm in C++ interfaced with Python using SWIG.
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))- Benchmarks (and comp results for BiDirectional) from Beasley and Christofides (1989)
- [BiDirectional] Bug fix for non-elementary paths (#52)
- [PSOLGENT] Bug fix for local search (#57)
- BiDirectional python implementation (can be found here)
- BiDirectional
method="random"see issues (hopefully only temporary).
v0.1.2 - 31/07/2020
- New paramenters:
time_limitandthreshold. - Custom REF, backward incompatible change: additional argument for more flexibility. These are the current partial path and the accumulated cost. Note that these are optional and do not have to be used. However, a slight modificiation to the function has to be made, simply add
**kwargsas well as the existing arguments.
v0.1.1 - 21/05/2020
- BiDirectional:
- 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.
- Final JOSS paper changes
v0.1.0 - 14/04/2020
- BiDirectional:
- Option to chose method for direction selection.
- vrpy submodule.
-
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.
- Negative edge cycle assumption
v0.0.14 - 01/04/2020
- Bidirectional
- Removed use of halway point filtering for labels
v0.0.13 - 26/03/2020
- Included dev requirements file with new package for testing and examples requirements.
- BiDirectional algorithm:
- Resource based comparisons for label extension
- Simplified attributes.
- Implemented full path joining procedure from Righini and Salani (2006).
- Rectified half-way check.
- parameterized some tests.
v0.0.12 - 14/03/2020
- Documentation.
- BiDirectional algorithm:
- Removed termination criteria.
- Implemented half way procedure from Righini and Salani (2006) in
self._half_way(Closes #21). - Changed label dominance to an equivalent but more elegant function.
- Changed final label saving to account for when neither of two labels dominate.
- Backwards incompatible path, cost and total_resource feature.
- Preprocessing functions.
v0.0.11 - 06/03/2020
- BiDirectional algorithm: returning path with edge not in graph (Closes #17 🙏).
- Heuristic used in Tabu for input in the networkx.astar_path algorithm (Closes #20).
-
Documentation.
-
BiDirectional algorithm:
- Final label comparisons.
- Seed handling for testing.
- Renamed variables to avoid confusion. - Avoiding getting stuck processing cycles of input graphs. - Ensuring that edges in path correspond to an edge in the input graph. - Avoid overwriting inputs (
max_resandmin_res). - Removed loops in_get_next_labeland_check_dominancein favour of list comprehensions. - Use ofcollections. - logs for debugging in BiDirectional. - added
_save_current_best_label. - Changed type of
self.finalLabel["direction"]from list toLabel.
-
Re-organised. Moved
label.pyandpath.pyintoalgorithms/.
v0.0.10 - 09/02/2020
- PuLP example.
- Documentation.
- Translated
examples/cgarfrom gurobipy to pulp. - CI build.
v0.0.9 - 25/12/2019
- Added example directory with column generation example.
- Check for negative cost cycles.
- PSOLGENT seed handling.
- Improved documentation.
- unit tests structure.
v0.0.8 - 15/07/2019
- Generic resource extension functions options.
- numpy.array integration.
v0.0.5 - 9/07/2019
PSOLGENT.GreedyElimsimple test.
- Fixed prune_graph preprocessing routine.
- YAPF google style.
v0.0.3 - 9/07/2019
GRASP.
- Documentation updates.
- Updated README.
- Removed duplicate code in
tabu.pyandgreedy_elimination.py.
v0.0.1 - 1/07/2019
- assertLogs tests for bidirectional algorithm classification.
- Personal MIT LICENSE.
GreedyElimProcedure.
- Documentation updates.
- Docstring modifications to include maths.
- Updated README.