Lights-Out on Graphs

Lights-Out on Graphs
Nadav Azaria
What is “Lights-Out” ?


“Lights-Out” is a handheld electronic game by
Tiger electronics. It is
played on a 55
keypad of lightable
buttons.
Other versions of the
game exist.
On Start:
 Some random buttons are lit.
Object:
 To turn all the lights out on the keypad.
The difficulty is that each time you press a
lit or an unlit button, it not only changes
that button, but also all adjacent buttons!
From ToysRus to BGU
The game gave inspiration to several
researches. Some of the work done, will be
presented today.
Lights-Out on Arbitrary Graphs
Let G=(V,E) be a given graph. Suppose that at each vertex
there is a light bulb and a switch.
Toggling the switch at a vertex, we flip the light at this
vertex and all its neighbors - those that were off are
turned on and vice versa.
A configuration of the system is a point of
{0,1}V, where a 0 coordinate indicates that the
light at the corresponding vertex is off, while a
1 means that it is on.
Did you notice that…
While solving the game:
1. There is no point pressing the same button
more than once.
2. The order in which you press the buttons has
no effect on the final configuration.
Thus: A solution may be identified with a subset of
V.
Question

Given two configurations, decide whether it is
possible to pass from one to the other by some
sequence of switch toggles.
Answer


Let M(G) be the neighborhood matrix of G.
If C is some configuration and we press some vertex v,
the resulting configuration is
C+M(G)v,
where M(G)v is the row of M(G) corresponding to v.
(0,1,0,0)
(0,1,1,1)
(0,0,1,1)
Press
Press
(0,0,1,1)
(1,1,0,0)
(1,1,1,1)
Meaning….
We can pass from C1 to C2 if and only if there exists an
x{0,1}V such that
C1 + M(G)x= C2
Or, equivalently:
M(G)x= C2 - C1
Conclusions
We can now always assume starting with the all-off
configuration and only ask which configurations can
be reached.
All configurations can be reached
M(G) is nonsingular over Z2
We are interested in:
Which graphs have the property that one
can pass from any configuration to any
other?
Oh Yes, and find algorithms for evaluating lightdeficiency for specific graph types.
Naturally they need to perform better then
O(n2.376).
Definitions
A 0-combination is a non-zero vector in Ker(M(G)).
For example, in the graph
combination.
v1
v2
, (1,1) is a 0-
A graph is light-transitive if each configuration can
be reached.
The light-deficiency d(G) of G is the dimension of
the kernel of M(G).
Thus, there exist 2|V|-
d(G)
reachable configurations.
Universal Configurations

A universal configuration is a non-trivial
configuration which is reachable for each graph.

Theorem The all-on configuration is the only universal
configuration.
Proof
By considering the complete graph, we get the
“only” part of the theorem.
We use induction on the number of vertices for
the other direction.
n=1
Now Let V={v1,v2,…,vn}. By the induction
hypothesis we get:
For each vertex vi there exist a set SviV\{vi} such
that after pressing all switches in Svi, all vertices in
V\{vi} are on .
If n is even:
For each vertex v, press all vertices in Sv. Now,
every vertex changes its state n-1 times meaning
it is on.
If n is odd:
Let v be a vertex with an even degree. Let C be
the set of all neighbors of v and v itself. For any
u in V\C, press all vertices in Su.
Now, every vertex except the ones in C is on.
Now by pressing on v we arrive to the all-on
configuration.
Lights Out on a Path
Lights Out on Circles
For n0(mod3) we have 0-combinations.
Example (press the following vertices):
1.
2.
1,2,4,5,...,n-2,n-1
2,3,5,6,...,n-1,n
Meaning light-deficiency is at least 2.
Remark - Note that if we press all the vertices
we arrive at the all-on configuration.
In case n1,2(mod3), we press vertices:
2,5,8,…
Now all lights are on except one. Using the remark
above we get a configuration where only one light
bulb is on - meaning we can arrive at any
configuration.
mn Grids
Definition
p0(g)=1, p1(g)=g,
pn(g)=gpn-1(g)+pn-2(g)
Theorem. The Lights Out game has a unique
solution iff pm(g) and pn(g+1) are relatively prime.
Let:
 Am+ denote the mm tridiagonal matrix.
 Am be Am+ +I.
 C be an mn matrix representing a
configuration.
Then C has a unique solution iff the equation
AmX+XAn+=C
has a unique solution X in M(m,n,Z2).
It is known that:
The equation AX+XB=C has a unique solution
iff the characteristic polynomials of A and B are
relatively prime.
And for similar reasons to the ones we saw in
Paths
det(Am-gI)=pm(g) thus det(Am-g+I)=pm(g+1).
Invariant Graphs (soon)
A rooted union of two rooted graphs
G1
G2
Is
X root of G1 and
Invariant Graphs
An invariant graph I satisfy
r
d(G
I)=d(G),
for any rooted graph G.
r 
rooted union.
Q. When does a light-transitive rooted graph
is invariant?
A. A light-transitive rooted graph is invariant 
The configuration which all lights if off except
for the root, must be lit using the root itself.
Example:
r
r
r
r
r