• Nie Znaleziono Wyników

Introduction to Parametrized Algorithms

N/A
N/A
Protected

Academic year: 2021

Share "Introduction to Parametrized Algorithms"

Copied!
92
0
0

Pełen tekst

(1)

Introduction to Parametrized Algorithms

Marcin Pilipczuk most slides by Łukasz Kowalik

some slides by Marek Cygan and Michał Pilipczuk

Algorytmika, 18.05.2020

(2)

Overview

1 A motivating example, definition of classes FPT, XP.

2 Technique: branching

3 Technique: kernelization

(3)

The book

Everything can be found in

http://parameterized-algorithms.mimuw.edu.pl

(4)

Motivation

We would like to solve NP-hard problems efficiently.

We are not interested in approximation, heuristics, etc.

We want exact solutions, with provable guarantees.

(Unless P=NP) we cannot solve all instances fast; let us just solve the simple ones fast.

Which istances are simple?

What do we mean by fast?

(5)

Parameterized algorithms - example

There were 104 measurements performed, each of them can report wrong output with probability p ≤ 0.1%.

Create a graph G = (V , E ):

I Vertices are measurements.

I u and v adjacent if measurements u and v contradict each other.

We want to find minimum sized subset X of measurements such that measurements in V \ X are non-contradictory.

We expect |X | ≤ 10.

The number 10 can be treated as a measure of hardness of the instance.

(6)

Vertex cover

Vertex cover of a graph G = (V , E ) is a set S ⊆ V which touches all edges, i.e. for every uv ∈ E we have u ∈ S or v ∈ S.

Decision problem

Input: Graph G = (V , E ), a number k ∈ N.

Does G admit a vertex cover of size ≤ k?

(7)

Vertex cover: algorithm in time O(2

k

· (|V | + |E |))

Decision problem

Input: Graph G = (V , E ), a number k ∈ N.

Does G admit a vertex cover of size ≤ k?

Exhaustive search in time O(nk · |E |) VertexCover(G = (V , E ),k)

1: for each X ⊆ V , |X | = k do

2: ifall edges incident to X return YES

3: return NO

Not very good for k = 10.

Greedy improvements (pick vertices of maximum degree) do not help.

(8)

Vertex cover: algorithm in time O(2

k

· (|V | + |E |))

Decision problem

Input: Graph G = (V , E ), a number k ∈ N.

Does G admit a vertex cover of size ≤ k?

Exhaustive search in time O(nk · |E |) VertexCover(G = (V , E ),k)

1: for each X ⊆ V , |X | = k do

2: ifall edges incident to X return YES

3: return NO

Not very good for k = 10.

Greedy improvements (pick vertices of maximum degree) do not help.

(9)

Vertex cover: algorithm in time O(2

k

· (|V | + |E |))

Decision problem

Input: Graph G = (V , E ), a number k ∈ N.

Does G admit a vertex cover of size ≤ k?

Branching algorithm in time O(2k· (|V | + |E |)) VertexCover(G = (V , E ),k)

1: if E = ∅ return YES

2: if k = 0 return NO

3: Pick any edge uv ∈ E

4: VertexCover(G − u,k − 1) or VertexCover(G − v ,k − 1) Reasonable running time for k = 10.

(10)

Parameterized decision problems

Let Σ be a finite alphabet. Say, Σ = {0, 1}.

(Classical) decision problem

Decision problem is any subset L of words over Σ, i.e., L ⊆ Σ. Intuition: L is a set of (binary encodings of) YES-instances.

Example: VertexCover is a set of binary encodings of pairs (G , k) such that G admits a vertex cover of size k.

Parameterized decision problem

Parameterized decision problem is any subset L ⊆ Σ× N.

For an instance (x, k) ∈ Σ× N, k is called a parameter.

(11)

Parameterized decision problems: examples

Vertex cover parameterized by the solution size

L = {(e(G ), k) : G admits a vertex cover of size k}; e is an encoding

Clique parameterized by the maximum degree

L = {((G , k), ∆) : G contains a clique of size k and ∆ = ∆(G )} Independent Set parameterized by treewidth

L = {((G , k), t) :

G admits an independent set of size k and G has treewidth t} The central question of the area:

How does the complexity of a parameterized problem depend on the parameter?

(12)

Parameterized decision problems: examples

