· motivation many fundamental problems are np-complete, yet they are too impor-tant to be...
TRANSCRIPT
![Page 1: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/1.jpg)
IV. Approximation Algorithms: CoveringProblemsThomas Sauerwald
Easter 2018
![Page 2: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/2.jpg)
Outline
Introduction
Vertex Cover
The Set-Covering Problem
IV. Covering Problems Introduction 2
![Page 3: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/3.jpg)
Motivation
Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned.
Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,. . .
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
We will call these approximation algorithms.
IV. Covering Problems Introduction 3
![Page 4: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/4.jpg)
Motivation
Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned.
Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,. . .
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
We will call these approximation algorithms.
IV. Covering Problems Introduction 3
![Page 5: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/5.jpg)
Motivation
Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned.
Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,. . .
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
We will call these approximation algorithms.
IV. Covering Problems Introduction 3
![Page 6: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/6.jpg)
Motivation
Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned.
Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,. . .
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
We will call these approximation algorithms.
IV. Covering Problems Introduction 3
![Page 7: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/7.jpg)
Motivation
Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned.
Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,. . .
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
We will call these approximation algorithms.
IV. Covering Problems Introduction 3
![Page 8: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/8.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 9: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/9.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 10: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/10.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 11: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/11.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 12: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/12.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 13: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/13.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 14: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/14.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 15: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/15.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 16: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/16.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 17: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/17.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 18: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/18.jpg)
Performance Ratios for Approximation Algorithms
An algorithm for a problem has approximation ratio ρ(n), if for any inputof size n, the cost C of the returned solution and optimal cost C∗ satisfy:
max(
CC∗
,C∗
C
)≤ ρ(n).
Approximation Ratio
This covers both maximization and minimization problems.
Maximization problem: C∗
C ≥ 1
Minimization problem: CC∗ ≥ 1
For many problems: tradeoff between runtime and approximation ratio.
An approximation scheme is an approximation algorithm, which givenany input and ε > 0, is a (1 + ε)-approximation algorithm.
It is a polynomial-time approximation scheme (PTAS) if for any fixedε > 0, the runtime is polynomial in n.
It is a fully polynomial-time approximation scheme (FPTAS) if theruntime is polynomial in both 1/ε and n.
Approximation Schemes
For example, O(n2/ε).
For example, O((1/ε)2 · n3).
IV. Covering Problems Introduction 4
![Page 19: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/19.jpg)
Outline
Introduction
Vertex Cover
The Set-Covering Problem
IV. Covering Problems Vertex Cover 5
![Page 20: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/20.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 21: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/21.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 22: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/22.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 23: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/23.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 24: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/24.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 25: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/25.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 26: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/26.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 27: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/27.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 28: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/28.jpg)
The Vertex-Cover Problem
Given: Undirected graph G = (V ,E)
Goal: Find a minimum-cardinality subset V ′ ⊆ Vsuch that if (u, v) ∈ E(G), then u ∈ V ′ or v ∈ V ′.
Vertex Cover Problem
We are covering edges by picking vertices!
This is an NP-hard problem.
a
b
c
d
e
c
e
b
a
d
Applications:
Every edge forms a task, and every vertex represents a person/machinewhich can execute that task
Perform all tasks with the minimal amount of resources
Extensions: weighted vertices or hypergraphs ( Set-Covering Problem)
IV. Covering Problems Vertex Cover 6
![Page 29: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/29.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 30: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/30.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 31: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/31.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 32: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/32.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 33: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/33.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 34: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/34.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 35: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/35.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 36: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/36.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 37: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/37.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.
The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 38: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/38.jpg)
An Approximation Algorithm based on Greedy
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
a
b c d
e f g
b c
e f
d
g
b d
e
Edges removed from E ′:1. {b, c}2. {e, f}3. {d , g}
APPROX-VERTEX-COVER produces a set of size 6.
The optimal solution has size 3.
IV. Covering Problems Vertex Cover 7
![Page 39: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/39.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:
Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 40: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/40.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:
Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 41: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/41.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:
Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 42: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/42.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)
Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 43: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/43.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4
Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 44: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/44.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,
and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 45: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/45.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint:
|C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 46: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/46.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 47: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/47.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|:
|C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 48: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/48.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|: |C| = 2|A|
≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 49: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/49.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|: |C| = 2|A| ≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 50: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/50.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|: |C| = 2|A| ≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 51: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/51.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|: |C| = 2|A| ≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 52: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/52.jpg)
Analysis of Greedy for Vertex Cover
35.1 The vertex-cover problem 1109
b c d
a e f g(a)
b c d
a e f g(b)
b c d
a e f g(c)
b c d
a e f g(d)
b c d
a e f g(e)
b c d
a e f g(f)
Figure 35.1 The operation of APPROX-VERTEX-COVER. (a) The input graph G, which has 7vertices and 8 edges. (b) The edge .b; c/, shown heavy, is the first edge chosen by APPROX-VERTEX-COVER. Vertices b and c, shown lightly shaded, are added to the set C containing the vertex coverbeing created. Edges .a; b/, .c; e/, and .c; d/, shown dashed, are removed since they are now coveredby some vertex in C . (c) Edge .e; f / is chosen; vertices e and f are added to C . (d) Edge .d; g/is chosen; vertices d and g are added to C . (e) The set C , which is the vertex cover produced byAPPROX-VERTEX-COVER, contains the six vertices b; c; d; e; f; g. (f) The optimal vertex cover forthis problem contains only three vertices: b, d , and e.
APPROX-VERTEX-COVER.G/
1 C D ;2 E 0 D G:E3 while E 0 ¤ ;4 let .u; !/ be an arbitrary edge of E 0
5 C D C [ fu; !g6 remove from E 0 every edge incident on either u or !7 return C
Figure 35.1 illustrates how APPROX-VERTEX-COVER operates on an examplegraph. The variable C contains the vertex cover being constructed. Line 1 ini-tializes C to the empty set. Line 2 sets E 0 to be a copy of the edge set G:E ofthe graph. The loop of lines 3–6 repeatedly picks an edge .u; !/ from E 0, adds its
APPROX-VERTEX-COVER is a poly-time 2-approximation algorithm.Theorem 35.1
Proof:Running time is O(V + E) (using adjacency lists to represent E ′)Let A ⊆ E denote the set of edges picked in line 4Every optimal cover C∗ must include at least one endpoint of edges in A,and edges in A do not share a common endpoint: |C∗| ≥ |A|
Every edge in A contributes 2 vertices to |C|: |C| = 2|A| ≤ 2|C∗|.
We can bound the size of the returned solutionwithout knowing the (size of an) optimal solution!
A "vertex-based" Greedy that adds one vertex at each iter-ation fails to achieve an approximation ratio of 2 (Exercise)!
IV. Covering Problems Vertex Cover 8
![Page 53: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/53.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 54: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/54.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 55: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/55.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 56: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/56.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 57: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/57.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 58: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/58.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 59: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/59.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 60: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/60.jpg)
Solving Special Cases
1. If inputs are small, an algorithm with exponential running time maybe satisfactory.
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
IV. Covering Problems Vertex Cover 9
![Page 61: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/61.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 62: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/62.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 63: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/63.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 64: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/64.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 65: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/65.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 66: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/66.jpg)
Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
Exchange-Argument: Replace any leaf in the cover by its parent.
IV. Covering Problems Vertex Cover 10
![Page 67: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/67.jpg)
Solving Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Clear: Running time is O(V ), and the returned solution is a vertex cover.
Solution is also optimal. (Use inductively the ex-istence of an optimal vertex cover without leaves)
IV. Covering Problems Vertex Cover 11
![Page 68: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/68.jpg)
Solving Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Clear: Running time is O(V ), and the returned solution is a vertex cover.
Solution is also optimal. (Use inductively the ex-istence of an optimal vertex cover without leaves)
IV. Covering Problems Vertex Cover 11
![Page 69: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/69.jpg)
Solving Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Clear: Running time is O(V ), and the returned solution is a vertex cover.
Solution is also optimal. (Use inductively the ex-istence of an optimal vertex cover without leaves)
IV. Covering Problems Vertex Cover 11
![Page 70: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/70.jpg)
Solving Vertex Cover on Trees
There exists an optimal vertex cover which does not include any leaves.
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Clear: Running time is O(V ), and the returned solution is a vertex cover.
Solution is also optimal. (Use inductively the ex-istence of an optimal vertex cover without leaves)
IV. Covering Problems Vertex Cover 11
![Page 71: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/71.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 72: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/72.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 73: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/73.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 74: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/74.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 75: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/75.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 76: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/76.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 77: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/77.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 78: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/78.jpg)
Execution on a Small Example
After iteration
VERTEX-COVER-TREES(G)1: C = ∅2: while ∃ leaves in G3: Add all parents to C4: Remove all leaves and their parents from G5: return C
Problem can be also solved on bipartite graphs, using Max-Flows and Min-Cuts.
IV. Covering Problems Vertex Cover 12
![Page 79: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/79.jpg)
Exact Algorithms
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
Such algorithms are called exact algorithms.
Focus on instances where the minimum vertex cover is small, that is,less or equal than some given integer k .
Simple Brute-Force Search would take ≈(n
k
)= Θ(nk ) time.
IV. Covering Problems Vertex Cover 13
![Page 80: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/80.jpg)
Exact Algorithms
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
Such algorithms are called exact algorithms.
Focus on instances where the minimum vertex cover is small, that is,less or equal than some given integer k .
Simple Brute-Force Search would take ≈(n
k
)= Θ(nk ) time.
IV. Covering Problems Vertex Cover 13
![Page 81: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/81.jpg)
Exact Algorithms
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
Such algorithms are called exact algorithms.
Focus on instances where the minimum vertex cover is small, that is,less or equal than some given integer k .
Simple Brute-Force Search would take ≈(n
k
)= Θ(nk ) time.
IV. Covering Problems Vertex Cover 13
![Page 82: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/82.jpg)
Exact Algorithms
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
Such algorithms are called exact algorithms.
Focus on instances where the minimum vertex cover is small, that is,less or equal than some given integer k .
Simple Brute-Force Search would take ≈(n
k
)= Θ(nk ) time.
IV. Covering Problems Vertex Cover 13
![Page 83: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/83.jpg)
Exact Algorithms
1. If inputs (or solutions) are small, an algorithm with exponentialrunning time may be satisfactory
2. Isolate important special cases which can be solved inpolynomial-time.
3. Develop algorithms which find near-optimal solutions inpolynomial-time.
Strategies to cope with NP-complete problems
Such algorithms are called exact algorithms.
Focus on instances where the minimum vertex cover is small, that is,less or equal than some given integer k .
Simple Brute-Force Search would take ≈(n
k
)= Θ(nk ) time.
IV. Covering Problems Vertex Cover 13
![Page 84: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/84.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.Proof:
⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k
⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
uu
Gu v
IV. Covering Problems Vertex Cover 14
![Page 85: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/85.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:
⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k
⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
uu
Gu v
IV. Covering Problems Vertex Cover 14
![Page 86: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/86.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
uu
Gu v
IV. Covering Problems Vertex Cover 14
![Page 87: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/87.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
u
u
Gu v
IV. Covering Problems Vertex Cover 14
![Page 88: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/88.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k
⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
u
u
Gu v
IV. Covering Problems Vertex Cover 14
![Page 89: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/89.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
u
u
Gu v
IV. Covering Problems Vertex Cover 14
![Page 90: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/90.jpg)
Towards a more efficient Search
Consider a graph G = (V ,E), edge {u, v} ∈ E(G) and integer k ≥ 1.Let Gu be the graph obtained by deleting u and its incident edges (Gv isdefined similarly). Then G has a vertex cover of size k if and only if Gu
or Gv (or both) have a vertex cover of size k − 1.
Substructure Lemma
Reminiscent of Dynamic Programming.
Proof:⇐ Assume Gu has a vertex cover Cu of size k − 1.
Adding u yields a vertex cover of G which is of size k⇒ Assume G has a vertex cover C of size k , which contains, say u.
Removing u from C yields a vertex cover of Gu which is of size k − 1.
u
u
Gu v
IV. Covering Problems Vertex Cover 14
![Page 91: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/91.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2
⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 92: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/92.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2
⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 93: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/93.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2
⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 94: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/94.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2
⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 95: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/95.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 96: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/96.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 97: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/97.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 98: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/98.jpg)
A More Efficient Search Algorithm
VERTEX-COVER-SEARCH(G, k)1: If E = ∅ return ∅2: If k = 0 and E 6= ∅ return ⊥3: Pick an arbitrary edge (u, v) ∈ E4: S1 = VERTEX-COVER-SEARCH(Gu, k − 1)5: S2 = VERTEX-COVER-SEARCH(Gv , k − 1)6: if S1 6= ⊥ return S1 ∪ {u}7: if S2 6= ⊥ return S2 ∪ {v}8: return ⊥
Correctness follows by the Substructure Lemma and induction.
Running time:
Depth k , branching factor 2⇒ total number of calls is O(2k )
O(E) work per recursive call
Total runtime: O(2k · E).
exponential in k , but much better than Θ(nk ) (i.e., still polynomial for k = O(log n))
IV. Covering Problems Vertex Cover 15
![Page 99: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/99.jpg)
Outline
Introduction
Vertex Cover
The Set-Covering Problem
IV. Covering Problems The Set-Covering Problem 16
![Page 100: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/100.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 101: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/101.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 102: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/102.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 103: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/103.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 104: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/104.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3
S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 105: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/105.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4
S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 106: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/106.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 107: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/107.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 108: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/108.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 109: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/109.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 110: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/110.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 111: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/111.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 112: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/112.jpg)
The Set-Covering Problem
Given: set X of size n and family of subsets FGoal: Find a minimum-size subset C ⊆ F
s.t. X =⋃
S∈C
S.
Set Cover Problem
Only solvable if⋃
S∈F S = X !
Number of sets(and not elements)
S1
S2
S3 S4 S5
S6
Remarks:
generalisation of the vertex-cover problem and hence also NP-hard.
models resource allocation problems
IV. Covering Problems The Set-Covering Problem 17
![Page 113: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/113.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 114: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/114.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 115: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/115.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 116: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/116.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 117: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/117.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4
S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 118: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/118.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5
S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 119: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/119.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 120: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/120.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 121: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/121.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 122: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/122.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 123: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/123.jpg)
Greedy
Strategy: Pick the set S that covers thelargest number of uncovered elements.
35.3 The set-covering problem 1119
A greedy approximation algorithmThe greedy method works by picking, at each stage, the set S that covers the great-est number of remaining elements that are uncovered.GREEDY-SET-COVER.X; F /
1 U D X2 C D ;3 while U ¤ ;4 select an S 2 F that maximizes jS \ U j5 U D U ! S6 C D C [ fSg7 return C
In the example of Figure 35.3, GREEDY-SET-COVER adds to C , in order, the setsS1, S4, and S5, followed by either S3 or S6.
The algorithm works as follows. The set U contains, at each stage, the set ofremaining uncovered elements. The set C contains the cover being constructed.Line 4 is the greedy decision-making step, choosing a subset S that covers as manyuncovered elements as possible (breaking ties arbitrarily). After S is selected,line 5 removes its elements from U , and line 6 places S into C . When the algorithmterminates, the set C contains a subfamily of F that covers X .
We can easily implement GREEDY-SET-COVER to run in time polynomial in jX jand jF j. Since the number of iterations of the loop on lines 3–6 is bounded fromabove by min.jX j ; jF j/, and we can implement the loop body to run in timeO.jX j jF j/, a simple implementation runs in time O.jX j jF jmin.jX j ; jF j//. Ex-ercise 35.3-3 asks for a linear-time algorithm.
AnalysisWe now show that the greedy algorithm returns a set cover that is not too muchlarger than an optimal set cover. For convenience, in this chapter we denote the d thharmonic number Hd D
PdiD1 1=i (see Section A.1) by H.d/. As a boundary
condition, we define H.0/ D 0.
Theorem 35.4GREEDY-SET-COVER is a polynomial-time !.n/-approximation algorithm, where!.n/ D H.max fjS j W S 2 F g/ :
Proof We have already shown that GREEDY-SET-COVER runs in polynomialtime.
Can be easily implemented to runin time polynomial in |X | and |F|
How good is the approximation ratio?
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
Greedy chooses S1,S4,S5 and S3
(or S6), which is a cover of size 4.
Optimal cover is C = {S3,S4,S5}
Optimal cover is C = {S3,S4,S5}
IV. Covering Problems The Set-Covering Problem 18
![Page 124: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/124.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F})
≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 125: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/125.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F})
≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 126: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/126.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 127: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/127.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 128: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/128.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 129: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/129.jpg)
Approximation Ratio of Greedy
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
H(k) :=∑k
i=11i ≤ ln(k) + 1
Idea: Distribute cost of 1 for each added set over newly covered elements.
If an element x is covered for the first time by set Si in iteration i , then
cx :=1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|.
Definition of cost
Notice that in the mathematical analysis, Si is the set chosen in itera-tion i - not to be confused with the sets S1,S2, . . . ,S6 in the example.
IV. Covering Problems The Set-Covering Problem 19
![Page 130: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/130.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 131: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/131.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 132: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/132.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 133: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/133.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 134: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/134.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4
S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 135: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/135.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4
S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 136: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/136.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5
S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 137: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/137.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5
S3
16
16
16
16
16
16
13
13
13
12
12
1
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 138: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/138.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
12
1
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 139: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/139.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 =
4
IV. Covering Problems The Set-Covering Problem 20
![Page 140: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/140.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 = ??
4
IV. Covering Problems The Set-Covering Problem 20
![Page 141: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/141.jpg)
Illustration of Costs for Greedy picking S1,S4,S5 and S3
S1
S2
S3 S4 S5
S6
S1
S4 S5S3
16
16
16
16
16
16
13
13
13
12
121
16 + 1
6 + 16 + 1
6 + 16 + 1
6 + 13 + 1
3 + 13 + 1
2 + 12 + 1 = 4
IV. Covering Problems The Set-Covering Problem 20
![Page 142: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/142.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.
Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx
(1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so
∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 143: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/143.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx
(1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so
∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 144: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/144.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so
∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 145: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/145.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so
∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 146: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/146.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 147: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/147.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 148: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/148.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 149: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/149.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx
≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 150: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/150.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx ≤∑
S∈C∗H(|S|)
≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 151: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/151.jpg)
Proof of Theorem 35.4 (1/2)
If x is covered for the first time by a set Si , then cx := 1
|Si\(S1∪S2∪···∪Si−1)|.
Definition of cost
Proof.Each step of the algorithm assigns one unit of cost, so
|C| =∑x∈X
cx (1)
Each element x ∈ X is in at least one set in the optimal cover C∗, so∑S∈C∗
∑x∈S
cx ≥∑x∈X
cx (2)
Combining 1 and 2 gives
|C| ≤∑
S∈C∗
∑x∈S
cx ≤∑
S∈C∗H(|S|) ≤ |C∗| · H(max{|S| : S ∈ F})
Key Inequality:∑
x∈S cx ≤ H(|S|).
IV. Covering Problems The Set-Covering Problem 21
![Page 152: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/152.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let
ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|
⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered firsttime by Si .
⇒ ∑x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 153: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/153.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let
ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 154: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/154.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|
⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered firsttime by Si .
⇒ ∑x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 155: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/155.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|
⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered firsttime by Si .
⇒ ∑x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S
Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 156: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/156.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|
⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered firsttime by Si .
⇒ ∑x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S
Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 157: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/157.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .
⇒ ∑x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 158: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/158.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx
=k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 159: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/159.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 160: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/160.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 161: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/161.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 162: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/162.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
= ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 163: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/163.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 164: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/164.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx
≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 165: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/165.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1
=k∑
i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 166: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/166.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 167: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/167.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 168: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/168.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui ))
= H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 169: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/169.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk )
= H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 170: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/170.jpg)
Proof of Theorem 35.4 (2/2)
Proof of the Key Inequality∑
x∈S cx ≤ H(|S|)
For any S ∈ F and i = 1, 2, . . . , |C| = k let ui := |S \ (S1 ∪ S2 ∪ · · · ∪ Si )|⇒ |X | = u0 ≥ u1 ≥ · · · ≥ u|C| = 0 and ui−1 − ui counts the items in S covered first
time by Si .⇒ ∑
x∈S
cx =k∑
i=1
(ui−1 − ui ) ·1
|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)|
Further, by definition of the GREEDY-SET-COVER:|Si \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| ≥ |S \ (S1 ∪ S2 ∪ · · · ∪ Si−1)| = ui−1.
Combining the last inequalities gives:∑x∈S
cx ≤k∑
i=1
(ui−1 − ui ) ·1
ui−1=
k∑i=1
ui−1∑j=ui+1
1ui−1
≤k∑
i=1
ui−1∑j=ui+1
1j
=k∑
i=1
(H(ui−1)− H(ui )) = H(u0)− H(uk ) = H(|S|).
Remaining uncovered elements in S Sets chosen by the algorithm
IV. Covering Problems The Set-Covering Problem 22
![Page 171: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/171.jpg)
Set-Covering Problem (Summary)
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
The same approach also gives an approximation ratioof O(ln(n)) if there exists a cost function c : S → Z+
Can be applied to the Vertex Cover Problem for Graphs withmaximum degree 3 to obtain approximation ratio of 1 + 1
2 + 13 < 2.
Is the bound on the approximation ratio in Theorem 35.4 tight?
Is there a better algorithm?
Unless P=NP, there is no c ·ln(n) polynomial-time approximation algorithmfor some constant 0 < c < 1.
Lower Bound
IV. Covering Problems The Set-Covering Problem 23
![Page 172: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/172.jpg)
Set-Covering Problem (Summary)
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
The same approach also gives an approximation ratioof O(ln(n)) if there exists a cost function c : S → Z+
Can be applied to the Vertex Cover Problem for Graphs withmaximum degree 3 to obtain approximation ratio of 1 + 1
2 + 13 < 2.
Is the bound on the approximation ratio in Theorem 35.4 tight?
Is there a better algorithm?
Unless P=NP, there is no c ·ln(n) polynomial-time approximation algorithmfor some constant 0 < c < 1.
Lower Bound
IV. Covering Problems The Set-Covering Problem 23
![Page 173: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/173.jpg)
Set-Covering Problem (Summary)
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
The same approach also gives an approximation ratioof O(ln(n)) if there exists a cost function c : S → Z+
Can be applied to the Vertex Cover Problem for Graphs withmaximum degree 3 to obtain approximation ratio of 1 + 1
2 + 13 < 2.
Is the bound on the approximation ratio in Theorem 35.4 tight?
Is there a better algorithm?
Unless P=NP, there is no c ·ln(n) polynomial-time approximation algorithmfor some constant 0 < c < 1.
Lower Bound
IV. Covering Problems The Set-Covering Problem 23
![Page 174: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/174.jpg)
Set-Covering Problem (Summary)
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
The same approach also gives an approximation ratioof O(ln(n)) if there exists a cost function c : S → Z+
Can be applied to the Vertex Cover Problem for Graphs withmaximum degree 3 to obtain approximation ratio of 1 + 1
2 + 13 < 2.
Is the bound on the approximation ratio in Theorem 35.4 tight?
Is there a better algorithm?
Unless P=NP, there is no c ·ln(n) polynomial-time approximation algorithmfor some constant 0 < c < 1.
Lower Bound
IV. Covering Problems The Set-Covering Problem 23
![Page 175: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/175.jpg)
Set-Covering Problem (Summary)
GREEDY-SET-COVER is a polynomial-time ρ(n)-algorithm, where
ρ(n) = H(max{|S| : |S| ∈ F}) ≤ ln(n) + 1.
Theorem 35.4
The same approach also gives an approximation ratioof O(ln(n)) if there exists a cost function c : S → Z+
Can be applied to the Vertex Cover Problem for Graphs withmaximum degree 3 to obtain approximation ratio of 1 + 1
2 + 13 < 2.
Is the bound on the approximation ratio in Theorem 35.4 tight?
Is there a better algorithm?
Unless P=NP, there is no c ·ln(n) polynomial-time approximation algorithmfor some constant 0 < c < 1.
Lower Bound
IV. Covering Problems The Set-Covering Problem 23
![Page 176: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/176.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 177: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/177.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 178: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/178.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 179: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/179.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 180: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/180.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1
S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 181: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/181.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2
S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 182: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/182.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3
S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 183: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/183.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 184: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/184.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 185: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/185.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 186: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/186.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 187: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/187.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3
S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 188: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/188.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2
S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 189: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/189.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1
S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 190: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/190.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 191: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/191.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets.
Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 192: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/192.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets.
Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 193: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/193.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets.
Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 194: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/194.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets.
Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24
![Page 195: · Motivation Many fundamental problems are NP-complete, yet they are too impor-tant to be abandoned. Examples: HAMILTON, 3-SAT, VERTEX-COVER, KNAPSACK,::: 1.If inputs (or solutions)](https://reader034.vdocuments.us/reader034/viewer/2022050220/5f65eaa3f23eed77f9118bc0/html5/thumbnails/195.jpg)
Example where the solution of Greedy is bad
Given any integer k ≥ 3
There are n = 2k+1 − 2 elements overall (so k ≈ log2 n)
Sets S1,S2, . . . ,Sk are pairwise disjoint and each set contains2, 4, . . . , 2k elements
Sets T1,T2 are disjoint and each set contains half of the elements ofeach set S1,S2, . . . ,Sk
Instance
k = 4, n = 30:
S1 S2 S3 S4
Solution of Greedy consists of k sets. Optimum consists of 2 sets.
T1
T2
S1 S2 S3 S4
T1
T2
IV. Covering Problems The Set-Covering Problem 24