~ruther/ctu-fee-eoa

6e5e1c59addece399e9b9f76f753c2d8e456726b — Rutherther a month ago f4e5737
chore: add readme
1 files changed, 60 insertions(+), 0 deletions(-)

A codes/README.md
A codes/README.md => codes/README.md +60 -0
@@ 0,0 1,60 @@
The report is located at bohacek_frantisek_report.pdf, it has
been generated from report.md

Rust has been used to write the library and tsp problem
solution along with Cargo for managing the dependencies.

# How to run

To run the tsp, go into the tsp_hw01 folder, ie. `cd tsp_hw01`,
then use `cargo run --release -- <instance> <algorithm>`,
where instance can be any of the instances that's located
in `tsp_hw01/instances`. Supported aglorithms are:
```
ea
ls
ea_binary
```

So for example: `cargo run --release -- eil51 ls`

# Solutions

The solution is then saved to `tsp_hw01/solutions/<instance>`,
a png with the route is saved and a csv file with evaluations of
best candidates at a given time (time is measured by number of evaluations).

# Plotting

The solutions might be plotted by using `tsp_plotter` program.
`cd tsp_plotter` and then `cargo run --release -- <feature>`,
where feature is one of:
```
```
The features are hardcoded in the code and used in the report,
they say what algorithms and instances should be used in a given plot.
They are taken from the `tsp_hw01` folder.

# 'Reproducing' the plots in the report

To obtain the graphs in the report, use the following sequence of commands:

1. `compute.sh` to compute all the algorithms on all instances, 10 times for each instance.
2. Generate the plots, go to `tsp_plotter` folder, and run
```
cargo build --release
../target/release/tsp_plotter algorithms_fitness_eil76.json
../target/release/tsp_plotter algorithms_probability_all.json
../target/release/tsp_plotter crossovers_probability_all.json
../target/release/tsp_plotter heuristics_probability_all.json
../target/release/tsp_plotter perturbations_fitness_eil76.json
../target/release/tsp_plotter perturbations_probability_all.json
../target/release/tsp_plotter representations_probability_all.json
../target/release/tsp_plotter representations_fitness_eil76.json
```

Now all the csv solutions are in `tsp_hw01/solutions` and all the plots are in
`tsp_plotter/plots`

The graphs won't be 1:1, because randomness is involved and the seeds haven't been captured
and aren't configurable.