Vertex cover parameterized by the solution size L = {(G , k) : G admits a vertex cover of size k}

Clique parameterized by the maximum degree

L = {((G , k), ∆) : G contains a clique of size k and ∆ = ∆(G )} Independent Set parameterized by treewidth

L = {((G , k), t) :

G admits an independent set of size k and G has treewidth t} The central question of the area:

How does the complexity of a parameterized problem depend on the parameter?

(13)

Parameterized decision problems: examples

Vertex cover parameterized by the solution size L = {(G , k) : G admits a vertex cover of size k}

Clique parameterized by the maximum degree

L = {((G , k), ∆) : G contains a clique of size k and ∆ = ∆(G )}

Independent Set parameterized by treewidth L = {((G , k), t) :

G admits an independent set of size k and G has treewidth t} The central question of the area:

How does the complexity of a parameterized problem depend on the parameter?

(14)

Parameterized decision problems: examples

Vertex cover parameterized by the solution size L = {(G , k) : G admits a vertex cover of size k}

Clique parameterized by the maximum degree

L = {((G , k), ∆) : G contains a clique of size k and ∆ = ∆(G )}

Independent Set parameterized by treewidth L = {((G , k), t) :

G admits an independent set of size k and G has treewidth t}

The central question of the area:

How does the complexity of a parameterized problem depend on the parameter?

(15)

Parameterized decision problems: examples

Vertex cover parameterized by the solution size L = {(G , k) : G admits a vertex cover of size k}

Clique parameterized by the maximum degree

L = {((G , k), ∆) : G contains a clique of size k and ∆ = ∆(G )}

Independent Set parameterized by treewidth L = {((G , k), t) :

G admits an independent set of size k and G has treewidth t}

The central question of the area:

How does the complexity of a parameterized problem depend on the parameter?

(16)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N and a constant c such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nc

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT)

A is also called FPT algorithm. Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(17)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT)

A is also called FPT algorithm. Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(18)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Examples: time O(2kn), O(k! · n15), O(10k+ n3), O(22kn3), O(222kn5), O(222

···2

| {z }

k times

n2)

BAD examples: O(2nk), O(nk), O(nlog log k)

Problem L is then called fixed parameter tractable (FPT)

A is also called FPT algorithm. Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm} Note: P ⊆ FPT, but FPT 6⊆ NP.

(19)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT)

A is also called FPT algorithm. Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(20)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT) A is also called FPT algorithm.

Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(21)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT) A is also called FPT algorithm.

Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(22)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT) A is also called FPT algorithm.

Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(23)

Parameterized algorithm: definition

Let L be a parameterized problem.

Parameterized algorithm

Algorithm A is a parameterized algorithm for L if there is a computable function f : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · nO(1)

where n = |(x, k)| is the size of the instance.

Problem L is then called fixed parameter tractable (FPT) A is also called FPT algorithm.

Class of decision problems:

FPT = {L ⊆ Σ× N : L admits an FPT algorithm}

Note: P ⊆ FPT, but FPT 6⊆ NP.

(24)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k. Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k). BAD examples: O(2nk), O(kn)

Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm} Note: P ⊆ FPT ⊆ XP.

(25)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k). BAD examples: O(2nk), O(kn)

Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm} Note: P ⊆ FPT ⊆ XP.

(26)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k).

BAD examples: O(2nk), O(kn) Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm} Note: P ⊆ FPT ⊆ XP.

(27)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k).

BAD examples: O(2nk), O(kn)

Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm} Note: P ⊆ FPT ⊆ XP.

(28)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k).

BAD examples: O(2nk), O(kn) Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm} Note: P ⊆ FPT ⊆ XP.

(29)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k).

BAD examples: O(2nk), O(kn) Class of decision problems:

XP = {L ⊆ Σ× N : L admits an XP algorithm}

Note: P ⊆ FPT ⊆ XP.

(30)

XP algorithm: definition

Let L be a parameterized problem.

XP algorithm

Algorithm A is an XP algorithm for L if

there are two computable functions f , g : N → N such that

for every (x, k) ∈ Σ× N, algorithm A correctly decides if (x, k) ∈ L in timef (k) · ng (k)

where n = |(x, k)| is the size of the instance.

think: polynomial for every fixed k.

