Super Queens in Linear Time

Impressum

Enter the desired board size into the text field then press the button. Note, that for numbers, smaller than 10 except 1, there is no solution and this program will produce nonsense. Since this program provides a schematic 2-dimensional output of the solution, this javascript program actually needs quadratic time, not linear time. Quadratic complexity however is needed to print all the empty fields of the chess board not to compute the solution. If you are not interested in graphical output and satisfied with a list of positions, where the super-queens are placed, then you have linear complexity. In that case you should modify function p() which prints out the solution to print only the pairs (t,board[t]) where t corresponds to a row-number and board[t] to a column-number of a position of a super-queen. This script will work with actual versions of IE. It might not work with other Browsers. The linear time algorithm has been developed by Frank Schwellinger.


Explizite Lösung des N-Superdamen-Problem


Diese explizite Lösung ist natürlich zugleich auch eine explizite Lösung für das ganz normale N-Damen-Problem

Superdamen werden in der Literatur oft auch Maharadschas oder Amazonen genannt


Geben Sie die gewünschte Brettgröße in das Textfeld ein und drücken Sie den Button. Für Brettgrößen kleiner als 10x10 (Ausnahme: 1x1) existiert keine Lösung und das Programm produziert dann Unsinn. Da dieses Programm eine 2-dimensionale pseudografische Lösungsdarstellung ausgibt, benötigt es quadratische Zeit. Die quadratische Zeit wird nur für die Ausgabe der leeren Felder des Schachbretts benötigt, nicht um die Lösung zu berechnen. Sofern eine Liste von Positionen der Superdamen genügt, wird nur lineare Zeit benötigt. Für diesen Fall kann die Function p() so modifiziert werden, dass sie nur noch Paare (t,board[t]) ausgibt, wobei t die Zeile und board[t] die zugehörige Spalte einer Brettposition bezeichnen, an denen jeweils eine Superdame steht. Das Skript funktioniert mit aktuellen Versionen des Internet Explorers. Mit anderen Browsern funktioniert das Skript möglicherweise nicht. Der lineare Algorithmus wurde von Frank Schwellinger entwickelt.