Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amiremohamadi/gasort
genetic algorithm for sorting large range of numbers (A.I course)
https://github.com/amiremohamadi/gasort
Last synced: 3 months ago
JSON representation
genetic algorithm for sorting large range of numbers (A.I course)
- Host: GitHub
- URL: https://github.com/amiremohamadi/gasort
- Owner: amiremohamadi
- Created: 2020-06-29T07:54:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-22T02:25:02.000Z (over 2 years ago)
- Last Synced: 2024-07-14T05:33:50.815Z (4 months ago)
- Language: Python
- Size: 42 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Genetic Sort
sorting numbers using genetic algorithm### requirements
- python3
- matplotlib### before usage
```sh
git clone https://gitlab.com/amiremohamadi/gasort
cd gasort
```
be sure you installed all requirements already
```sh
virtualenv -p python3 .venv
source .venv/bin/activate
pip install -r requirements.txt
```### usage
```sh
python gasort -h # to see help of usage
```read geneset from file
```sh
python gasort -f file.txt
```read from default stdin
```sh
python gasort 4 3 1 2
```running tests
```sh
python tests.py
```### benchmarks
here's a banchmark of running `gasort` on 50 numbers 10 times
| nth run | time in seconds |
|-------------|-------------|
| 1 | 7.030 |
| 2 | 5.630 |
| 3 | 7.446 |
| 4 | 7.740 |
| 5 | 8.040 |
| 6 | 12.41 |
| 7 | 5.633 |
| 8 | 5.633 |
| 9 | 10.72 |
| 10 | 8.418 |