Lights-Out on Graphs
-
Upload
sheila-eaton -
Category
Documents
-
view
79 -
download
3
description
Transcript of Lights-Out on Graphs
Lights-Out on Lights-Out on GraphsGraphsNadav AzariaNadav Azaria
What is “Lights-Out” ?What is “Lights-Out” ?
““Lights-Out” is a Lights-Out” is a hand-held hand-held electronic game by electronic game by Tiger electronics. Tiger electronics. It is played on a It is played on a 55‰‰55keypad of keypad of lightable buttons.lightable buttons.
Other versions of Other versions of the game exist. 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!
The game gave inspiration to several researches. Some of the work done, will be presented today.
From ToysRus to From ToysRus to BGUBGUFrom ToysRus to From ToysRus to BGUBGU
Lights-Out on Arbitrary Lights-Out on Arbitrary GraphsGraphsLet G=(V,E) be a given graph. Suppose that at Let G=(V,E) be a given graph. Suppose that at each vertex there is a light bulb and a switcheach vertex there is a light bulb and a switch..
Toggling the switch at a vertex, we flip the light Toggling the switch at a vertex, we flip the light at this vertex and all its neighbors at this vertex and all its neighbors those that those that were off are turned on and vice versawere 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…Did you notice that…
While solving the game:While solving the game:
1.1. There is no point pressing the same There is no point pressing the same button more than once.button more than once.
2.2. The order in which you press the buttons The order in which you press the buttons has no effect on the final configuration.has no effect on the final configuration.
Thus: A Thus: A solutionsolution may be identified with a may be identified with a subset of subset of
V.V.
QuestionQuestion
Given two configurations, decide Given two configurations, decide whether it is possible to pass from whether it is possible to pass from one to the other by some sequence one to the other by some sequence of switch toggles.of switch toggles.
AnswerAnswer
Let Let M(G)M(G) be the neighborhood matrix of be the neighborhood matrix of GG. .
If If CC is some configuration and we press is some configuration and we press some vertex some vertex v,v, the resulting configuration the resulting configuration isis
C+M(G)v,
where M(G)v is the row of M(G) corresponding to v.
(0,1,0,0)(0,1,0,0)
(0,1,1,1)(0,1,1,1)
(0,0,1,1)(0,0,1,1)
(0,0,1,1)(0,0,1,1)
(1,1,0,0)(1,1,0,0)
(1,1,1,1)(1,1,1,1)
Press
Press
Meaning….Meaning….
We can pass from We can pass from CC11 to to CC22 if and only if if and only if there exists anthere exists an
xx{0,1}V such that such that
CC11 + M(G)x= C + M(G)x= C22
Or, equivalently:Or, equivalently:
M(G)x= CM(G)x= C2 2 - C- C11
ConclusionsConclusions
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 non- singular over Z2
Which graphs have the Which graphs have the property that one property that one
can pass from any can pass from any configuration to any configuration to any
other?other?
We are interested in:
Which graphs have the Which graphs have the property that one property that one
can pass from any can pass from any configuration to any configuration to any
other?other?
We are interested in:
Oh Yes, and find algorithms for evaluating light-deficiency for specific graph types.Naturally they need to perform better then O(n2.376).
Oh Yes, and find algorithms for evaluating light-deficiency for specific graph types.Naturally they need to perform better then O(n2.376).
DefinitionsDefinitions
A A 0-combination 0-combination is a non-zero vector in Ker(M(G)).
For example, in the graph , (1,1) is a 0-
combination.
A graph is light-transitivelight-transitive if each configuration can
be reached.
v1 v2
The light-deficiencylight-deficiency (G) of G is the dimension of
the kernel of M(G).
Thus, there exist 2|V|(G) reachable configurations.
Universal ConfigurationsUniversal Configurations
A A universal configurationuniversal configuration is a non- is a non-trivial configuration which is trivial configuration which is reachable for each graph.reachable for each graph.
TheoremTheorem The all-on configuration is The all-on configuration is the only universal configuration.the only universal configuration.
ProofProof
By considering the complete graph, we By considering the complete graph, we get the “only” part of the theorem.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 PathLights Out on a Path
Lights Out on Lights Out on CirclesCirclesFor For nn(mod3)(mod3) we have we have 00--
combinations.combinations.
Example (press the following Example (press the following vertices):vertices):
1.1. 1,2,4,5,...,n-2,n-11,2,4,5,...,n-2,n-1
2.2. 2,3,5,6,...,n-1,n2,3,5,6,...,n-1,n
Meaning light-deficiency is at least 2.Meaning light-deficiency is at least 2.
RemarkRemark - - Note that if we press all the vertices Note that if we press all the vertices
we arrive at the all-on configuration.we arrive at the all-on configuration.
In case In case nn(mod3), (mod3), we press vertices: 2,5,8, we press vertices: 2,5,8,……
Now all lights are on except one. Using the Now all lights are on except one. Using the remark remark
above we get a configuration where only one above we get a configuration where only one lightlight
bulb is on - meaning we can arrive at anybulb is on - meaning we can arrive at any
configuration.configuration.
mm‰‰n Gridsn Grids
DefinitionDefinition
pp00(()=1, p)=1, p11(()=)=
ppnn(()=)=ppn-1n-1(()+p)+pn-2n-2(())
Theorem.Theorem. The Lights Out game has a unique The Lights Out game has a unique
solution iff psolution iff pmm(() and p) and pnn(() are relatively ) are relatively prime.prime.
Let:Let: AAmm
++ denote the m denote the m‰‰m tridiagonal matrix.m tridiagonal matrix. AAmm be be AAmm
++ +I. C C be an mbe an m‰‰n matrix representing a n matrix representing a
configuration.configuration.
Then Then CC has a unique solution iff the has a unique solution iff the equation equation AAmmX+XAX+XAnn
++=C=C
has a unique solution has a unique solution XX in in M(m,n,ZM(m,n,Z22).).
It is known thatIt is known that::
The equation The equation AX+XB=CAX+XB=C has a unique has a unique solution iff the characteristic solution iff the characteristic polynomials of polynomials of AA and and BB are relatively are relatively primeprime..
And for similar reasons to the ones we And for similar reasons to the ones we saw in Pathssaw in Paths
det(Adet(Amm--I)=pI)=pmm(() ) thus thus det(Adet(Amm--+I)=p+I)=pmm((+1)+1) . .
Invariant Graphs (soon)Invariant Graphs (soon)
A rooted union of two rooted graphsA rooted union of two rooted graphs
G1G1G2G2
IsIs
X root of G1 and G2
X root of G1 and G2
Invariant GraphsInvariant Graphs
An invariant graph II satisfy
(GI)=(G),
for any rooted graph G.
rooted union.
An invariant graph II satisfy
(GI)=(G),
for any rooted graph G.
rooted union.
rr
rr
Q. When does a light-transitive rooted graph is invariant? 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.
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:Example:rrrr
rrrr rrrr rrrr rrrr