Examples: time O(2kn), O(222···2

| {z }

k times

n2), O(nlog log k), O(nk), O(n22k).

BAD examples: O(2nk), O(kn) Class of decision problems:

(31)

Technique: branching

(32)

Vertex Cover

Branching algorithm in time O(2k· (|V | + |E |)) VertexCover(G = (V , E ),k)

1: if E = ∅ return YES

2: if k = 0 return NO

3: Pick any edge uv ∈ E

4: VertexCover(G − u,k − 1) or VertexCover(G − v ,k − 1) Recursion tree of depth at most k.

Each node in the recursion tree has at most 2 children.

(33)

Faster Vertex Cover

Faster branching algorithm VertexCover(G = (V , E ),k)

1: ifmaximum degree ≤ 2, solve in linear time

2: if k = 0 return NO

3: Pick v of maximum degree

4: VertexCover(G − v ,k − 1) or VertexCover(G − N(v ),k − |N(v )|)

T (k) ≤ T (k − 1) + T (k − 3)

T (k) ≤ 1.4656k.

(34)

Faster Vertex Cover

Faster branching algorithm VertexCover(G = (V , E ),k)

1: ifmaximum degree ≤ 2, solve in linear time

2: if k = 0 return NO

3: Pick v of maximum degree

4: VertexCover(G − v ,k − 1) or VertexCover(G − N(v ),k − |N(v )|)

T (k) ≤ T (k − 1) + T (k − 3)

T (k) ≤ 1.4656k.

(35)

Faster Vertex Cover

Faster branching algorithm VertexCover(G = (V , E ),k)

1: ifmaximum degree ≤ 2, solve in linear time

2: if k = 0 return NO

3: Pick v of maximum degree

4: VertexCover(G − v ,k − 1) or VertexCover(G − N(v ),k − |N(v )|)

T (k) ≤ T (k − 1) + T (k − 3)

T (k) ≤ 1.4656k.

(36)

General Idea

A recursive algorithm

At every recursive call, we branch into f (k) cases Depth of the recursion is g (k).

Example:

Vertex Cover, first algorithm: f (k) = 2, g (k) = k.

(37)

FVS in tournaments

Feedback Vertex Set (FVS) in Tournaments Input: a tournament (oriented clique) T , integer k Question: is there a subset X ⊆ V (T ) of size at most k,

such that T \ X is acyclic

(38)

FVS in tournaments

Feedback Vertex Set (FVS) in Tournaments Input: a tournament (oriented clique) T , integer k Question: is there a subset X ⊆ V (T ) of size at most k,

such that T \ X is acyclic

(39)

FVS in tournaments

Lemma

If a tournament contains a cycle, then it contains a 3-cycle.

(40)

FVS in tournaments

Lemma

If a tournament contains a cycle, then it contains a 3-cycle.

(41)

FVS in tournaments

Lemma

If a tournament contains a cycle, then it contains a 3-cycle.

(42)

FVS in tournaments

Lemma

If a tournament contains a cycle, then it contains a 3-cycle.

Branching algorithm in time O(3kn3) FVS(G = (V , E ),k)

1: if k < 0 return NO

2: if G has no directed 3-cycle return YES

3: Let abc be a directed 3-cycle

4: return FVS(G − a,k − 1) or FVS(G − b,k − 1) or FVS(G − c,k − 1)

(43)

Technique: kernelization

(44)

Kernelization: FPT by preprocessing

NP-hard problem instance

k k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(45)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(46)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(47)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(48)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k)

want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(49)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k)

Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(50)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Kernelization algorithm for a parameterized problem L is any polynomial-time algorithm which, given an instance (x, k) returns an instance (x0, k0) such that:

Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’. Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k). Usually, we are interested in polynomial kernels (of size kO(1)).

(51)

Kernelization: FPT by preprocessing

NP-hard problem instance k

k

NP-hard problem instance

poly time

size ≤ f (k) want: f (k) = poly(k) Instead of saying ‘L has a kernelization algorithm which returns an instance of size f (k)’ we say shortly ‘L has a kernel of size f (k)’.

Kernel of size f (k) for a problem in NP implies FPT algorithm in time O(exp(poly(f (k))))

One can show that an FPT algorithm implies a kernel of size f (k).

Usually, we are interested in polynomial kernels (of size kO(1)).

(52)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(53)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

