lights out for fun and profit! parity domination: algorithmic and graph theoretic results

42
Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results William F. Klostermeyer University of North Florida

Upload: yosefu

Post on 14-Jan-2016

41 views

Category:

Documents


4 download

DESCRIPTION

Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results. William F. Klostermeyer University of North Florida. Introduction. Green Vertex Pushed. Introduction cont. Of the 2 16 initial configurations of 4 X 4 grid, 2 12 can be changed to all-off - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Lights Out for Fun and Profit!

Parity Domination:Algorithmic and Graph Theoretic

Results

William F. KlostermeyerUniversity of North Florida

Page 2: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Introduction

Page 3: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Green Vertex Pushed

Page 4: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Introduction cont.

• Of the 216 initial configurations of 4 X 4 grid, 212 can be changed to all-off

• How many can be changed to all-off in N X N grid?

Page 5: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

History

• Lights Out! (~ 1995)

• Button Madness (PC Game)

• ACM Programming Contest

• Cellular Automata (1989)

• Parity Domination (1990’s)

Page 6: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Overview

• Complete Solvability– Fibonacci Polynomials

• Maximization Problems– Complexity

– Approximation Algorithm

– Fixed Parameter Problems

Page 7: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Parity Domination

0

1

1

011

p(v) indicated for each v

Page 8: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Parity Domination cont.

• Even Dominating Set:– Non-empty set of vertices D s.t. each

vertex is adjacent to an even number of vertices of D

• Odd Dominating Set:– Defined accordingly

Page 9: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Parity Domination cont.

• Theorem (Sutner): Every graph has an odd dominating set

• Theorem (folklore): Every initial configuration of G can be turned off iff G has no even dominating set

Page 10: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Even Dominating Sets

• If G has even dominating set, D, closed neighborhood matrix is singular

• Pushing D and empty set have same effect : no change!

• Which graphs have even dominating sets?

Page 11: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Even Dominating Set cont.

0 0 0

0 1 0

1 1 1

0 0 0

Nullspace Matrix

Page 12: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Basics

• Can decide in polynomial time if G has an even dominating set

– use Gaussian elimination

• If G does not have an even dominating set we say G is completely solvable

Page 13: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Basics cont.

• If G has an even dominating set:

– Can decide in polynomial time if a given configuration can be turned off (use linear algebra methods)

Page 14: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

3 X 3 Grid

Page 15: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Linear Equations 1 1 0 1 0 0 0 0 0 x1 = 1

1 1 1 0 1 0 0 0 0 x2 = 0

0 1 1 0 0 1 0 0 0 x3 = 0

1 0 0 1 1 0 1 0 0 x4 = 0

0 1 0 1 1 1 0 1 0 x5 = 0

0 0 1 0 1 1 0 0 1 x6 = 1

0 0 0 1 0 0 1 1 0 x7 = 0

0 0 0 0 1 0 1 1 1 x8 = 1

0 0 0 0 0 1 0 1 1 x9 = 0

Page 16: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Grids

• 3 X 3 grid completely solvable

• 4 X 4 grid not completely solvable (= has even dominating set)

• Test if Closed Neighborhood Matrix is singular– O((nm)3) SLOW!

Page 17: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Nullspace Matrices

1 0 0 1 1’s = Even Dominating1 1 1 1 Set of 4 X 4 Grid1 1 1 1 1 0 0 1

“Linearize” this matrix to get a 16 X 1 vector in nullspace of closed neighborhood matrix of 4 X 4 grid

Page 18: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Building Nullspace Matrices

0 0 0 0 0 0 0 0 0

1 1 0 1 0 1 0 1 1

0 0 0 1 0 1 0 0 0

1 1 1 0 0 0 1 1 1

0 1 0 0 0 0 0 1 0

0 0 0 0 0 0 0 0 0

• Thus 4 X 9 grid is not completely solvable. • Likewise 9 X 9, 4 X 14, 9 X 14, etc.

Page 19: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Nullspace Recurrence

1 0 0 1 1’s = Even Dominating1 1 1 1 Set of 4 X 4 Grid1 1 1 1 1 0 0 1

r[I, j]=r[I-1,j]+r[I-1,j-1]+r[I-1,j+1]+r[I-2,j] mod 2

Page 20: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Recurrence cont.

Theorem: r[I]=fi(B)w

• r[I] : ith row of nullspace matrix

• fi : ith Fibonacci polynomial

• B : Closed Neighborhood Matrix

• w : initial non-zero vector

Page 21: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Fibonacci Polynomials

• Fn(x) is nth Fibonacci polynomial:

