Flood-filling Games on Graphs Kitty Meeks School of Mathematical - - PowerPoint PPT Presentation

flood filling games on graphs
SMART_READER_LITE
LIVE PREVIEW

Flood-filling Games on Graphs Kitty Meeks School of Mathematical - - PowerPoint PPT Presentation

Flood-filling Games on Graphs Kitty Meeks School of Mathematical Sciences Queen Mary, University of London Joint work with Alex Scott (University of Oxford) This is officially FUN The complexity of flood filling games , Arthur, Clifford,


slide-1
SLIDE 1

Flood-filling Games on Graphs

Kitty Meeks

School of Mathematical Sciences Queen Mary, University of London

Joint work with Alex Scott (University of Oxford)

slide-2
SLIDE 2

This is officially FUN

◮ The complexity of flood filling games, Arthur, Clifford,

Jalsenius, Montanaro & Sach, Fun with Algorithms 2010

◮ An algorithmic analysis of the honey-bee game, Fleischer &

Woeginger, Fun with Algorithms 2010

◮ Spanning trees and the complexity of flood filling games, M.

& Scott, Fun with Algorithms 2012

slide-3
SLIDE 3
slide-4
SLIDE 4

◮ http://floodit.appspot.com ◮ Smartphone apps: Flood-It! 2 (iPhone), Flood-It! (Android)

slide-5
SLIDE 5

◮ http://floodit.appspot.com ◮ Smartphone apps: Flood-It! 2 (iPhone), Flood-It! (Android) ◮ 2-player version: Honey-bee game

slide-6
SLIDE 6

The original Flood-It game

slide-7
SLIDE 7

The original Flood-It game

slide-8
SLIDE 8

The original Flood-It game

slide-9
SLIDE 9

The original Flood-It game

slide-10
SLIDE 10

The original Flood-It game

slide-11
SLIDE 11

The original Flood-It game

slide-12
SLIDE 12

The original Flood-It game

slide-13
SLIDE 13

The original Flood-It game

slide-14
SLIDE 14

A good strategy?

◮ Choose the colour that will add the most squares to the

flooded area?

slide-15
SLIDE 15

A good strategy?

◮ Choose the colour that will add the most squares to the

flooded area?

◮ NO!

Figure: Example due to Clifford, Jalsenius, Montanaro and Sach

slide-16
SLIDE 16

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-17
SLIDE 17

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-18
SLIDE 18

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-19
SLIDE 19

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-20
SLIDE 20

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-21
SLIDE 21

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-22
SLIDE 22

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-23
SLIDE 23

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-24
SLIDE 24

Generalising the game

  • 1. Play on arbitrary, coloured (connected) graphs
  • 2. Allow moves to change the colour of any monochromatic

component So a move (v, d) involves picking a vertex v and a colour d and giving every vertex in the same monochromatic component as v colour d.

slide-25
SLIDE 25

Problems considered

Free-Flood-It Given a coloured connected graph G, what is the minimum number of moves required to flood G (when moves can be played at any vertex)?

slide-26
SLIDE 26

Problems considered

Free-Flood-It Given a coloured connected graph G, what is the minimum number of moves required to flood G (when moves can be played at any vertex)? Fixed-Flood-It Given a coloured connected graph G and a vertex v ∈ V (G), what is the minimum number of moves that must be played at v to flood G?

slide-27
SLIDE 27

Problems considered

Free-Flood-It Given a coloured connected graph G, what is the minimum number of moves required to flood G (when moves can be played at any vertex)? Fixed-Flood-It Given a coloured connected graph G and a vertex v ∈ V (G), what is the minimum number of moves that must be played at v to flood G? c-Free-Flood-It and c-Fixed-Flood-It The same two questions, except that the initial colouring uses only colours from some fixed set of size c.

slide-28
SLIDE 28

Problems considered

Free-Flood-It Given a coloured connected graph G, what is the minimum number of moves required to flood G (when moves can be played at any vertex)? Fixed-Flood-It Given a coloured connected graph G and a vertex v ∈ V (G), what is the minimum number of moves that must be played at v to flood G? c-Free-Flood-It and c-Fixed-Flood-It The same two questions, except that the initial colouring uses only colours from some fixed set of size c.

◮ If G has n vertices, n − 1 moves are always enough (even in

the fixed case).

◮ If there are c colours, at least c − 1 moves are needed (even

in the free version).

slide-29
SLIDE 29

An easy case

◮ Cliques

Exactly c − 1 moves are required.

slide-30
SLIDE 30

An easy case

◮ Cliques

Exactly c − 1 moves are required.

slide-31
SLIDE 31

An easy case

◮ Cliques

Exactly c − 1 moves are required.

slide-32
SLIDE 32

An easy case

◮ Cliques

Exactly c − 1 moves are required.

slide-33
SLIDE 33

An easy case

◮ Cliques

Exactly c − 1 moves are required.

slide-34
SLIDE 34

Another easy(ish) case...

◮ How many moves are required for a complete bipartite graph

coloured with c colours?

