complexity theory of polynomial-time problems
Post on 23-Apr-2022
4 Views
Preview:
TRANSCRIPT
Complexity Theory of Polynomial-Time Problems
Karl Bringmann
Lecture 8: (Boolean) Matrix Multiplication
Recall: Boolean Matrix Multiplication
given ๐ร๐ matrices ๐ด, ๐ต with entries in {0,1}compute matrix ๐ถ with ๐ถ+,, = โ ๐ด+,/ โง ๐ต/,,1
/23
what we already know about BMM:
BMM is in time ๐(๐6/ log๐) (four Russians)
BMM is equivalent to computing the Transitive Closure of a given graph
BMM can be reduced to APSP โ ๐(๐6/2 ?@A 1)
โฎ โฎโฎ๐ ๐๐
๐ โค โฆStrassenโ69 2.81Panโ78 2.79
Bini et al.โ79 2.78
Schรถnhageโ80 2.52
Romaniโ80 2.52
Coppersmith,Winogradโ81 2.50
Strassenโ86 2.48
Coppersmith,Winogradโ90 2.376
Stothersโ10 2.374
Vassilevska-Williamsโ11 2.37288
Le Gallโ14 2.37287
Exponent of Matrix Multiplication
define ๐ as the infimum over all ๐ such that MM has an ๐(๐F ) algorithm
note: MM is in time ๐(๐GHI) for any ๐ > 0
we will be sloppy and write: MM is in time ๐(๐G)
Thm: ๐ < 3
this is very fast โ in theory
all these algorithms have impractically large constant factors
(maybe except Strassenโ69)
note: MM is not in time ๐(๐GNI) for any ๐ > 0 ๐ โฅ 2
Boolean Matrix Multiplication
Thm: BMM is in time ๐(๐G)
given ๐ร๐ matrices ๐ด, ๐ต with entries in {0,1}
compute standard matrix product ๐ถโฒ with ๐ถ+,,Q = โ ๐ด+,/ โ ๐ต/,,1+23
define matrix ๐ถ with ๐ถ+,, = [๐ถ+,,Q > 0]
then ๐ถ is the Boolean matrix product of ๐ด and ๐ต
Hypothesis: BMM is not in time ๐(๐GNI)
Combinatorial Algorithms
fast matrix multiplication uses algebraic techniques which are impractical
โcombinatorial algorithmsโ: do not use algebraic techniques
not well defined!
Arlazarov,Dinic,Kronrod, Faradzhevโ70 (four russians)
๐(๐6/logV๐)
Bansal,Williamsโ09 ๐(๐6 log log ๐ V/logW/X๐)
Chanโ15 ๐(๐6 log log ๐ 6/log6๐)Yuโ15 ๐(๐6poly log log ๐ /logX๐)
Hypothesis: BMM has no โcombinatorialโ algorithm in time ๐(๐6NI)
In this lecture you learn that...
โฆ(B)MM is useful for designing theoretically fast algorithms
- Exercise: k-Clique in ๐(๐G//6)
no combinatorial ๐(๐6NI)
- Exercise: MaxCut in ๐(2G1/6poly(๐))- Node-Weighted Negative Triangle in ๐(๐G)
โฆBMM is an obstacle for practically fast / theoretically very fast algorithms
not faster than ๐(๐V.6\6)
- Exercise: pattern matching with 2 patterns
- Sliding Window Hamming Distance
- Transitive Closure has no ๐(๐GNI) / combinatorial ๐(๐6NI) algorithm
- context-free grammar problems
Outline
1) Relations to Subcubic Equivalences
2) Strassenโs Algorithm
3) Sliding Window Hamming Distance
4) Node-Weighted Negative Triangle
5) Context-Free Grammars
Corollaries from Subcubic Equivalences
given an unweighted graph ๐บ
does it contain a triangle?
BMM
โบ
Triangle
โบ
All-Pairs-Triangle
given an unweighted graph ๐บ
vertices ๐ = ๐ผ โช ๐ฝ โช ๐พ
โ๐, ๐: are they in a triangle with some ๐?
APSP
Min-Plus Product
All-Pairs-Negative-Triangle
โบโบ
Negative Triangle
โบ
[Vassilevska-Williams,Williamsโ10]
Corollaries from Subcubic Equivalences
BMM
โบ
Triangle
โบ
All-Pairs-Triangle
APSP
Min-Plus Product
All-Pairs-Negative-Triangle
โบโบ
Negative Triangle
โบ
โฎ โฎโฎ๐ ๐๐
๐ด ๐ต
๐ผ ๐พ ๐ฝ
Corollaries from Subcubic Equivalences
BMM
โบ
Triangle
โบ
All-Pairs-Triangle
APSP
Min-Plus Product
All-Pairs-Negative-Triangle
โบโบ
Negative Triangle
โบGiven an unweighted undirected graph ๐บ
Adjacency matrix ๐ด, entries in {0,1}
1. Compute Boolean Product ๐ถ โ ๐ด โ ๐ด:
๐ถ+,, =k ๐ด+,/ โง ๐ด/,,/
2. Compute โ ๐ด+,, โง ๐ถ+,,+,,
this equals k ๐ด+,, โง ๐ด+,/ โง ๐ด/,,+,,,/
thus we solved triangle detection
Corollaries from Subcubic Equivalences
BMM
โบ
Triangle
โบ
All-Pairs-Triangle
APSP
Min-Plus Product
All-Pairs-Negative-Triangle
โบโบ
Negative Triangle
โบ
All-Pairs-Triangle to Triangle All-Pairs-Triangle
TriangleDecide whether there are vertices ๐, ๐, ๐ such that๐, ๐, ๐ form a triangle
Triangle
All-Pairs-TriangleDecide for every ๐ โ ๐ผ, ๐ โ ๐ฝ whether there is a vertex ๐ โ ๐พ such that
๐, ๐, ๐ form a triangle
Given graph ๐บ
Given graph ๐บ with vertex set ๐ = ๐ผ โช ๐ฝ โช ๐พ
Split ๐ผ, ๐ฝ, ๐พ into ๐/๐ parts of size ๐ :
For each of the (๐/๐ )6triples (๐ผn, ๐ฝo,๐พp):consider graph ๐บ[๐ผn โช ๐ฝo โช ๐พp]
๐ผ3,โฆ , ๐ผ1/r,๐ฝ3 , โฆ , ๐ฝ1/r, ๐พ3,โฆ , ๐พ1/r
๐ผn
๐พp
๐ฝo
๐ผ
๐พ
๐ฝ
All-Pairs-Triangle to Triangle
For each of the (๐/๐ )6triples of parts (๐ผn, ๐ฝo,๐พp):
While ๐บ[๐ผn โช ๐ฝo โช ๐พp]contains a triangle:Find a triangle (๐, ๐, ๐) in ๐บ[๐ผn โช ๐ฝo โช ๐พp]
Initialize ๐ถ as ๐ร๐ all-zeroes matrix
Set ๐ถ ๐, ๐ โ 1Delete edge (๐, ๐)
(๐, ๐) is in no more triangles
๐ผn
๐พp
๐ฝo
๐ผ
๐พ
๐ฝโ guaranteed termination:
โ correctness:
can delete โค ๐V edges
if (๐, ๐)is in a triangle, we will find one
All-Pairs-Triangle
Triangle
All-Pairs-Triangle to Triangle
Find a triangle (๐, ๐, ๐) in ๐บ[๐ผn โช ๐ฝo โช ๐พp]
How to find a triangleif we can only decide whether one exists?
Partition ๐ผn into ๐ผn(3), ๐ผn(V), ๐ฝo into ๐ฝo(3), ๐ฝo(V), ๐พp into ๐พp(3),๐พp(V)
๐ผn
๐พp
๐ฝo
Since ๐บ[๐ผn โช ๐ฝo โช ๐พp] contains a triangle,at least one of the 26 subgraphs
๐บ[๐ผn(s) โช ๐ฝo(t) โช ๐พp(F)]contains a triangle
Decide for each such subgraph whetherit contains a triangle
Recursively find a triangle in one subgraph
All-Pairs-Triangle
Triangle
All-Pairs-Triangle to Triangle
Find a triangle (๐, ๐, ๐) in ๐บ[๐ผn โช ๐ฝo โช ๐พp]
How to find a triangleif we can only decide whether one exists?
Partition ๐ผn into ๐ผn(3), ๐ผn(V), ๐ฝo into ๐ฝo(3), ๐ฝo(V), ๐พp into ๐พp(3),๐พp(V)
Since ๐บ[๐ผn โช ๐ฝo โช ๐พp] contains a triangle,at least one of the 26 subgraphs
๐บ[๐ผn(s) โช ๐ฝo(t) โช ๐พp(F)]contains a triangle
Decide for each such subgraph whetherit contains a triangle
Recursively find a triangle in one subgraph
๐vwxyz{w|xA?} ๐ โค
26 โ ๐~}๏ฟฝwy}z{w|xA?}(๐)
+๐vwxyz{w|xA?} ๐/2
= ๐(๐~}๏ฟฝwy}z{w|xA?} ๐ )
Running Time:
All-Pairs-Triangle
Triangle
All-Pairs-Triangle to Triangle
For each of the (๐/๐ )6triples of parts (๐ผn, ๐ฝo,๐พp):
While ๐บ[๐ผn โช ๐ฝo โช ๐พp]contains a triangle:Find a triangle (๐, ๐, ๐) in ๐บ[๐ผn โช ๐ฝo โช ๐พp]
Initialize ๐ถ as ๐ร๐ all-zeroes matrix
Set ๐ถ ๐, ๐ โ 1Delete edge (๐, ๐)
(โ) = ๐(๐vwxyz{w|xA?}(๐ )) = ๐(๐~}๏ฟฝwy}z{w|xA?}(๐ ))Running Time:
(โ)
Total time: #triples + #trianglesfound โ (โ)
โค ๐/๐ 6 + ๐V โ ๐~}๏ฟฝwy}z{w|xA?}(๐ )
Set ๐ = ๐3/6 and assume ๐~}๏ฟฝwy}z{w|xA?} ๐ = ๐(๐6NI)
Total time: ๐ ๐V โ ๐3NI/6 = ๐(๐6NI/6)
All-Pairs-Triangle
Triangle
Corollaries from Subcubic Equivalences
BMM
โบ
Triangle
โบ
All-Pairs-Triangle
APSP
Min-Plus Product
All-Pairs-Negative-Triangle
โบโบ
Negative Triangle
โบIf BMM has (combinatorial)๐(๐6NI) algorithmthen Triangle has (combinatorial) ๐ ๐6NI algorithm
If Triangle has (combinatorial) ๐(๐6NI) algorithmthen BMM has (combinatorial) ๐ ๐6NI/6 algorithm
โ subcubic equivalent, but this mainly makes sense for combinatorial algorithms
Outline
1) Relations to Subcubic Equivalences
2) Strassenโs Algorithm
3) Sliding Window Hamming Distance
4) Node-Weighted Negative Triangle
5) Context-Free Grammars
Strassenโs Algorithm
shows ๐ โค 2.81๐ด ๐ต ๐ถ
โ =๐ด3,3 ๐ด3,V
๐ดV,3 ๐ดV,V
๐ต3,3 ๐ต3,V
๐ตV,3 ๐ตV,V
๐ถ3,3 ๐ถ3,V
๐ถV,3 ๐ถV,V
๐ถ3,3 = ๐ด3,3 โ ๐ต3,3 + ๐ด3,V โ ๐ตV,3๐ถ3,V = ๐ด3,3 โ ๐ต3,V + ๐ด3,V โ ๐ตV,V
๐ถV,3 = ๐ดV,3 โ ๐ต3,3 + ๐ดV,V โ ๐ตV,3๐ถV,V = ๐ดV,3 โ ๐ต3,V + ๐ดV,V โ ๐ตV,V
๐ ๐ โค 8๐ ๐/2 +๐(๐V )
๐ ๐ โค ๐(๐6)
Strassenโs Algorithm
shows ๐ โค 2.81๐ด ๐ต ๐ถ
โ =๐ด3,3 ๐ด3,V
๐ดV,3 ๐ดV,V
๐ต3,3 ๐ต3,V
๐ตV,3 ๐ตV,V
๐ถ3,3 ๐ถ3,V
๐ถV,3 ๐ถV,V
๐ถ3,3 = ๐3 +๐X โ๐๏ฟฝ + ๐\
๐ถ3,V = ๐6 + ๐๏ฟฝ
๐ถV,3 = ๐V +๐X
๐ถV,V = ๐3 โ ๐V + ๐6 +๐๏ฟฝ
๐ ๐ โค 7๐ ๐/2 +๐(๐V )
๐ ๐ โค ๐ ๐?@A๏ฟฝ \ = ๐(๐V.๏ฟฝ๏ฟฝ\X)
๐3 = ๐ด3,3 + ๐ดV,V โ ๐ต3,3 + ๐ตV,V๐V = ๐ดV,3 + ๐ดV,V โ ๐ต3,3๐6 = ๐ด3,3 โ ๐ต3,V โ ๐ตV,V๐X = ๐ดV,V โ ๐ตV,3 โ ๐ต3,3๐๏ฟฝ = ๐ด3,3 + ๐ด3,V โ ๐ตV,V๐๏ฟฝ = ๐ดV,3 โ ๐ด3,3 โ ๐ต3,3 + ๐ต3,V๐\ = ๐ด3,V โ ๐ดV,V โ ๐ตV,3 + ๐ตV,V
Faster Matrix Multiplication
matrix of rank 1: outer product of two vectors
(๐, ๐)
(๐Q , ๐Q)
(๐QQ , ๐QQ)
tensor = 3-dimensional matrix
matrix multiplication tensor:๐V rows/columns/...entries in {0,1}entry ๐ +,, , +๏ฟฝ ,/๏ฟฝ , /๏ฟฝ๏ฟฝ ,,๏ฟฝ๏ฟฝ = 1
iff ๐ = ๐โฒ and ๐ = ๐QQ and ๐Q = ๐QQ
i.e. ๐ด+๏ฟฝ,/๏ฟฝ โ ๐ต/๏ฟฝ๏ฟฝ ,,๏ฟฝ๏ฟฝ appears in ๐ถ+,,
matrix of rank ๐: sum of ๐ rank-1-matrices
tensor of rank 1: outer product of three vectorstensor of rank ๐: sum of ๐ rank-1-tensors
matrix rank is in P
tensor rank is not known to be in P
Faster Matrix Multiplication
(๐, ๐)
(๐Q , ๐Q)
(๐QQ , ๐QQ)
tensor = 3-dimensional matrix
matrix multiplication tensor:๐V rows/columns/...entries in {0,1}entry ๐ +,, , +๏ฟฝ ,/๏ฟฝ , /๏ฟฝ๏ฟฝ ,,๏ฟฝ๏ฟฝ = 1
iff ๐ = ๐โฒ and ๐ = ๐QQ and ๐Q = ๐QQ
i.e. ๐ด+๏ฟฝ,/๏ฟฝ โ ๐ต/๏ฟฝ๏ฟฝ ,,๏ฟฝ๏ฟฝ appears in ๐ถ+,,
Strassen: rank of MM-tensor for ๐ = 2 is at most 7
any bound on rank of MM-tensor can be transformed into a MM-algorithm
thus search for faster MM-algorithms is a mathematical question
this is complete: one can find ๐by analyzing tensor rank!
Outline
1) Relations to Subcubic Equivalences
2) Strassenโs Algorithm
3) Sliding Window Hamming Distance
4) Node-Weighted Negative Triangle
5) Context-Free Grammars
Sliding Window Hamming Distance
given two strings: text ๐ of length ๐ and pattern ๐ of length ๐ < ๐
compute for each ๐ the Hamming distance of ๐ and ๐[๐. . ๐ + ๐ โ 1]
best known algorithm:
๐(๐ ๐polylog๐)
a b c b b c a ab b c a
b b c ab b c a
b b c ab b c a
23302
Thm: Sliding Window Hamming Distance has no๐(๐G/VNI) algorithm or combinatorial ๐(๐3.๏ฟฝNI) algorithm
unless the BMM-Hypothesis fails
โ ๐(๐3.3๏ฟฝ)
โค ๐(๐3.๏ฟฝ๏ฟฝ๏ฟฝ3)
Open Problem: get rid of โcombinatorialโor design improved algorithm using MM
[Indyk,Porat,Cliffordโ09]
Sliding Window Hamming Distancegiven two strings: text ๐ of length ๐ and pattern ๐ of length ๐ < ๐compute for each ๐ the Hamming distance of ๐ and ๐[๐. . ๐ + ๐ โ 1]
1 0 01 1 10 1 1
1 1 01 0 10 1 1
โ = ?
๐ด ๐ต
1 x x1 2 3x 2 3
1 1 y2 y 2y 3 3
pattern = concat rows:
$ $ $ $ $ $ 1 2 y $ 1 y 3 $ y 2 3 $ $ $ $ $ $
text = concat columns + padding:
1 x x 1 2 3 x 2 3
1 x x 1 2 3 x 2 3
alphabet: {1,2,...,๐,x,y,$}
Sliding Window Hamming Distance
$ $ $ $ $ $ 1 2 y $ 1 y 3 $ y 2 3 $ $ $ $ $ $1 x x 1 2 3 x 2 3
1 x x 1 2 3 x 2 31 x x 1 2 3 x 2 3
1 x x 1 2 3 x 2 31 x x 1 2 3 x 2 3
1 x x 1 2 3 x 2 31 x x 1 2 3 x 2 3
1 x x 1 2 3 x 2 31 x x 1 2 3 x 2 3
1 0 01 1 10 1 1
1 1 01 0 10 1 1
โ =1 1 01 1 11 1 1
put a 1 if there isat least one match
Sliding Window Hamming Distance
given Boolean ๐ร๐-matrices ๐ด, ๐ต
we construct text+pattern of length ๐(๐V) (in time ๐ ๐V )
thus, an ๐(๐G/VNI) algorithm for Sliding Window Hamming Distancewould yield an ๐(๐GNVI) algorithm for BMM, contradicting BMM-Hypothesis
Thm: Sliding Window Hamming Distance has no๐(๐G/VNI) algorithm or combinatorial ๐(๐3.๏ฟฝNI) algorithm
unless the BMM-Hypothesis fails
and an ๐(๐3.๏ฟฝNI) combinatorial algorithm for Sliding Window Hamming Dist.would yield an ๐(๐6NVI) combinatorial algorithm for BMM
Outline
1) Relations to Subcubic Equivalences
2) Strassenโs Algorithm
3) Sliding Window Hamming Distance
4) Node-Weighted Negative Triangle
5) Context-Free Grammars
Node-Weighted Negative Triangle
given a directed graph with weights ๐ค+,, on edges, is there a triangle ๐, ๐, ๐: ๐ค, ,+ + ๐ค+,/ + ๐ค/,, < 0?
(Edge-Weighted) Negative Triangle
Node-Weighted Negative Triangle
Triangle
given a directed graph with weights ๐ค+ on nodes, is there a triangle ๐, ๐, ๐: ๐ค+ +๐ค, + ๐ค/ < 0 ?
given an unweighted undirected graph,is there a triangle?
๐(๐6)
๐(๐G)
๐ค+ โ โ1
Node-Weighted Negative Triangle
(Edge-Weighted) Negative Triangle
Node-Weighted Negative Triangle
Triangle
๐(๐6)
๐(๐G)
find appropriate edge weights thatsimulate the given node weights:
set ๐ค+,, โ (๐ค+ +๐ค, )/2
then for a triangle ๐, ๐, ๐:
๐ค,,+ + ๐ค+,/ + ๐ค/ ,, = ๐ค+ +๐ค, + ๐ค/
Node-Weighted Negative Triangle
(Edge-Weighted) Negative Triangle
Node-Weighted Negative Triangle
Triangle
๐(๐6)
๐(๐G)
๐(๐G) [Czumaj,Lingasโ07]
actually for Node-Weighted Minimum Weight Triangle
Node-Weighted Minimum Weight Triangle
we can assume that the graph is tripartite:
๐บ:
๐
๐บQ:
๐3
๐ข
๐ฃ ๐V
๐6
๐ข3
๐ฃ3
๐ขV
๐ฃV ๐ข6
๐ฃ6
triangle ๐, ๐, ๐ triangle ๐3,๐V, ๐6โบ
Node-Weighted Minimum Weight Trianglegiven graph ๐บ = (๐, ๐ธ)with ๐ = ๐ผ โช ๐ฝ โช ๐พ and node weights ๐ค๏ฟฝ , compute minimum weight ๐ s.t. there are ๐ โ ๐ผ, ๐ โ ๐ฝ, ๐ โ ๐พ with ๐, ๐ , ๐, ๐ , ๐, ๐ โ ๐ธ and ๐ค+ +๐ค, +๐ค/ = ๐
- parameter ๐ (=sufficiently large constant)- assume๐ โ ๐ผ = ๐ฝ = ๐พ = ๐โ for some โ โ โ
(add isolated dummy vertices)
- assume that ๐ผ, ๐ฝ, ๐พ are sorted by weight
Node-Weighted Minimum Weight Trianglegiven graph ๐บ = (๐, ๐ธ)with ๐ = ๐ผ โช ๐ฝ โช ๐พ and node weights ๐ค๏ฟฝ , compute minimum weight ๐ s.t. there are ๐ โ ๐ผ, ๐ โ ๐ฝ, ๐ โ ๐พ with ๐, ๐ , ๐, ๐ , ๐, ๐ โ ๐ธ and ๐ค+ +๐ค, +๐ค/ = ๐
- parameter ๐ (=sufficiently large constant)- assume๐ โ ๐ผ = ๐ฝ = ๐พ = ๐โ for some โ โ โ
(add isolated dummy vertices)
- assume that ๐ผ, ๐ฝ, ๐พ are sorted by weight
ALG(G):
1) split ๐ผ = ๐ผ3 โชโฏโช ๐ผยฅ, ๐ฝ = ๐ฝ3 โชโฏโช ๐ฝยฅ, ๐พ = ๐พ3 โชโฏโช ๐พยฅ(in sorted order: max๐ค(๐ผn) โค min๐ค(๐ผnH3) and so on)
2) ๐ โ ๐ฅ,๐ฆ, ๐ง โ 1, โฆ , ๐ 6 ๐บ ๐ผn โช ๐ฝo โช ๐พp containsatriangle}
3) for each ๐ฅ,๐ฆ, ๐ง
run ALG(๐บ ๐ผn โช ๐ฝo โช ๐พp )
๐ผn
๐ผ ๐พp
๐พ
๐ฝo
๐ฝ
0) if ๐ = ๐(1) then solve in constant time
3) for each ๐ฅ,๐ฆ, ๐ง โ ๐ s.t. there is no ๐ฅQ,๐ฆQ, ๐งQ โ ๐ with ๐ฅQ < ๐ฅ, ๐ฆQ < ๐ฆ, ๐งQ < ๐ง
Node-Weighted Minimum Weight Triangle
Correctness:
3) for each ๐ฅ,๐ฆ, ๐ง โ ๐ s.t. there is no ๐ฅQ,๐ฆQ, ๐งQ โ ๐ with ๐ฅQ < ๐ฅ, ๐ฆQ < ๐ฆ, ๐งQ < ๐ง
if there is no triangle in ๐บ ๐ผn โช ๐ฝo โช ๐พp then we can ignore it
run ALG(๐บ ๐ผn โช ๐ฝo โช ๐พp )
if ๐ฅ,๐ฆ, ๐ง โ ๐ is dominated by ๐ฅQ,๐ฆQ, ๐งQ โ ๐ :
let ๐, ๐, ๐ be a triangle in ๐บ ๐ผn โช ๐ฝo โช ๐พp , and ๐โฒ, ๐โฒ, ๐โฒ a triangle in ๐บ ๐ผn๏ฟฝ โช ๐ฝo๏ฟฝ โช ๐พp๏ฟฝ
then ๐ค+ + ๐ค, + ๐ค/ โฅ min๐ค(๐ผn) +min๐ค(๐ฝo)+ min๐ค(๐พp)
and ๐ค+๏ฟฝ + ๐ค,๏ฟฝ + ๐ค/๏ฟฝ โค max๐ค(๐ผn๏ฟฝ ) +max๐ค(๐ฝo๏ฟฝ ) + max๐ค(๐พp๏ฟฝ )
so we can safely ignore ๐บ ๐ผn โช ๐ฝo โช ๐พp
โคโค โค
Node-Weighted Minimum Weight Trianglegiven graph ๐บ = (๐, ๐ธ)with ๐ = ๐ผ โช ๐ฝ โช ๐พ and node weights ๐ค๏ฟฝ , compute minimum weight ๐ s.t. there are ๐ โ ๐ผ, ๐ โ ๐ฝ, ๐ โ ๐พ with ๐, ๐ , ๐, ๐ , ๐, ๐ โ ๐ธ and ๐ค+ +๐ค, +๐ค/ = ๐
- parameter ๐ (=sufficiently large constant)- assume๐ โ ๐ผ = ๐ฝ = ๐พ = ๐โ for some โ โ โ
(add isolated dummy vertices)
- assume that ๐ผ, ๐ฝ, ๐พ are sorted by weight
ALG(G):
1) split ๐ผ = ๐ผ3 โชโฏโช ๐ผยฅ, ๐ฝ = ๐ฝ3 โชโฏโช ๐ฝยฅ, ๐พ = ๐พ3 โชโฏโช ๐พยฅ(in sorted order: max ๐ผn โค min ๐ผnH3 aso.)
2) ๐ โ ๐ฅ,๐ฆ, ๐ง โ 1, โฆ , ๐ 6 ๐บ ๐ผn โช ๐ฝo โช ๐พp containsatriangle}
3) for each ๐ฅ,๐ฆ, ๐ง โ ๐ s.t. there is no ๐ฅQ,๐ฆQ, ๐งQ โ ๐ with ๐ฅQ < ๐ฅ, ๐ฆQ < ๐ฆ, ๐งQ < ๐ง
run ALG(๐บ ๐ผn โช ๐ฝo โช ๐พp )
๐(๐6๐G)
size ๐/๐
how many iterations?
๐ผn
๐ผ ๐พp
๐พ
๐ฝo
๐ฝ
0) if ๐ = ๐(1) then solve in constant time
Node-Weighted Minimum Weight Triangle
How many iterations?
3) for each ๐ฅ,๐ฆ, ๐ง โ ๐ s.t. there is no ๐ฅQ,๐ฆQ, ๐งQ โ ๐ with ๐ฅQ < ๐ฅ, ๐ฆQ < ๐ฆ, ๐งQ < ๐ง
define ฮยฎ,r โ ๐ฅ, ๐ฆ, ๐ง โ 1,โฆ ,๐ 6 ๐ฅ โ ๐ฆ = ๐and๐ฅ โ ๐ง = ๐ }
for ๐, ๐ โ {โ๐, โฆ ,๐}
the sets ฮยฎ,r cover 1, โฆ ,๐ 6
line 3) applies to at most one (๐ฅ,๐ฆ, ๐ง)in ฮยฎ,r for any ๐, ๐ !
hence, there are at most (2๐)V= 4๐V recursive calls to ALG
= 1,1 โ ๐,1 โ ๐ , 2,2 โ ๐,2 โ ๐ , โฆ , ๐,๐ โ ๐, ๐ โ ๐ โฉ 1, โฆ , ๐ 6
recursion: ๐ ๐ โค 4๐V โ ๐ ๐/๐ + ๐(๐6๐G)
Node-Weighted Minimum Weight Trianglegiven graph ๐บ = (๐, ๐ธ)with ๐ = ๐ผ โช ๐ฝ โช ๐พ and node weights ๐ค๏ฟฝ , compute minimum weight ๐ s.t. there are ๐ โ ๐ผ, ๐ โ ๐ฝ, ๐ โ ๐พ with ๐, ๐ , ๐, ๐ , ๐, ๐ โ ๐ธ and ๐ค+ +๐ค, +๐ค/ = ๐
- parameter ๐ (=sufficiently large constant)- assume๐ โ ๐ผ = ๐ฝ = ๐พ = ๐โ for some โ โ โ
(add isolated dummy vertices)
- assume that ๐ผ, ๐ฝ, ๐พ are sorted by weight
ALG(G):
1) split ๐ผ = ๐ผ3 โชโฏโช ๐ผยฅ, ๐ฝ = ๐ฝ3 โชโฏโช ๐ฝยฅ, ๐พ = ๐พ3 โชโฏโช ๐พยฅ(in sorted order: max ๐ผn โค min ๐ผnH3 aso.)
2) ๐ โ ๐ฅ,๐ฆ, ๐ง โ 1, โฆ , ๐ 6 ๐บ ๐ผn โช ๐ฝo โช ๐พp containsatriangle}
3) for each ๐ฅ,๐ฆ, ๐ง โ ๐ s.t. there is no ๐ฅQ,๐ฆQ, ๐งQ โ ๐ with ๐ฅQ < ๐ฅ, ๐ฆQ < ๐ฆ, ๐งQ < ๐ง
run ALG(๐บ ๐ผn โช ๐ฝo โช ๐พp )
๐(๐6๐G)
size ๐/๐
๐ผn
๐ผ ๐พp
๐พ
๐ฝo
๐ฝ
0) if ๐ = ๐(1) then solve in constant time
recursion: ๐ ๐ โค 4๐V โ ๐ ๐/๐ + ๐(๐6๐G)
Node-Weighted Minimum Weight Triangle
recursion: ๐ ๐ โค 4๐V โ ๐ ๐/๐ + ๐(๐6๐G)
๐ ๐ โค 4๐V โ ๐ ๐/๐ + ๐ผ๐6๐G for some constant ๐ผ
want to show: ๐ ๐ โค 2๐ผ๐6๐G
plug in: ๐ ๐ โค 4๐V โ 2๐ผ๐6(๐/๐)G+๐ผ๐6๐G
= ๐ผ๐6๐G(1 + 8๐VNG)
assume ๐ > 2: โค 2๐ผ๐6๐G for a sufficiently large constant ๐
๐ ๐ โค ๐(๐G)so we have:
(if ๐ = 2: show that ๐ ๐ โค 2๐ผ๐6๐GHI)
in total: ๐ ๐ โค ๐(๐G + ๐VHI) for any ๐ > 0
In this lecture you learned that...
โฆ(B)MM is useful for designing theoretically fast algorithms
- Exercise: k-Clique in ๐(๐G//6)
no combinatorial ๐(๐6NI)
- Exercise: MaxCut in ๐(2G1/6poly(๐))- Node-Weighted Negative Triangle in ๐(๐G)
โฆBMM is an obstacle for practically fast / theoretically very fast algorithms
not faster than ๐(๐V.6\6)
- Exercise: pattern matching with 2 patterns
- Sliding Window Hamming Distance
- Transitive Closure has no ๐(๐GNI) / combinatorial ๐(๐6NI) algorithm
- context-free grammar problems
top related