33
Lights-Out on Lights-Out on Graphs Graphs Nadav Azaria Nadav Azaria

Lights-Out on Graphs

Embed Size (px)

DESCRIPTION

Lights-Out on Graphs. Nadav Azaria. What is “ Lights-Out ” ?. “ Lights-Out ” is a hand-held 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: - PowerPoint PPT Presentation

Citation preview

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!

Lets PlayLets Play!!Lets PlayLets Play!!

The game gave inspiration to several researches.

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.

Back to the previews Back to the previews exampleexample

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.

Invariant Graphs (soon)Invariant Graphs (soon)

A rooted union of two rooted graphs:A rooted union of two rooted graphs:

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.

ExampleExample : :

Actually, any light-transitive cycle with an arbitrary Actually, any light-transitive cycle with an arbitrary vertex as the root is invariantvertex as the root is invariant..

Actually, any light-transitive cycle with an arbitrary Actually, any light-transitive cycle with an arbitraryvertex as the root is invariantvertex as the root is invariant..

rrrr

rrrr

SS11SS11 SS22SS22 rrrrrrrr

SS33SS33

MeaningMeaning……MeaningMeaning……

GGGG

GG’’GG’’

The number of unreachable configuration in G The number of unreachable configuration in G stays the samestays the same. .

The number of unreachable configuration in G The number of unreachable configuration in Gstays the samestays the same. .

Introducing SIntroducing S5…5…

rrrr

A 0-A 0-combinationcombination

A 0-A 0-combinationcombination

Now, what do I know Now, what do I know about G’?about G’?

GG’’GG’’

The same 0-The same 0-combinationcombination

The same 0-The same 0-combinationcombination

Thus, G’ is not light-transitiveThus, G’ is not light-transitive!!Thus, G’ is not light-transitiveThus, G’ is not light-transitive!!

Introducing SIntroducing S44

rrrr

Proposition:Proposition: Let Let G = (V, E, r)G = (V, E, r) be any rooted be any rooted graph. Then graph. Then 1)()( 45 SGSG rrrr rrrr

GGGG

The number of The number of 00-combination now is exactly -combination now is exactly halfhalf

The number of The number of 00-combination now is exactly -combination now is exactly halfhalf

The Tree’s TheoremThe Tree’s Theorem

Any tree Any tree TT with at least three vertices a with at least three vertices a rooted union of some rooted tree rooted union of some rooted tree T’T’ and and one of the four rooted trees one of the four rooted trees SS11,, SS22,, SS33,, SS55..

SS11SS11

SS55SS55

SS33SS33SS22SS22

The AlgorithmThe Algorithm

The Goal:The Goal: Given a tree, evaluate its light-deficiency.Given a tree, evaluate its light-deficiency.

The Means:The Means: Assign a status to each vertex. The status Assign a status to each vertex. The status

of a vertex determined by the status of its of a vertex determined by the status of its sons. A status is pair consist of an integer sons. A status is pair consist of an integer and one of the following:and one of the following: NullNull LeafLeaf FatherFather

StatusStatus??

(( ,Null ,Null00))

((Null, Null, 00))

(( ,Leaf ,Leaf00))

((Leaf, Leaf, 00))

(( ,Father ,Father11))

((Father, Father, 11))

Add 1 to the final resultAdd 1 to the final resultAdd 1 to the final resultAdd 1 to the final result

What is What is my statusmy status??

What is What ismy statusmy status??

The leavesThe leaves… … The leavesThe leaves… …

1111 2222 0000

RemembeRememberr: :

RemembeRememberr: :

3333

3333 0000 1111

The fathersThe fathers……The fathersThe fathers……

9999

The nullsThe nulls……The nullsThe nulls……

00000000

Ha,ha Ha,ha My My

status status is is

(Null, (Null, 9)9)

Ha,ha Ha,ha My My

status status is is

(Null, (Null, 9)9)

See it in actionSee it in action……

(( ,Null ,Null00))

((Null, Null, 00))

(( ,Leaf ,Leaf00))

((Leaf, Leaf, 00))

(( ,Father ,Father11))

((Father, Father, 11))

((Leaf, 0Leaf, 0 ) )((Leaf, 0Leaf, 0 ) ) ((Leaf, 0Leaf, 0 ) )((Leaf, 0Leaf, 0 ) )

(( ,Leaf ,Leaf00))

((Leaf, Leaf, 00))

(( ,Father ,Father00))

((Father, Father, 00))

((Leaf, 0Leaf, 0 ) )((Leaf, 0Leaf, 0 ) ) ((Leaf, 0Leaf, 0 ) )((Leaf, 0Leaf, 0 ) )

((Father, 0Father, 0 ) )((Father, 0Father, 0))((Father, 0Father, 0 ) )

((Father, 0Father, 0))

(Null,1(Null,1))

(Null,1(Null,1))

(( ,Father ,Father00))

((Father, Father, 00))

((Null, 2Null, 2)) ((Null, 2Null, 2))