https://github.com/uhpoler/designing-algorithms
This repository contains lab works in the discipline of Designing algorithms third semestr
https://github.com/uhpoler/designing-algorithms
a-star-path-finding ant-algorithm bfs-algorithm database genetic-algorithm k-way merge-sort red-black-tree traveling-salesman-problem
Last synced: 10 months ago
JSON representation
This repository contains lab works in the discipline of Designing algorithms third semestr
- Host: GitHub
- URL: https://github.com/uhpoler/designing-algorithms
- Owner: uhpoler
- Created: 2024-01-27T18:39:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-27T19:45:42.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T09:09:44.838Z (12 months ago)
- Topics: a-star-path-finding, ant-algorithm, bfs-algorithm, database, genetic-algorithm, k-way, merge-sort, red-black-tree, traveling-salesman-problem
- Language: Python
- Homepage:
- Size: 621 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lab Works
## Lab1
First version of this program sorts big files using external memory. The algorithm uses balanced k-way merge sort. Also was created a modified version, which allows writing to the output file only after sorting the entire set of numbers, reducing file writing operations. This increases the efficiency of the program and facilitates control over work with files.
### How to compile
Just type the following command in the console to compile the source files and generate the initial unsorted files:
~~~
python generate.py
~~~
So now you have an unsorted generated file of 10 MB. To sort it, type:
~~~
python lab1.py
~~~
Then if you want to run a modified version write:
~~~
python lab1_modif.py
~~~
## Lab2
This program is designed to generate a labyrinth and find a path through it. It is using the BFS (Breadth-First Search) and the A* (A-star) algorithm.
## How to compile
Just type the following command in the console to compile the source files:
~~~
python main.py
~~~
Then enter the dimension of the maze and see the result
## Lab3
This program implements a small database with the functions of:
- searching
- adding
- deleting
- editing
A red-black tree is used for data storage.
## How to compile
Just type the following command in the console to compile the source files:
~~~
python interface.py
~~~
## Lab4
This program solves the traveling salesman problem with the ant algorithm
- 100 peaks
- α = 2
- β = 4
- ρ = 0,4
- M = 30
## How to compile
Just type the following command in the console to compile the source files:
~~~
python main.py
~~~
## Lab5
This program solves the Salesman Problem (symmetric network) by genetic algorithm
The best result at 10,000 iterations was achieved with the following parameter values:
- batch_size = 4
- mutation_probability = 0.3
## How to compile
Just type the following command in the console to compile the source files:
~~~
python main.py
~~~