Why correct?

(G , k) ∈ VertexCover ⇔ (G − v , k − 1) ∈ VertexCover

(⇐) Let X0 be a vertex cover in G − v .

Then X0∪ {v } is a vertex cover of size k in G . (⇒) Let X be a vertex cover in G , |X | ≤ k.

ThenX contains v (why?).

So X \ {v } is a vertex cover of size ≤ k − 1 in G − v .

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(54)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(55)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v . Why correct?

(G , k) ∈ VertexCover ⇔ (G − v , k) ∈ VertexCover

(⇐) Let X0 be a vertex cover of size k in G − v . Then X0 is a vertex cover of size k in G .

(⇒) Let X be a minimum vertex cover in G , |X | ≤ k.

Thenv 6∈ X (why?).

So X is a vertex cover of size ≤ k in G − v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(56)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(57)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO. Why correct?

If YES, i.e., exists a vertex cover X , |X | ≤ k then

|E | ≤X

x ∈X

deg(x ) ≤ X

x ∈X

k ≤ k2.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(58)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |). Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(59)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |).

Theorem

Vertex Cover admits a kernel with at most k2 edges. Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(60)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |).

Theorem

Vertex Cover admits a kernel with at most k2 edges.

Theorem

Vertex Cover admits a kernel with at most 2k2 vertices. Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(61)

A simple kernel for vertex cover

Kernelization algorithm:

1 While there is v ∈ V with deg(v ) > k, remove v and decrease k by 1.

2 While there is v ∈ V with deg(v ) = 0, remove v .

3 If now |E | > k2 return NO.

4 return (G , k).

Running time O(|E | + |V |).

Theorem

Vertex Cover admits a kernel with at most k2 edges.

Theorem

Vertex Cover admits a kernel with at most 2k2 vertices.

Proof:

|V | ≤2 X

v ∈V

deg(v ) = 2|E | ≤ 2k2

(62)

FPT algorithms from the kernel

Theorem

Vertex Cover admits a kernel with at most 2k2 vertices, and it can be computed in time O(|E | + |V |).

Exhaustive search: 2kk2 = kO(k).

Whole FPT algorithm: O(|E | + |V | + kO(k))

Branching: 2k · k2. Whole FPT algorithm: O(|E | + |V | + 2k· k2).

Compare with O(2k· (|V | + |E |))

(63)

Kernel of size 2k vertices for VertexCover

Consider the standard integer linear program for finding minimum vertex cover.

min P

v ∈V xv

xu+ xv ≥ 1 for each uv ∈ E xv ≥ 0 for each v ∈ V . xv ∈ Z for each v ∈ V .

... and its relaxation (a linear program):

min P

v ∈V xv

xu+ xv ≥ 1 for each uv ∈ E xv ≥ 0 for each v ∈ V .

Theorem (Khachiyan 1979)

Linear programming admits a polynomial time algorithm.

(64)

Kernel of size 2k vertices for VertexCover

Consider the standard integer linear program for finding minimum vertex cover.

min P

v ∈V xv

xu+ xv ≥ 1 for each uv ∈ E xv ≥ 0 for each v ∈ V . xv ∈ Z for each v ∈ V . ... and its relaxation (a linear program):

min P

v ∈V xv

xu+ xv ≥ 1 for each uv ∈ E xv ≥ 0 for each v ∈ V .

Theorem (Khachiyan 1979)

(65)

Vertex Cover LP

cost: n − 1

cost: n/2

Vertex Cover LP

min X

v ∈V (G )

xv

s.t. xu+ xv ≥ 1 ∀uv ∈E (G )

xv ≥ 0 ∀v ∈V (G )

(66)

Vertex Cover LP

cost: n − 1

cost: n/2

Vertex Cover LP

min X

v ∈V (G )

xv

s.t. xu+ xv ≥ 1 ∀uv ∈E (G )

xv ≥ 0 ∀v ∈V (G )

(67)

Vertex Cover LP

cost: n − 1

cost: n/2

Vertex Cover LP

min X

v ∈V (G )

xv

s.t. xu+ xv ≥ 1 ∀uv ∈E (G )

xv ≥ 0 ∀v ∈V (G )

(68)

Vertex Cover LP: vertex classes

xv = 0 ⇐⇒ v ∈ V0

