Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ncvescera/mkp-gasolver
A Multidimensional Knapsack Problem solver using Genetic Algorithm 🧬
https://github.com/ncvescera/mkp-gasolver
genetic-algorithm knapsack-problem multidimensional-knapsack multidimensional-knapsack-problem python unipg
Last synced: 24 days ago
JSON representation
A Multidimensional Knapsack Problem solver using Genetic Algorithm 🧬
- Host: GitHub
- URL: https://github.com/ncvescera/mkp-gasolver
- Owner: ncvescera
- License: gpl-3.0
- Created: 2023-08-26T09:45:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-17T19:40:48.000Z (over 1 year ago)
- Last Synced: 2024-10-23T01:46:15.516Z (2 months ago)
- Topics: genetic-algorithm, knapsack-problem, multidimensional-knapsack, multidimensional-knapsack-problem, python, unipg
- Language: Python
- Homepage:
- Size: 3.63 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mkp-gasolver
A Multidimensional Knapsack Problem solver using Genetic Algorithm 🧬
## Install
Install the environment and python requirements:
```bash
make install
```## Run
Activate environment, enter on `scr/` folder and run `main.py` script.
```bash
source .env/bin/acrivate
cd src/
python main.py data/MKP11.txt -pmut .05 -pcross .97 -ngen 250 -plen 100 --log INFO -tk 61
```If in doubt, run:
```bash
python main.py --helpusage: main.py [-h] [-plen POPULATION_LENGHT] [-pcross CROSSOVER_PROBABILITY]
[-pmut MUTATION_PROBABILITY] [-ngen NUMBER_GENERATION] [-tk TOURNAMENT_K]
[-log {DEBUG,INFO,WARNINGS}]
pathMultidimensional Knapsack Problem Solver
positional arguments:
path Instance File Pathoptions:
-h, --help show this help message and exit
-plen POPULATION_LENGHT, --population_lenght POPULATION_LENGHT
Initial Population Lenght
-pcross CROSSOVER_PROBABILITY, --crossover_probability CROSSOVER_PROBABILITY
Crossover Probability (from 0 to 1)
-pmut MUTATION_PROBABILITY, --mutation_probability MUTATION_PROBABILITY
Mutation probability (from 0 to 1)
-ngen NUMBER_GENERATION, --number_generation NUMBER_GENERATION
Number of generations
-tk TOURNAMENT_K, --tournament_k TOURNAMENT_K
Tournament random solution to select
-log {DEBUG,INFO,WARNINGS}, --log_level {DEBUG,INFO,WARNINGS}
Logging Level
```