Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fixed Parameter Tractability for Graph Drawing Sue Whitesides Computer Science Department.

Similar presentations


Presentation on theme: "Fixed Parameter Tractability for Graph Drawing Sue Whitesides Computer Science Department."— Presentation transcript:

1 Fixed Parameter Tractability for Graph Drawing Sue Whitesides Computer Science Department

2 introduction In the last talk, we saw examples of representing graphs geometrically, in the context of graph drawing. Here we look at the technique of FPT as it can apply to graph drawing 1) Brief introduction to Fixed Parameter Tractability FPT 2) Example: an FPT algorithm for graph drawing

3 1. Introduction to Fixed Parameter Tractability FPT

4 Recall: Vertex Cover Problem Let G = ( V,E ) be an undirected graph. Let V’ ⊆ V. V’ is a vertex cover for G if for each edge (x,y) ∈ E: x ∈ V’ or y ∈ V’ (or both). – We call an edge such that at least one of its endpoints is in V’ covered. Let G = (V,E) be an undirected graph. Let V’ ⊆ V. V’ is a independent set for G if for each pair x,y ∈ V’: (x,y) ∉ E. – We call two vertices that are not adjacent independent

5 A vertex cover (black) and an independent set (blue)

6 Vertex Cover Decision Problem Input: An undirected graph G = (V,E), and a positive integer k Question: Does there exist a vertex cover V’ for G that is of size at most k, that is | V’ | ≤ k ?

7 Minimum Vertex Cover Optimization Problem Input: An undirected graph G = (V,E) Output: A minimum vertex cover for G, i.e., a vertex cover that is of smallest possible size

8 A minimum vertex cover (black) and a maximum independent set (blue)

9 Solving Vertex Cover for G and k Algorithm (bounded search tree/backtracking approach) Observation. Given graph G = (V,E) and a vertex cover V’ ⊆ V for G – For each vertex x in a graph: if x ∉ V’ then all its a adjacent vertices N(x) must be in V’, that is: N(x) ⊆ V’ Justification. if neither x nor one of its adjacent vertices w is in V’, then the edge (x,w) is not covered. A contradiction.

10 Solving Vertex Cover for G and k via the technique of bounded search trees: Algorithm VC( G, k ) if E = ∅ and k ≥ 0 return yes pick a vertex x ∈ V with deg(x) ≥ 1 G’ ← G-x ; k ’ ← k -1 G” ← from G - N(x) ; k ” ← k - |N(x)| Recursively solve VC( G’, k’ ) as long as k’ ≥ 0, and VC( G”, k” ) as long as k” ≥ 0 : If VC( G ’, k ’) returns no then return VC( G ”, k ”) return no O(2 k n)

11 definitions parameterized decision problem fixed-parameter tractable FPT

12 Example of a Parameterized Decision Problem: k -Vertex Cover Input: An undirected graph G = (V,E), and a positive integer k Parameter: k (integer) Question: Does there exist a vertex cover V’ ⊆ V for G that is of size at most k, that is | V’ | ≤ k ?

13 Parameterized Decision Problems A parameterized decision problem is a decision problem with, additionally, an identified parameter. A parameter can be a part of the problem’s input, a property of the problem’s input or a combination of several parameters The running time analysis of an algorithm solving a parameterized decision problem is done in terms of the input size, n, and its parameter, k

14 Fixed parameter tractable parameterized decision problems & the parameterized complexity class FPT A parameterized decision problem with input size n and parameter k that can be solved by an algorithm in time O(f(k) n c ), where c > 0 is a constant, is called fixed- parameter tractable, and is a member of the class FPT, the class of fixed-parameter tractable parameterized decision problems. f denotes any (computable) function. That is, f may be exponential or worse, but depends only on k. Examples: f(k) = 2 k, f(k) = k k, f(k) = k 128k

15 note A parameterized decision problem with input size n and parameter k that can be solved by an algorithm in time O(f(k) + n c ), where c > 0 is a constant, is fixed-parameter tractable: O(f(k) n c )

16 Solving Vertex Cover: Polynomial-time Preprocessing Observation: Given are graph G = (V,E) and integer k > 0. If G has a vertex cover V’ of size at most k, and if there exists a vertex v ∈ V with deg(v) = 0, then v ∉ V’. This results in the following preprocessing step for solving k -Vertex Cover. Rule 1. Clean-up singletons: while there exists v ∈ V with deg(v) = 0 do G ← G-v

17 Solving Vertex Cover: Polynomial-time Preprocessing Observation: Given a graph G = (V,E) and an integer k > 0. If G has a vertex cover V’ of size at most k, and if there exists a vertex v ∈ V with deg(v) > k, then v ∈ V’. This results in the following preprocessing step for solving k - Vertex Cover: Rule 2. Pick high-degree vertices: while there exists v ∈ V with deg(v) > k do V’ ← V’ ∪ { v } k ← k-1 G ← G-v

18 Solving Vertex Cover: Polynomial-time Preprocessing Note that if Rule 2 cannot be applied, then every vertex has degree at most k. Further: Given a graph G = (V,E) and an integer k > 0 where Rule 2 cannot be applied. If G has a vertex cover of size at most k, then | V | ≤ k 2 +k.

19 Solving Vertex Cover: Polynomial-time Preprocessing Observation: Given are graph G = (V,E) and integer k > 0. If there exists a vertex v ∈ V with deg(v) = 1, then v’ s neighbour w can be included in any vertex cover, that is w ∈ V’. This results in the following preprocessing step for solving k - Vertex Cover. Rule 3. Pick neighbours of pendant vertices: while there exists v ∈ V with deg(v) = 1 do V’ ← V’ ∪ N ( v ) k ← k-1 G ← G-v-N ( v )

20 Solving Vertex Cover: Polynomial-time Preprocessing Observation: Given are graph G = (V,E) and integer k > 0. If there exists a vertex v ∈ V with deg(v) = 2, N ( v ) = {w,z}, and edge (w,z) ∈ E then v’ s neighbours w and z can be included in any vertex cover, that is w,z ∈ V’. This results in the following preprocessing step for solving k -Vertex Cover. Rule 4. Pick neighbours of pendant degree 2 vertices: while there exists v ∈ V with deg(v) = 2, N ( v ) = {w,z}, and edge (w,z) ∈ E do V’ ← V’ ∪ N ( v ) k ← k-2 G ← G-v-N ( v )

21 Solving Vertex Cover: Polynomial-time Preprocessing We summarize the polynomial-time preprocessing as follows (can look for/ apply a rule at most k times O(kn) ) repeat until no change occurs: – while Rule 1 applies do apply Rule 1 – while Rule 2 applies do apply Rule 2 – while Rule 3 applies do apply Rule 3 – while Rule 4 applies do apply Rule 4

22 Solving Vertex Cover: Polynomial-time Preprocessing Further, once none of the preprocessing rule applies we can make the following decision, since if the graph has a vertex cover of size at most k then | V | ≤ k 2 +k : if |V| > k 2 +k then answer “no”

23 Solving Vertex Cover: Polynomial-time Preprocessing After the preprocessing steps are done, and the algorithm didn’t return “no”, the bounded search tree algorithm can be run next to decide the problem. This results in a running time of O(kn + 2 k k 2 ) … thus, O(2 k k 2 n)

24 2. Fixed Parameter Tractable Algorithm for a Graph Drawing Problem coming next ….


Download ppt "Fixed Parameter Tractability for Graph Drawing Sue Whitesides Computer Science Department."

Similar presentations


Ads by Google