Skip to content
/ QAP Public

Genetic algorithm for solving quadratic assignment problem

License

Notifications You must be signed in to change notification settings

donfaq/QAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solve Quadratic Assignment Problem with Genetic algorithm

Install

This script is written and tested on Python 3.9.

pip install -r requirements.txt

Run

Help prompt:

python main.py --help

usage: main.py [-h] [--pop POP] [--child CHILD] [--mutation MUTATION] [--stop STOP] p

Solving QAP with Genetic algorithm

positional arguments:
  p                    Path to the problem file or folder containing multiple problem files. Problem should be specified in '.dat' format. Problem examples can be found
                       in QAPLIB: https://doi.org/10.1023/A:1008293323270

optional arguments:
  -h, --help           show this help message and exit
  --pop POP            Population size (default: 30)
  --child CHILD        Number of children generated on each crossover step (default: 30)
  --mutation MUTATION  Child mutation probability (default: 0.2)
  --stop STOP          Maximum number of steps to perform without finding new opt solution (default: 1000)

How to run this code on single .dat file:

python main.py instances/tai12a.dat

How to run this code on folder with .dat-files:

python main.py instances

Releases

No releases published

Packages

No packages published

Languages