0 < xv < 12 ⇐⇒ v ∈ Vε

xv =12 ⇐⇒ v ∈ V1

2

1

2< xv < 1 ⇐⇒ v ∈ V1−ε

xv = 1 ⇐⇒ v ∈ V1

V<1

2 = V0∪ Vε

V>1

2 = V1∪ V1−ε

(69)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(70)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(71)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(72)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(73)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(74)

Vertex Cover LP: analysis

−ε

1 V<1

2

independent, E (V<1 2, V1

2) = ∅,

⇒ ∀v ∈V

< 12

N(v ) ⊆ V>1

2.

2 |V<1 2

| ≥ |V>1 2

|, otherwise +ε on V<1

2, −ε on V>1

2.

3X ⊆V

> 12

|X | ≤ |N(X ) ∩ V<1 2

|, otherwise +ε on N(X ) ∩ V<1

2, −ε on X .

4 Hall’s theorem

⇒ matching saturating V>1 2.

5 Greedily take V>1 2

and discard V<1 2

.

(75)

Vertex Cover LP: analysis

−ε

−ε

1 E (V0, V1−ε) = ∅,

⇒ N(V1−ε) ∩ V<1

2

⊆ Vε.

2 if |V1−ε| ≤ |Vε|, then

we can +ε on V1−ε, −ε on Vε.

3 if |V1−ε| ≥ |Vε|, then

we can +ε on Vε, −ε on V1−ε.

4 conclusion: there exists LP optimum with V = V0∪ V1

2 ∪ V1.

(76)

Vertex Cover LP: analysis

−ε

−ε

1 E (V0, V1−ε) = ∅,

⇒ N(V1−ε) ∩ V<1

2

⊆ Vε.

2 if |V1−ε| ≤ |Vε|, then

we can +ε on V1−ε, −ε on Vε.

3 if |V1−ε| ≥ |Vε|, then

we can +ε on Vε, −ε on V1−ε.

4 conclusion: there exists LP optimum with V = V0∪ V1

2 ∪ V1.

(77)

Vertex Cover LP: analysis

−ε

−ε

1 E (V0, V1−ε) = ∅,

⇒ N(V1−ε) ∩ V<1

2

⊆ Vε.

2 if |V1−ε| ≤ |Vε|, then

we can +ε on V1−ε, −ε on Vε.

3 if |V1−ε| ≥ |Vε|, then

we can +ε on Vε, −ε on V1−ε.

4 conclusion: there exists LP optimum with V = V0∪ V1

2 ∪ V1.

(78)

Vertex Cover LP: analysis

−ε

−ε

1 E (V0, V1−ε) = ∅,

⇒ N(V1−ε) ∩ V<1

2

⊆ Vε.

2 if |V1−ε| ≤ |Vε|, then

we can +ε on V1−ε, −ε on Vε.

3 if |V1−ε| ≥ |Vε|, then

we can +ε on Vε, −ε on V1−ε.

4 conclusion: there exists LP optimum with V = V0∪ V1

2 ∪ V1.

(79)

Vertex Cover LP: analysis

−ε

−ε

1 E (V0, V1−ε) = ∅,

⇒ N(V1−ε) ∩ V<1

2

⊆ Vε.

2 if |V1−ε| ≤ |Vε|, then

we can +ε on V1−ε, −ε on Vε.

3 if |V1−ε| ≥ |Vε|, then

we can +ε on Vε, −ε on V1−ε.

4 conclusion: there exists LP optimum with V = V0∪ V1

2 ∪ V1.

(80)

Vertex Cover LP: summary of analysis

1 There exists LP optimum with V = V0∪ V1

2 ∪ V1.

I Half-integrality

2 If V1

2 6= V , then we can reduce something.

I Take V1 into solution, and discard V0.

unique LP optimum

(81)

Vertex Cover LP: summary of analysis

1 There exists LP optimum with V = V0∪ V1

2 ∪ V1.

I Half-integrality

2 If V1

2 6= V , then we can reduce something.

I Take V1 into solution, and discard V0.

unique LP optimum

(82)

Kernel of size 2k vertices for VertexCover

Theorem (Nemhauser, Trotter 1974) Let {xv}v ∈V be any optimal solution of the vertex cover LP. Partition V :

