An open API service indexing awesome lists of open source software.

https://github.com/coac/magicsquare

Generate valid Magic square through branch and bound algorithm
https://github.com/coac/magicsquare

branch-and-bound magic-square multithreading

Last synced: 11 months ago
JSON representation

Generate valid Magic square through branch and bound algorithm

Awesome Lists containing this project

README

          

# MagicSquare

Generates a valid magic square using branch and bound algorithm.
The size of the magic square can be changed.
Multithreading is implemented, one thread is created for each possible value.

## Output example for a 4x4 :

```
Time : 25.759577584 seconds
Number of magicSquare : 7040
First solution :
----------------
|1 2 15 16
|12 14 3 5
|13 7 10 4
|8 11 6 9
```

You can display all possibilities by editing the *main* section.