slide-35
SLIDE 35

2 colours is easy

(Proved independently by M. and Scott; Clifford, Jalsenius, Montanaro and Sach; Lagoutte, Noual and Thierry.)

slide-36
SLIDE 36

2 colours is easy

(Proved independently by M. and Scott; Clifford, Jalsenius, Montanaro and Sach; Lagoutte, Noual and Thierry.)

◮ The fixed version is trivial with two colours.

slide-37
SLIDE 37

2 colours is easy

(Proved independently by M. and Scott; Clifford, Jalsenius, Montanaro and Sach; Lagoutte, Noual and Thierry.)

◮ The fixed version is trivial with two colours. ◮ In the free version, there is always an optimal strategy that

involves playing all moves at the same vertex.

◮ This means that the minimum number of moves required is

equal to the radius of the graph, which is easily computed in polynomial time.

slide-38
SLIDE 38

A very brief introduction to computational complexity

NP-complete

NP

P

slide-39
SLIDE 39

A very brief introduction to computational complexity

NP-complete

NP

P

◮ NP-complete problems are

the “hardest” in NP.

◮ A polynomial-time

algorithm for an NP-complete problem would mean P=NP.

◮ Showing a problem is

NP-complete means that it “almost certainly” cannot be solved in polynomial time.

slide-40
SLIDE 40

The original game is hard

Theorem (Arthur,Clifford,Jalsenius,Montanaro,Sach (2010))

3-Fixed-Flood-It and 3-Free-Flood-It are NP-hard on n × n boards.

slide-41
SLIDE 41

The original game is hard

Theorem (Arthur,Clifford,Jalsenius,Montanaro,Sach (2010))

3-Fixed-Flood-It and 3-Free-Flood-It are NP-hard on n × n boards.

◮ Reduction from:

Shortest Common Supersequence (SCS) Input: Strings s1, . . . , sk (of length at most w) over a binary alphabet Σ = {0, 1}, and an integer l. Question: Do s1, . . . , sk have a common supersequence of length at most l?

◮ Shown to be NP-complete by R¨

aih¨ a and Ukkonen.

slide-42
SLIDE 42

The original game is hard (fixed version)

◮ Representation of the sequence 10010 ◮ Gadget to ensure red moves alternate with black or white

moves

slide-43
SLIDE 43

The original game is hard (fixed version)

slide-44
SLIDE 44

The original game is hard (fixed version)

◮ The proof also implies that there is no constant factor

(independent of the number of colours) polynomial-time approximation algorithm.

slide-45
SLIDE 45

Rectangular boards of fixed height

1 × n 2 × n 3 × n n × n c = 2 c = 3 NP-h c = 4 NP-h c unbounded NP-h Complexity status of c-Free-Flood-It and c-Fixed-Flood-It

  • n rectangular boards.
slide-46
SLIDE 46

Rectangular boards of fixed height

1 × n 2 × n 3 × n n × n c = 2 P P P P c = 3 NP-h c = 4 NP-h c unbounded NP-h Complexity status of c-Free-Flood-It and c-Fixed-Flood-It

  • n rectangular boards.
slide-47
SLIDE 47

Rectangular boards of fixed height

1 × n 2 × n 3 × n n × n c = 2 P P P P c = 3 P NP-h c = 4 P NP-h c unbounded P NP-h Complexity status of c-Free-Flood-It and c-Fixed-Flood-It

  • n rectangular boards.
slide-48
SLIDE 48

Rectangular boards of fixed height

1 × n 2 × n 3 × n n × n c = 2 P P P P c = 3 P ? NP-h c = 4 P NP-h NP-h c unbounded P NP-h NP-h Complexity status of c-Free-Flood-It and c-Fixed-Flood-It

  • n rectangular boards.
slide-49
SLIDE 49

2xn boards

c-Fixed-Flood-It c-Free-Flood-It c fixed P (Clifford et. al., 2012) P (M.,Scott) c unbounded P (Clifford et. al., 2012) NP-h (M.,Scott)

slide-50
SLIDE 50

Hardness for other classes of graphs

◮ c-Free-Flood-It is NP-hard for trees, if c ≥ 4 (Fleischer

and Woeginger, 2012).

slide-51
SLIDE 51

Hardness for other classes of graphs

◮ c-Free-Flood-It is NP-hard for trees, if c ≥ 4 (Fleischer

and Woeginger, 2012).

◮ Free-Flood-It is NP-hard for split graphs and proper

interval graphs (Fukui, Otachi, Uehara, Uno and Uno, 2013).

slide-52
SLIDE 52

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-53
SLIDE 53

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-54
SLIDE 54

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-55
SLIDE 55

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-56
SLIDE 56

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-57
SLIDE 57

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-58
SLIDE 58

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-59
SLIDE 59

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-60
SLIDE 60

Spanning trees

Theorem

The number of moves required to flood a coloured graph G is equal to the minimum, taken over all spanning trees T of G, of the number of moves required to flood T.

slide-61
SLIDE 61

This is useless!

◮ In general, a graph has an exponential number of spanning

