Problem Definition Problem Definition Problem Definition Problem - - PowerPoint PPT Presentation
Problem Definition Problem Definition Problem Definition Problem - - PowerPoint PPT Presentation
Problem Definition Problem Definition Problem Definition Problem Definition Problem Definition Problem Definition 4 colors Problem Definition 4 colors 3 colors Problem Definition Definition: k-coloring problem: a graph coloring using
Problem Definition
Problem Definition
Problem Definition
Problem Definition
Problem Definition
⇒
Problem Definition
4 colors
Problem Definition
4 colors 3 colors
Definition: k-coloring problem: a graph coloring using at most k colors, with adjacent vertexes in different color. Chromatic number: the smallest k of a graph
Problem Definition
Definition: k-coloring problem: a graph coloring using at most k colors, with adjacent vertexes in different color. Chromatic number: the smallest k of a graph
Problem Definition
How to calculate Chromatic number? How to get the k-coloring graph? What’s the time complexity?
Time Complexity
Theorem: Every graph can be colored with one more color than the maximum vertex degree. (Upper bound) k ≤ ∆ 𝐻 + 1
One solution is to enumerate all the condition. Each vertex has k coloring scheme. So the time complexity is 𝑃(𝑙𝑜)。
𝑃 𝑙𝑜 ≤ 𝑃 ∆ 𝐻 + 1 𝑜 ≤ 𝑃 𝑜𝑜
Time Complexity
Theorem: Every graph can be colored with one more color than the maximum vertex degree. (Upper bound) k ≤ ∆ 𝐻 + 1
One solution is to enumerate all the condition. Each vertex has k coloring scheme. So the time complexity is 𝑃(𝑙𝑜)。
𝑃 𝑙𝑜 ≤ 𝑃 ∆ 𝐻 + 1 𝑜 ≤ 𝑃 𝑜𝑜
It’s tooooooo slow!!!
Time Complexity
One solution is to enumerate all the condition. Each vertex has k coloring scheme. So the time complexity is 𝑃(𝑙𝑜)。
It’s tooooooo slow!!! Can we find a polynomial time complexity?
𝑃(𝑜20) 𝑃(𝑜1000) 𝑃(𝑜3)
Time Complexity
One solution is to enumerate all the condition. Each vertex has k coloring scheme. So the time complexity is 𝑃(𝑙𝑜)。
It’s tooooooo slow!!! Can we find a polynomial time complexity?
𝑃(𝑜20) 𝑃(𝑜1000) 𝑃(𝑜3)
No, because it’s an NP-hard problem.
Time Complexity
One solution is to enumerate all the condition. Each vertex has k coloring scheme. So the time complexity is 𝑃(𝑙𝑜)。
It’s tooooooo slow!!! Can we find a polynomial time complexity?
𝑃(𝑜20) 𝑃(𝑜1000) 𝑃(𝑜3)
No, because it’s an NP-hard problem. Definition: NP-hard problem is the problem which has not been proved to be solved by polynomial algorithm. 𝑃(c𝑜)
Outline
Problem Definition Dynamic Programming Algorithm
- Maximal Independent Set
- Lawler’ s Algorithm
- Time Complexity
Björklund-Husfeldt Algorithm
- Preliminary
- K-Cover & K-Partition
- Chromatic Number
Definition 2.1: An independent set of G is a subset 𝑇 ⊆ 𝑊 such that no two nodes in S are adjacent in G.
Independent Set
Definition 2.1: Let G[S] be the graph induced by S from G
Definition 2.1: Let G[S] be the graph induced by S from G
Definition 2.1: Let G[S] be the graph induced by S from G
Lemma: A graph G is k-colorable, iff there exists an independent set I of G, s.t. G[V-I] is (k-1)-colorable Proof: K colorable
Lemma: A graph G is k-colorable, iff there exists an independent set I of G, s.t. G[V-I] is (k-1)-colorable Proof:
Lemma: A graph G is k-colorable, iff there exists an independent set I of G, s.t. G[V-I] is (k-1)-colorable Proof: (K-1) colorable Independent Set
Lemma: A graph G is k-colorable, iff there exists an independent set I of G, s.t. G[V-I] is (k-1)-colorable Proof:
What to do with the chromatic number? All the possible colorability of G is included in all the possible colorability of G[V-I] + 1 The minimum number for coloring G is the minimum number for coloring of G[V-I] + 1 Chromatic number of G is the chromatic number of G[V-I] + 1
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Lawler’ s Algorithm
𝐷ℎ𝑠𝑝𝑂𝑣𝑛[∅] = 0 (the base situation) for 𝑇 (𝑇 ≠ ∅) in subsets of vertices of 𝐻 (Outer loop needs to be ordered from smaller to larger subsets): ChroNum[𝑇] = 𝑜 for 𝐽 in independent subsets of S: ChroNum[𝑇] = 𝑛𝑗𝑜(𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇], 𝐷ℎ𝑠𝑝𝑂𝑣𝑛[𝑇 − 𝐽] + 1)
Time Complexity
We need to find all the independent set for all subset of the graph The time complexity is as follow:
Ο
𝑇⊆𝑊
𝑔𝑗𝑜𝑒 𝑢ℎ𝑓 In𝑒𝑓𝑞𝑓𝑜𝑒𝑓𝑜𝑢 𝑇𝑓𝑢 𝑝𝑔 𝑇 = Ο
𝑗=0 𝑜
𝑜 𝑗 𝑛2i = Ο 𝑛3𝑜
V S
I1 I2
Independent Set of S can be listed within O(𝑛2𝑗)
Outline
Problem Definition Dynamic Programming Algorithm
- Maximal Independent Set
- Lawler’ s Algorithm
- Time Complexity
Björklund-Husfeldt Algorithm
- Preliminary
- K-Cover
- Chromatic Number
Preliminary
Preliminary
Definition 3.1: U is a set of all the vertices, S is a family of subsets of U, S is an element of S, X is also a set of vertices S[𝑌] ≔ { 𝑇 ∈ 𝑻 ∶ 𝑇 ∩ 𝑌 = ∅ } 𝑡 𝑌 ≔ | 𝑻 𝑌 | 𝑻(𝑗) ≔ 𝑇 ∈ 𝑻 ∶ 𝑇 = 𝑗 𝑡(𝑗) 𝑌 ≔ | 𝑻 𝑗 𝑌 |
Preliminary
Preliminary
Given: 𝑜 = 5 𝑌 = {1,3} 𝑻 = 1,2,3 , 1,4 , 3,5 , 2,4,5 𝑻 𝑌 = 2,4,5 s 𝑌 = 1
S[𝑌] ≔ { 𝑇 ∈ 𝑻 ∶ 𝑇 ∩ 𝑌 = ∅ } 𝑡 𝑌 ≔ | 𝑻 𝑌 | 𝑻(𝑗) ≔ 𝑇 ∈ 𝑻 ∶ 𝑇 = 𝑗 𝑡(𝑗) 𝑌 ≔ | 𝑻 𝑗 𝑌 |
Preliminary
Given: 𝑜 = 5 𝑌 = {1,3} 𝑻 = 1,2,3 , 1,4 , 3,5 , 2,4,5 𝑗 = 2 𝑻(2) = 1,4 , {3,5} 𝑡(2) 𝑌 = 0
S[𝑌] ≔ { 𝑇 ∈ 𝑻 ∶ 𝑇 ∩ 𝑌 = ∅ } 𝑡 𝑌 ≔ | 𝑻 𝑌 | 𝑻(𝑗) ≔ 𝑇 ∈ 𝑻 ∶ 𝑇 = 𝑗 𝑡(𝑗) 𝑌 ≔ | 𝑻 𝑗 𝑌 |
Lemma 3.1: 𝑑𝑙 denote the number of (possible overlapping) k-covers 𝑑𝑙 ≔
𝑌 ⊆ 𝑉
(−1)|𝑌| 𝑡[𝑌]𝑙 𝑡[𝑌]𝑙 counts the number of ways to pick k sets 𝑇1, … , 𝑇𝑙 ∈ 𝑻 𝑌 with replacement
K-Cover
K-Cover
Given: 𝑜 = 3 𝑻 = 2 , 2,3 , {1,3} When 𝑌 = 1 , k = 2: 𝑻 𝑌 = 2,3 , {2} 𝑡[𝑌]2= 4 After picking all subset X from U: 𝑑2 > 0
𝑑𝑙 ≔
𝑌 ⊆ 𝑉
(−1)|𝑌| 𝑡[𝑌]𝑙
Chromatic Number
The main idea of Björklund-Husfeldt Algorithm is to use binary search to find the least k with 𝑑𝑙 is nonzero
Chromatic Number
Theorem 3.1: The number of k-covers 𝑑𝑙 can be computed in time and space 2𝑜𝑜𝑃(1) Proposition 3.1: The chromatic number can be found in time 2𝑜𝑜𝑃(1) and space 2𝑜𝑜