Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 453 Bytes

File metadata and controls

20 lines (16 loc) · 453 Bytes

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.