Coder Social home page Coder Social logo

jr-morgan / genetic-algorithm-framework Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 192 KB

A Genetic Algorithm Framework build for comparing evolutionary and genetic algorithms for the Travelling Salesman Problem and the Cutting Stock Problem

License: MIT License

C# 100.00%
tsp csp genetic-algorithm evolutionary-algorithms tsp-problem tsp-solver csp-solver

genetic-algorithm-framework's Introduction

What is Genetic Algorithm Framework

This software is a basic framework for creating genetic, evolutionary, local search, and other heuristic optimisation algorithms. This project was created as part of my Undergraduate Computational Intelligence module.

The project demonstrates Genetic, Evolutional, and Local search algorithms for the Travelling Salesman Problem (TSP), and for 1D Multiple-Stock Size Cutting Stock Problem (CSP).

What is the Travelling salesman problem? https://en.wikipedia.org/wiki/Travelling_salesman_problem

What is the Cutting Stock Problem? https://en.wikipedia.org/wiki/Cutting_stock_problem

This framework can be used to implement new algorithms for TSP or CSP, or extended to other optimisation problems.

How to run the algorithms

Builds can be downloaded from https://github.com/JR-Morgan/Genetic-Algorithm-Framework/releases

TSP

To run the console user interface simply run. This will load the default graph.

TSP_CLI.exe

To specify your own graph, simply append the file path to the above command. For example:

TSP_CLI.exe "GraphFiles\test.csv"

The program will print a list of searches.

Select search strategy:
(0): Exhaustive Search
(1): Random Search
(2): Local Search - Random initialisations
(3): Local Search - Greedy
(4): Evolutionary Search - Tournament

Enter the prefixed number to start that search. Note: Exhaustive search is not suitable for graphs over around 10 nodes as it of O(n!) complexity.

To simply evaluate the cost of a route, enter both the file path, and a complete route. For example:

TSP_CLI.exe "GraphFiles\test.csv" 1 2 3 4 5 6 7 8 9 10 11 12

All returns are in human readable format.

TSP Graph

The TSP Graph is functionally similar to the CLI, however, will plot the results on a graph.

Run the TSP_WPF.exe By default, a random graph of 25 nodes is created. From the UI you can generate a new graph of any size, or load one from file.

CSV Format for TSP

Graph files can be loaded by either UI option from a CSV format. Column 1 is the Node ID, Column 2 is the X position, and Column 3 is the Y position. Lines that do not match this format are ignored. See provided example files for reference.

CSP

The process for running CSP is similar to TSP (however there is no graph UI available as of yet for CSP)

Run CSP.exe (optional first argument specifies the problem file path) From there select an algorithm to run. There is also a method of performing parametric optimisation however is only currently setup to work for the island population genetic algorithm.

genetic-algorithm-framework's People

Contributors

jr-morgan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.