November 12, 2016
6
COMBINATORIAL SEARCHING (F5B: 12 Nov 2016 1636)
7.2.2
Sprague
Onnen
Ahrens
Walker
SWAC
omputer
UCLA
Kennedy
University of Tennessee
IBM 1620
Bunh
University of Illinois
IBM System 360-75
Bitner
Preuer
Engelhardt
distributed omputation
FPGA
permutation
data strutures
Langford pairs
dual
linked list
had nished omputing
Q
(11) he remarked that \This was a very heavy piee of
work, and oupied most of my leisure time for several months.
: : :
It will, I imag-
ine, b e sarely possible to obtain results for larger b oards, unless a numb er of
persons o-operate in the work." [See
Pro. Edinburgh Math. So .
17
(1899), 43{
68; Sprague was the leading atuary of his day.℄ Nevertheless, H. Onnen went on
to evaluate
Q
(12) = 14
;
200 | an astonishing feat of hand alulation | in 1910.
[See W. Ahrens,
Math. Unterhaltungen und Spiele
2
, seond edition (1918), 344.℄
All of these hard-won results were onrmed in 1960 by R. J. Walker,
using the
SWAC
omputer at UCLA and the metho d of exerise 9. Walker also
omputed
Q
(13); but he ouldn't go any further with the mahine available to
him at the time. The next step,
Q
(14), was omputed by Mihael D. Kennedy at
the University of Tennessee in 1963, ommandeering an IBM 1620 for 120 hours.
S. R. Bunh evaluated
Q
(15) in 1974 at the University of Illinois, using about
two hours on an IBM System 360-75; then J. R. Bitner found
Q
(16) after ab out
three hours on the same omputer, but with an improved metho d.
Computers and algorithms have ontinued to get better, of ourse, and suh
results are now obtained almost instantly. Hene larger and larger values of
n
lie
at the frontier. The whopping value
Q
(27) = 234,907,967,154,122,528, found in
2016 by Thomas B. Preuer and Matthias R. Engelhardt, probably won't be ex-
eeded for awhile! [See
J. Signal Proessing Systems
89
(2017), to appear. This
distributed omputation oupied a dynami luster of diverse
FPGA
devies for
383 days; those devies provided a total peak of more than 7000 ustom-designed
hardware solvers to handle 2,024,110,796 indep endent subproblems.℄
Permutations and Langford pairs.
Every solution
x
1
: : : x
n
to the
n
queens
problem is a p ermutation of
f
1
; : : : ; n
g
, and many other problems are permu-
tation-based. Indeed, we've already seen Algorithm 7.2.1.2X, whih is an ele-
gant baktrak pro edure sp eially designed for speial kinds of p ermutations.
When that algorithm b egins to hoose the value of
x
l
, it makes all of the appropri-
ate elements
f
1
;
2
; : : : ; n
g n f
x
1
; : : : ; x
l
1
g
onveniently aessible in a linked list.
We an get further insight into suh data strutures by returning to the
problem of Langford pairs, whih was disussed at the very b eginning of Chap-
ter 7. That problem an be reformulated as the task of nding all p ermutations
of
f
1
;
2
; : : : ; n
g [ f
1
;
2
; : : : ;
n
g
with the prop erty that
x
j
=
k
implies
x
j
+
k
+1
=
k ;
for 1
j
2
n
and 1
k
n
. (
7
)
For example, when
n
= 4 there are two solutions, namely 234
21
3
1
4 and 413
12
4
3
2.
(As usual we nd it onvenient to write
1 for
1,
2 for
2, et.) Notie that if
x
=
x
1
x
2
: : : x
2
n
is a solution, so is its \dual"
x
R
= (
x
2
n
)
: : :
(
x
2
)(
x
1
).
Here's a Langford-inspired adaptation of Algorithm 7.2.1.2X, with the for-
mer notation mo died slightly to math Algorithms B and W: We want to main-
tain p ointers
p
0
p
1
: : : p
n
suh that, if the positive integers not already present in
x
1
: : : x
l
1
are
k
1
< k
2
<
< k
t
when we're hoosing
x
l
, we have the linked list
p
0
=
k
1
; p
k
1
=
k
2
; : : : ; p
k
t
1
=
k
t
; p
k
t
= 0
:
(
8
)
Suh a ondition turns out to b e easy to maintain.