V0 = {v ∈ V (G ) : xv < 12}, V1/2= {v ∈ V (G ) : xv = 12}, V1 = {v ∈ V (G ) : xv > 12}.

Then there is a minimum vertex cover S of G such that V1 ⊆ S, V0∩ S = ∅.

Vertex Cover LP:

min P

v ∈Vxv

∀ uv ∈ E xu+ xv ≥ 1

∀ v ∈ V xv ≥ 0.

(G , k) ∈ VertexCover ⇔ (G [V1/2], k − |V1|) ∈ VertexCover (⇒) SinceV1 ⊆ S and|S| ≤ k we have |S \ X1|=|S| − |V1|≤k − |V1|.

Also, S \ V1 is a vertex cover in G [V1/2]. (check it!)

0

Kernelization algorithm:

1 Solve the vertex cover LP and get an optimal solution {xv}v ∈V.

2 If |V1/2| > 2k return NO.

3 return (G [V1/2], k − |V1|). Theorem

Vertex cover admits a kernel of vertex size at most 2k.

(83)

Kernel of size 2k vertices for VertexCover

Theorem (Nemhauser, Trotter 1974) Let {xv}v ∈V be any optimal solution of the vertex cover LP. Partition V :

V0 = {v ∈ V (G ) : xv < 12}, V1/2= {v ∈ V (G ) : xv = 12}, V1 = {v ∈ V (G ) : xv > 12}.

Then there is a minimum vertex cover S of G such that V1 ⊆ S, V0∩ S = ∅.

Vertex Cover LP:

min P

v ∈Vxv

∀ uv ∈ E xu+ xv ≥ 1

∀ v ∈ V xv ≥ 0.

Kernelization algorithm:

1 Solve the vertex cover LP and get an optimal solution {xv}v ∈V.

2 If |V1/2| > 2k return NO.

3 return (G [V1/2], k − |V1|). Theorem

Vertex cover admits a kernel of vertex size at most 2k.

(84)

Kernel of size 2k vertices for VertexCover

Theorem (Nemhauser, Trotter 1974) Let {xv}v ∈V be any optimal solution of the vertex cover LP. Partition V :

V0 = {v ∈ V (G ) : xv < 12}, V1/2= {v ∈ V (G ) : xv = 12}, V1 = {v ∈ V (G ) : xv > 12}.

Then there is a minimum vertex cover S of G such that V1 ⊆ S, V0∩ S = ∅.

Vertex Cover LP:

min P

v ∈Vxv

∀ uv ∈ E xu+ xv ≥ 1

∀ v ∈ V xv ≥ 0.

Kernelization algorithm:

1 Solve the vertex cover LP and get an optimal solution {xv}v ∈V.

2 If |V1/2| > 2k return NO. Why correct?

Then,P

xv > k, so the integral solution has also value > k.

3 return (G [V1/2], k − |V1|). Theorem

Vertex cover admits a kernel of vertex size at most 2k.

(85)

Kernel of size 2k vertices for VertexCover

Theorem (Nemhauser, Trotter 1974) Let {xv}v ∈V be any optimal solution of the vertex cover LP. Partition V :

V0 = {v ∈ V (G ) : xv < 12}, V1/2= {v ∈ V (G ) : xv = 12}, V1 = {v ∈ V (G ) : xv > 12}.

Then there is a minimum vertex cover S of G such that V1 ⊆ S, V0∩ S = ∅.

Vertex Cover LP:

min P

v ∈Vxv

∀ uv ∈ E xu+ xv ≥ 1

∀ v ∈ V xv ≥ 0.

Kernelization algorithm:

1 Solve the vertex cover LP and get an optimal solution {xv}v ∈V.

2 If |V1/2| > 2k return NO.

3 return (G [V1/2], k − |V1|).

Theorem

Vertex cover admits a kernel of vertex size at most 2k.

(86)

Kernel of size 2k vertices for VertexCover

Theorem (Nemhauser, Trotter 1974) Let {xv}v ∈V be any optimal solution of the vertex cover LP. Partition V :

V0 = {v ∈ V (G ) : xv < 12}, V1/2= {v ∈ V (G ) : xv = 12}, V1 = {v ∈ V (G ) : xv > 12}.

Then there is a minimum vertex cover S of G such that V1 ⊆ S, V0∩ S = ∅.

