https://github.com/st1lson/geneticalgorithm
https://github.com/st1lson/geneticalgorithm
algorithm csharp genetic-algorithm knapsack-problem
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/st1lson/geneticalgorithm
- Owner: st1lson
- Created: 2021-11-02T15:20:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T12:05:29.000Z (over 4 years ago)
- Last Synced: 2025-02-27T01:53:21.052Z (over 1 year ago)
- Topics: algorithm, csharp, genetic-algorithm, knapsack-problem
- Language: C#
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GeneticAlgorithm
## Algorithm information
An algorithm based on biologically inspired operators such as mutation, crossover and selection.
[Wikipedia article](https://en.wikipedia.org/wiki/Genetic_algorithm) about Genetic algorithm.
## config.json example
Here we can easily and quickly configure algorithm limitations.
``` json
{
"Path": "default.txt",
"IterationsCount": 1000,
"Separators": [
"with weight",
"and cost"
],
"PossibleItems": [
"Item names..."
],
"MaxWeight": 500,
"ItemsCount": 100,
"MinItemCost": 2,
"MaxItemCost": 30,
"MinItemWeight": 1,
"MaxItemWeight": 20,
"PopulationCount": 100,
"EvolutionChance": 0.05,
"CrossingoverChance": 0.5
}
```
## Source file example
The first line stands for items count. For example use `100`.
Then follows enumeration of the items in the following format `Item with weight x and cost y` where `x` and `y` integers.
```
100
Item with weight x and cost y
Laptop with weight 5 and cost 25
...
```