Composite Calligraphy Notes

This whole thing is Craig Knecht's invention and achievement - water retention, water writing, automating the process, etc.

In early July, 2014 Craig suggested the idea of water writing the American Declaration of Independence in a magic square. At the time, that seemed absurdly ambitious. A major problem with the character squares was noise, (unwanted water). Eliminating the noise would require 4 complete alphabets of magic square letters, (one draining in each direction - left, right, up, down). Craig was undaunted by this monumental challenge and started cranking them out! Also, the declaration contains almost 9000 characters; there was no way to view a square big enough to contain that much text as retained water.

Less than 2 months later, the goal is achieved! All the alphabets are completed and included in the program. A Declaration of Independence text file from the Internet is 174 lines with a total of 8893 characters. The resulting composite magic square is order 1914. Editing the file to make longer text lines could reduce this order.

For viewing, the program writes the square to a Text.html file as a table without the square numbers. The cells are without borders and the cell width and height are specified as 0.5 pixel. See example.

Most browsers can slowly open a file with a very big table, (square order 1500 plus). Google Chrome, Mozilla Firefox, Opera, and Safari are ok; Internet Explorer is no good.

Caution: Avoid trying to open a big Text.html file with Internet Explorer 9 and earlier. It can tie up the computer and be very difficult to close, even from the Task Manager, if you can get that started.

CompleteSquare, MagicSquares Notes

Input type of square can be abbreviated, e.g., as semi, assoc. Suggested input: runs 10, iterations 1000.

Performance

Craig Knecht suggested starting the search for pairs to swap in only the rows and columns with the smallest and biggest sums. This gave a huge reduction in run times, in proportion to the order of the square: 88% for order 32, 97% for order 100.

With this reduced search, there is some drop in success rates starting at about order 24. This reduction can be magnified when the input square has many specified numbers. To compensate for this, the program sometimes elects to use a full square search or to retry with a full search if the reduced search is unsuccessful.

The programs have many other performance improvements. Notably, for starting associative squares, only half the values are randomly placed, (with their complements), and the square symmetry is maintained throughout the search.

Added Feature

For CompleteSquare and CompleteSquareSteps, if the input square is filled with the numbers 1 to n2, that is used as the starting square.

Sample Results

Typical success results, (input square all 0 for CompleteSquare):

runs: 10, iterations: 1000

             Semimagic             Magic             Associative
         ----------------     ----------------     ----------------
    n   squares loops  sec   squares loops  sec   squares loops  sec
  ----- ------- ----- -----  ------- ----- -----  ------- ----- -----
    4      10     29   0.0      10     72   0.0      10     35   0.0  
    5      10     28   0.0      10    194   0.0      10     61   0.0

    8      10     60   0.0      10    215   0.0      10    145   0.0
    9      10     67   0.0      10    224   0.0      10    125   0.0

   15      10    119   0.0      10    249   0.0      10    212   0.0
   16      10    129   0.0      10    244   0.0      10    237   0.0

   24      10    213   0.1      10    306   0.1       9    317   0.1
   25      10    218   0.1      10    313   0.2       9    333   0.1

   31      10    301   0.2       9    363   0.4       9    401   0.3
   32      10    306   0.2      10    361   0.3       9    417   0.3

   48       9    433   1.0       8    480   1.9       6    477   1.6
   49       9    402   1.2       8    546   1.9       6    485   1.8

iterations: 3000

   49      10    536   1.4      10    739   2.2      10    977   2.3

iterations: 6000

  100      10   1572  31.3      10   1815  39.7      10   1858  43.9

where: loops = actual iterations per square
       sec   = Win32 time per square, (seconds)

GetType Notes

For magic squares:

Self-complement is not added to the properties list for associative squares; all associative squares are self-complementary.

Pandiagonal by default means 2-way; otherwise, it is qualified as 1-way.

Bent diagonal and zigzag always imply pan-n-way in the directions of the bends. By default, bent diagonal means 4-way - up, down, left, and right. If it is not 4-way, it is qualified as 3-way, 2-way, or 1-way.

Zigzag by default means 4-way; otherwise, it is qualified as 3-way, 2-way, or 1-way. Zigzagk is implemented for k = 2, 3, 4, 5.

Here, types are exclusive of their "more magic" kinds. Semimagic does not include magic, pandiagonal 1-way does not include pandiagonal, and so on.

For Latin squares, see notes: Here, LS exclude DLS, and axial symmetric exclude double axial symmetric.

Orthogonal pair is reported only for adjacent orthogonal squares. In the detail file, orthogonal pair refers to that square and the immediately preceding square.

Ultramagic is reported for diagonal Latin squares that are associative and pandiagonal or weakly pandiagonal.

CopySquaresByType Notes

The type lists are comma separated lists of types like those output by GetType. To input an empty exclude list hit .

Types must be separated by commas. Upper/lower case is not important. The order of items in a list is not important, but abbreviation words may not be reordered.

Squares that match all of the include list, but do not match all of the exclude list, are copied.

"Most-perfect" is accepted for "pandiagonal, complete, compact".

"Ultramagic" is accepted for "associative, pandiagonal".

To get zigzagk put zigzagk in the include list.

For diagonal Latin squares, add DLS when specifying associative, pandiagonal, or ultramagic.

Abbreviations:

Many abbreviations are recognized, for example:

adjacent corner: adj cor
associative: ass, ass DLS
axial symmetric: axi, sym, sym LS, sym DLS
bent diagonal 1-way: bent 1
bordered: bord

bordering: bord ring
center symmetric: cent, csym, csym LS, csym DLS
compact: compa
complete: compl
concentric: con

diagonal Latin: dia, DLS
double axial symmetric: dou, dsym, dsym LS, dsym DLS
Latin: lat, LS
natural \diagonal: nbd, nat dia
near pandiagonal: near pan

normal magic: magic
orthogonal pair: ort, OLS, ODLS
pandiagonal: pan, pan DLS, PLS, Knut
self-complement: self comp
self-orthogonal: self ort, SOLS, SODLS

ultramagic: ult, ult DLS
weakly pandiagonal: weak, WPLS
zigzag2 2-way: zig 2 2

CopySquaresByType example, (modified console):