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
- Host: GitHub
- URL: https://github.com/coac/magicsquare
- Owner: Coac
- Created: 2016-10-08T10:19:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-05T13:58:10.000Z (over 9 years ago)
- Last Synced: 2025-03-25T14:45:54.697Z (about 1 year ago)
- Topics: branch-and-bound, magic-square, multithreading
- Language: Java
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.