trees.

slide-62
SLIDE 62

This is useless!

◮ In general, a graph has an exponential number of spanning

trees.

◮ Besides, Free Flood It is still NP-hard even on trees.

slide-63
SLIDE 63

... or is it?

P = NP

slide-64
SLIDE 64

... or is it?

P = NP

slide-65
SLIDE 65

... or is it?

P = NP

slide-66
SLIDE 66

... or is it?

Source: finditinscotland.com

slide-67
SLIDE 67

... or is it?

Source: finditinscotland.com

slide-68
SLIDE 68

... or is it?

A B

The number of moves required to flood G with colour d is at most the sum of the numbers of moves required to flood A and B respectively with colour d.

slide-69
SLIDE 69

... or is it?

H

The number of moves required to flood a subgraph doesn’t increase when we play in a larger graph.

slide-70
SLIDE 70

... or is it?

H

G

The number of moves required to flood a subgraph doesn’t increase when we play in a larger graph.

slide-71
SLIDE 71

Application I: Graphs with polynomially many connected subgraphs

Theorem

Free Flood It can be solved in polynomial time on graphs that have only a polynomial number of connected subgraphs.

A

slide-72
SLIDE 72

Application I: Graphs with polynomially many connected subgraphs

Theorem

Free Flood It can be solved in polynomial time on graphs that have only a polynomial number of connected subgraphs.

A A1 A2

slide-73
SLIDE 73

Application I: Graphs with polynomially many connected subgraphs

Classes of graphs with only a polynomial number of connected subgraphs include:

◮ paths ◮ cycles

slide-74
SLIDE 74

Application I: Graphs with polynomially many connected subgraphs

Classes of graphs with only a polynomial number of connected subgraphs include:

◮ paths ◮ cycles ◮ subdivisions of any fixed graph H

slide-75
SLIDE 75

Application II: Connecting k points

Given a coloured graph G and a subset U of at most k vertices, k-Linking Flood It is the problem of determining the number

  • f moves required to create a single monochromatic component

containing U.

Theorem

k-Linking Flood It can be solved in time O(|V |k+3|E|c22k) on a graph G = (V , E) coloured with c colours.

slide-76
SLIDE 76

Application II: Connecting k points

G

The number of moves required to connect U is equal to the minimum, taken over all subtrees T of G that contain U, of the number of moves required to flood T.

slide-77
SLIDE 77

Application II: Connecting k points

G

The number of moves required to connect U is equal to the minimum, taken over all subtrees T of G that contain U, of the number of moves required to flood T.

slide-78
SLIDE 78

Summary

slide-79
SLIDE 79

Summary

◮ Flood-filling problems are FUN!

slide-80
SLIDE 80

Summary

◮ Flood-filling problems are FUN! ◮ Solving c-Free-Flood-It or c-Fixed-Flood-It, for

c > 2, is NP-hard in many situations.

slide-81
SLIDE 81

Summary

◮ Flood-filling problems are FUN! ◮ Solving c-Free-Flood-It or c-Fixed-Flood-It, for

c > 2, is NP-hard in many situations.

◮ The number of moves to flood an arbitrary graph can be

characterised in terms of the number of moves to flood its spanning trees.

◮ This gives some useful facts about the behaviour of flooding

  • perations on arbitrary graphs, and can be used to give some

polynomial-time algorithms.

slide-82
SLIDE 82

Open problems

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n 3 × n boards.
slide-83
SLIDE 83

Open problems

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n 3 × n boards.

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n trees.
slide-84
SLIDE 84

Open problems

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n 3 × n boards.

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n trees.

◮ Is k-Linking-Flood-It fixed parameter tractable, with

parameter k?

slide-85
SLIDE 85

Open problems

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n 3 × n boards.

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n trees.

◮ Is k-Linking-Flood-It fixed parameter tractable, with

parameter k?

◮ Given a graph G,

  • 1. what colouring with c colours requires the most moves?
  • 2. what proper colouring requires the fewest?
slide-86
SLIDE 86

Open problems

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n 3 × n boards.

◮ Complexity of 3-Fixed-Flood-It and 3-Free-Flood-It

  • n trees.

◮ Is k-Linking-Flood-It fixed parameter tractable, with

parameter k?

◮ Given a graph G,

  • 1. what colouring with c colours requires the most moves?
  • 2. what proper colouring requires the fewest?

◮ Does the Loch Ness Monster exist?

slide-87
SLIDE 87

Thank you

slide-88
SLIDE 88

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-89
SLIDE 89

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-90
SLIDE 90

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-91
SLIDE 91

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-92
SLIDE 92

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-93
SLIDE 93

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-94
SLIDE 94

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-95
SLIDE 95

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-96
SLIDE 96

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-97
SLIDE 97

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-98
SLIDE 98

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-99
SLIDE 99

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-100
SLIDE 100

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-101
SLIDE 101

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-102
SLIDE 102

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.

slide-103
SLIDE 103

Some easy cases

◮ Complete bipartite graphs

Either c − 1 or c moves are required.