Sorting by Reversals is a small python program that records the time to sort random permutations using algorithms from the Quantum routing with fast reversals paper: GDC(TBS), GDC(ATBS), OES (odd-even sort).
## Installation
Simply download the repository.
## Usage
To run the program, call ``main(NUM_PERMS_PER_LENGTH, LENGTH_FROM, LENGTH_TO)``` in the ```main.py``` file, where
```NUM_PERMS_PER_LENGTH:``` number of random permutations to run the algorithms on per permutation length
```LENGTH_FROM:``` starting permutation length
```LENGTH_TO:``` ending permutation length
In other words, for each ```N``` from ```LENGTH_FROM``` to ```LENGTH_TO```, the program generates a csv file ```data/len_N_random_perms.csv``` containing ```NUM_PERMS_PER_LENGTH``` permutations.
The resulting csv files will be generated in the ```data/```directory. Each csv file will contain a list of the permutations generated and the corresponding routing times for the three algorithms, GDC(TBS), GDC(ATBS), and OES.
For example, the following may be the output for ```data/len_10_random_perms.csv``` when ```NUM_PERMS_PER_LENGTH``` = 9.