Vertex Cover LP:

min P

v ∈Vxv

∀ uv ∈ E xu+ xv ≥ 1

∀ v ∈ V xv ≥ 0.

Kernelization algorithm:

1 Solve the vertex cover LP and get an optimal solution {xv}v ∈V.

2 If |V1/2| > 2k return NO.

3 return (G [V1/2], k − |V1|).

(87)

Vertex Cover LP branching

Assumption: V1

2 = V is the unique LP optimum.

Pick any vertex v .

Branch 1:

Take v into solution. Force xv = 1 in the LP. LP value goes up by 12. (k − LP) goes down by 12.

Branch 2:

Forbid v to be in the solution. Force xv = 0 in the LP.

LP value goes up by at least 12. (k − LP) goes down by at least 12.

Theorem

Vertex Cover can be solved in 4k−LP · (|V | + |E |)O(1) time.

(88)

Vertex Cover LP branching

Assumption: V1

2 = V is the unique LP optimum.

Pick any vertex v . Branch 1:

Take v into solution.

Force xv = 1 in the LP.

LP value goes up by 12. (k − LP) goes down by 12.

Branch 2:

Forbid v to be in the solution. Force xv = 0 in the LP.

LP value goes up by at least 12. (k − LP) goes down by at least 12.

Theorem

Vertex Cover can be solved in 4k−LP · (|V | + |E |)O(1) time.

(89)

Vertex Cover LP branching

Assumption: V1

2 = V is the unique LP optimum.

Pick any vertex v . Branch 1:

Take v into solution.

Force xv = 1 in the LP.

LP value goes up by 12. (k − LP) goes down by 12.

Branch 2:

Forbid v to be in the solution.

Force xv = 0 in the LP.

LP value goes up by at least 12. (k − LP) goes down by at least 12.

Theorem

Vertex Cover can be solved in 4k−LP · (|V | + |E |)O(1) time.

(90)

Vertex Cover LP branching

Assumption: V1

2 = V is the unique LP optimum.

Pick any vertex v . Branch 1:

Take v into solution.

Force xv = 1 in the LP.

LP value goes up by 12. (k − LP) goes down by 12.

Branch 2:

Forbid v to be in the solution.

Force xv = 0 in the LP.

LP value goes up by at least 12. (k − LP) goes down by at least 12.

Theorem

k−LP O(1)

(91)

A few examples of kernels

The problems below ask for a set vertices of size k and k is the parameter.

Size of the kernel = number of vertices.

VertexCover: 2k

Feedback Vertex Set: O(k2) Odd Cycle Transversal: kO(1) For planar graphs:

Dominating Set 67k,

Feedback Vertex Set 13k, Induced Matching 28k,

Connected Vertex Cover 113k,

(92)

Thanks and credits

Thanks!

Credits:

Slides mostly compiled from previous lectures of:

I Łukasz Kowalik

I Marek Cygan

I Michał Pilipczuk

Some nice figures by Felix Reidl.

Tikz faces based on a code by Raoul Kessels,

http://www.texample.net/tikz/examples/emoticons/, under Creative Commons Attribution 2.5 license (CC BY 2.5)

Cytaty

Powiązane dokumenty

It is a simple consequence of [1, Lemma 1] that each two-dimensional real symmetric space with a polygonal unit ball having 8n extreme points is linearly isometric to V [a,b] for

But in a topological group, the closure of any set is the intersection of products of that set with each member of the entire family of neighborhoods of its identity

Thus, when determining whether a given partition Π of vertices of a graph G is a resolving partition for G, we need only verify that the vertices of G belonging to same element in

Hedetniemi, Defending the Roman Empire, principal talk presented at the Ninth Quadrennial International Conference on Graph Theory, Combina- torics, Algorithms, and

In the second section we give a characterization for convex universal fixers (Theorem 6) and finally, we give an in infinite family of convex universal fixers for an arbitrary

An injective map from the vertex set of a graph G—its order may not be finite—to the set of all natural numbers is called an arithmetic (a geometric) labeling of G if the map from

The minimum total cover problem was first shown to be NP-hard in general graphs by Majumdar [10], where he also gives a linear-time algorithm for trees.. Hedetniemi

The main aim of this paper is to give an elementary and self-contained proof of the following classical result.. Theorem (Weitzenb¨