Water Retention on Magic Squares Solver Icon

Water Retention on Magic Squares Solver


Water Retention on Magic Squares with Constraint-Based Local Search

5.0 Stars (3)
1 Download (This Week)
Last Update:
Download wrmssolver_v012a.zip
Browse All Files
Windows BSD Mac



A Constraint-Based Local Search solver for the Water Retention on Magic Squares-problem.

The problem is a very hard combinatorial optimisation problem, invented by Craig Knecht. More can be read about it at:

Craig's website for the problem:

The solver is mainly based on the theory and ideas from my bachelor thesis, which I wrote at Uppsala University, Sweden, for the Astra Group which does research about Constraint Programming and related technologies:

Water Retention on Magic Squares with Constraint-Based Local Search

I 'm posting two solvers in this project. One written in C++ which is the fastest, at least for the heavier objective functions, and a Dynadec Comet solver which lets you easily post new constraints along with the Magic-constraints.

Author: Johan Öfverstedt

Water Retention on Magic Squares Solver Web Site


Algorithms, Mathematics


User Ratings

ease 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 0 / 5
features 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 0 / 5
design 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 0 / 5
support 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 0 / 5
Write a Review

User Reviews

  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    wrmssolver works great

    Posted 11/12/2012
  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Reliable and runs smoothly

    Posted 09/25/2012
  • 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Many famous mathematicians have previously signed the magic square guest book - Ben Franklin, Euler, Planck. De La Loubere's method for constructing magic squares shows the ingenuity of a bygone era. Johan's program is the modern equivalent of the De La Loubere's method. The magic square community is ecstatic to have this capability. Check out the tribute to Durer's 1514 magic square in the Associative_magic_square wiki that this program made possible. See the adaptations being make to this code in Harry White's Bordered Magic Square website (COMPLETE utility in the download section) My suggestion for Johan's next update would be to add the capability of specifying a set pattern to be searched. Example: I tried to find the maximum retention for the 13 x 13 associative magic square. It is always fun to be the first one to find a new record with a new free program. The program uses all its time searching for the best solution .. 6928 was what I found. I put the skeleton of that pattern .. ie the lake and pond borders into the F1 compiler and was able to boost the retention to 6944. This program is going to easily produce new records but it needs a second pass refinement capability of being able to specify the pattern from the first search as the basis of a second search. Great work Johan, Thanks !

    Posted 08/30/2012
Read more reviews

Additional Project Details

Intended Audience


User Interface

Command-line, Console/Terminal

Programming Language




Thanks for helping keep SourceForge clean.

Screenshot instructions:
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks