Skip to content

fontanf/localsearchsolverpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalSearchSolver (Python)

A solver based on local search.

This is the Python3 version of the C++ package fontanf/localsearchsolver.

localsearch

image source

Description

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

Examples

Travelling salesman problem

Knapsack problem

Usage, running examples from command line

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

Usage, Python library

See examples.

About

A solver based on local search

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages