Coder Social home page Coder Social logo

kglsm's Introduction

kGLSM

Build

  • ./gradlew build builds into .class files.
  • ./gradlew jar builds jar file for the library.

Run in Jupyter Notebook

This repository has examples written in Jupyter Notebooks. Before running, jar must be built first and requirements need to be installed (primarily `kotlin-jupyter-kernel``)

./gradlew jar
pip install -r requirements.txt
jupyter-notebook

Motivation

This library is to serve as a framework for performing Stochastic Local Search (SLS) based on Generalised Local Search Machines (GLSM). It was shown that best performing SLS (on a variety of classes of problems) are combinations of multiple pure SLS algorithms. The idea of GLSMs is a unified way to build a represent SLS algorithms that may (or may not be) combinations of pure strategies themselves, using Finite State Automata.

GLSM components

A GLSM consists of:

Note: In SLS 2005, the last two components are treated as inputs to GLSM instead, but for the sake of convinience I will be sticking to the definition above. Subject to change later.

Notes

This is WIP, the signatures most likely will be changed in the future, until I settle down on what works best. More algorithms, search space supports, and model problems are yet to be added.

References

[SLS 2005] H. H. Hoos and Stützle Thomas, Stochastic local search: foundations and applications. Amsterdam: Morgan Kaufmann Publishers, 2005. -- Main reference for SLS algorithms and GLSM framework. If not explicitly stated otherwise, you can assume that it's from this book.

[SURVEY 2012] Parejo, J.A., Ruiz-Cortés, A., Lozano, S. et al. Metaheuristic optimization frameworks: a survey and benchmarking. Soft Comput 16, 527–561 (2012). https://doi.org/10.1007/s00500-011-0754-8 -- a good review and a benchmark of existing libraries for metaheuristics/SLS algorithms. More comparisons with this approach against the pre-existing once are to come.

kglsm's People

Contributors

d-lowl avatar

Stargazers

 avatar

Watchers

 avatar

kglsm's Issues

Cost function diffs

Allow for diffs in cost function: instead of calculating a cost function itself, calculate difference in cost between two solutions. Might decrease constant computation term, which is important for large instances of TSP specifically

Simulated Annealing

Different temperature schedules

  • Linear
  • Multiplicative
  • Slow
    - [ ] Multiple steps -- same temperature

DSL

DSL for defining GLSMs outside the code. Potential fallback to JSON/YAML

Simplify Generic Signatures

Current generic signatures are really cumbersome pretty much everywhere. We want as much of automatic inference as possible.

Dokka

  • Add KDoc/Dokka
  • Host at jitpack

TSP Model Problem

  • Permutation search space
  • 2-exchange neighbourhood
  • TSP cost function
  • Loading from file -- TSPlib

Optionals:

  • k-exchange neighbourhood
  • recombination and mutation operators for permutation search spaces

Cannot create sequential LSM with single state

sequentialStateMachine<Double, BasicSolution<Double>> {
            step {
                name = "RandomWalk"
                strategy = RandomWalkStrategy(true)
            }
            terminationPredicate = FixedStepsPredicate(10)
        }

raises an exception

Exception in thread "main" java.lang.IllegalStateException: Required value was null.
	at space.d_lowl.kglsm.sls.StateMachineTransition$Builder.build(StateMachine.kt:36)
	at space.d_lowl.kglsm.sls.SequentialStateMachineBuilder.build(SequentialStateMachineBuilder.kt:109)

Add multi-state SLS

  • ILS with Restart
  • Memetic Algorithm
  • Random Iterative Improvement

Add those both as pre-built exploitable classes and as the code in the notebooks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.