A solver based on local search.
This is the Python3 version of the C++ package fontanf/localsearchsolver.
The goal of this repository is to provide a simple framework to quickly implement algorithms based on local search.
Solving a problem only requires a couple hundred lines of code (see examples).
Algorithms:
- Restarting local search
restarting_local_search
- Iterated local search
iterated_local_search
Install
pip3 install localsearchsolverpy
Running an example:
mkdir -p data/travellingsalesman/instance
python3 -m examples.travellingsalesman -a generator -i data/travellingsalesman/instance
python3 -m examples.travellingsalesman -a restarting_local_search -i data/travellingsalesman/instance_50.json
python3 -m examples.travellingsalesman -a iterated_local_search -i data/travellingsalesman/instance_50.json
Update:
pip3 install --upgrade localsearchsolverpy
See examples.