f0=0, f1=1, f i=x f i-1(x) + fi-2(x)

f2=x, f3=x2+1, f4=x3

Page 22: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Example0 0 0

1 0 0 <-- w1 1 01 0 1 = 1 1 0 1 1 0 1 0 0 ( 1 1 1 * 1 1 1 + 0 1 1) * 1 0 0 = w 0 1 1 0 1 1 0 1 1

f3=x2+1

Page 23: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Factored Fibonacci Polynomials

• Implemented (randomized)

algorithm to factor polynomials

over GF(2) in polynomial time

Page 24: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Factored cont.

• f_2: x

(x)^1

• f_3: x^2 +1

(x +1)^2

• f_4: x^3

(x)^3

Page 25: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Fibonacci Polynomials cont.

• f_5: x^4 +x^2 +1

(x^2 +x +1)^2

• f_6: x^5 +x

(x +1)^4

(x)^1

See my web page for thousands more

Page 26: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

More on the Recurrence

• Period: number of rows until row of 0’s

• Recurrence is periodic

• Theorem: Maximum period generated by initial vector <1 0 0 0 …>

• Theorem: Length of period is less than 3*2n/2

Page 27: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Periods

• n=5 24, 12, 8, 6, 4, 3, 2• n=6 9• n=7 12, 6, 3• n=8 28, 14, 7, 4, 2• n=9 30, 15, 10, 5, 3• n=10 31• n=12 63• n=13 18, 9, 3

Page 28: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

More Periods

Maximum periods:

• n=39 120

• n=40 1,048,575

• n=41 4680

• n=46 over 8 million

Page 29: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Divisibility Properties

• Theorem: All periods divide the maximum period

• Theorem: If fn+1(x) has only one non-trivial factor, then there is only one period for vectors of length n

Page 30: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Characterization

• Theorem: m x n grid is completely solvable iff

GCD(fn+1(x+1), fm+1(x))=1

over GF(2)

Page 31: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Fast Algorithm

• Can determine if m X n grid is completely solvable in O(n log2 n) time, n >= m

• Obvious method: O((nm)3) time

Page 32: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Square Grids

• Lemma: f2^k+1(x)f2^k-1(x) is equal to square of product of all irred. polynomials with degree dividing k except for x, over GF(2)

• Theorem: 2k x 2k and 2k-2 x 2k-2 grids not completely solvable for all k > 3

Page 33: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Maximization Problems

• Theorem: Can always get at least mn-m/2 off in m X n grid, n >= m

• Theorem: Exist m X n grids for which some initial configurations can get at most mn - (m/log m) off, n >= m

Page 34: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Graphs

• Play Lights Out! in graph

• Closed neighborhood matrix non-singular iff completely solvable iff no even dominating set

• Maximization problems in graphs

Page 35: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Complexity Results

• Theorem: NP-complete to decide if G can be made to have at least k lights out

• Also NP-complete for planar graphs

• Simple approximation algorithm with performance ratio 2

Page 36: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Max-SNP Hard

• Theorem: Exists e > 0 s.t. no approximation algorithm can have performance ratio less than 1+e unless P=NP

• Is there a better approximation algorithm for planar graphs?

Page 37: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Fixed Parameter Problems

• Can decide in polynomial time if a configuration can be made to have n-c off, for constant c

–Gaussian elimination + brute force

Page 38: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Fixed Parameter cont.

• Can decide in polynomial time if all configurations can be made to have n-c off, for a constant c

–Treat all-off state as codeword of binary code

–Test if covering radius of code is at most c

Page 39: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

•Large grids, 5 by 5 and larger:

Theorem. (Counting argument).

Unsolvable implies not all initial

configurations can be made to

have at most one light on.

Trees: always at most leaves/2 on.

Page 40: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Conjecture

• Let fn+1 equal square of irred. Polynomial and m be maximum period of n. Then all initial configurations of m X n grid can be made to have at most 2 vertices on.

– Verified for 8 X 6, 30 X 10, 62 X 12, 512 X 18 using Coding Theory algorithm

Page 41: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Publications

• Characterizing Switch-Setting Problems, Lin. and Mult. Alg. 1997

• Maximization Versions of Lights Out …, Cong. Num. 1998

• Fibonacci Polynomials…, Graphs and Combinatorics, to appear

Page 42: Lights Out for Fun and Profit! Parity Domination: Algorithmic and Graph Theoretic Results

Related Work

• “The Odd Domination Number of a Graph” Y. Caro and W. Klostermeyer, to appear in J. Comb. Math. & Comb. Comput.

• Study size of smallest odd dominating set in graph