https://github.com/cbarrick/magic-square
https://github.com/cbarrick/magic-square
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cbarrick/magic-square
- Owner: cbarrick
- Created: 2015-10-05T16:08:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-15T13:11:41.000Z (over 9 years ago)
- Last Synced: 2025-01-11T04:14:03.746Z (5 months ago)
- Language: Go
- Size: 0 Bytes
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Magic Square Solver
The goal of this project is to develop a genetic algorithm for solving [normal magic squares][1]. This repository contains an experiment comparing our genetic algorithm, written in Go, to a constraint satisfaction problem solver, written in Prolog.
[1]: https://en.wikipedia.org/wiki/Magic_square
## Source Layout
- `ga/` and `csp/`: These directories contain the source code for the genetic algorithm and constraint satisfaction solvers respectively.
- `ga_trial.go` and `csp_trial.pl`: These programs provide entry points to run each solver against specific trials. They accept the same command-line flags, given below, and their output is a timing of the trial.
- `-g `: The generator identifies the algorithm that generated the trial to be run.
- `-o `: The order identifies the size of the trial to be run. Only certain combinations of order and generator are valid. See the `trials.pl` file for valid combinations.
- `-d `: The difficulty of the problem must be one of `hard`, `med`, or `easy`.
- `-n `: The trial is run repeatedly for some count of iterations and the average time taken is reported.
- `-t `: If any particular iteration takes longer than the timeout, the program halts and "timeout" is printed.
- `trials.pl`: This file contains the trials to run in the experiment.
- `main.sh`: This script runs each of the solvers on each of the trials and prints a comma-separated table of the average time taken for each trial.
- `data.csv`: This is the experimental data collected from `main.sh` and referenced in the report.