Algorithms for hard Algorithms for hard problemsproblems
Parameterized complexity –Parameterized complexity –definitions, sample algorithmsdefinitions, sample algorithms
Juris Viksna, 2015
Parameterized complexity
Combinatorial "explosion" for NP-hard problems
[Adapted from R.Downey and M.Fellows]
Parameterized complexity
Parameterized complexity attempts to confinecombinatorial "explosion"
[Adapted from R.Downey and M.Fellows]
Parameterized complexity - Definitions
Definition (FPT)
A parametrized problem L ** is Fixed Parameter Tractable if there is an algorithm that for input (x,y) ** with |x| = k and |y| = n decides whether (x,y) L in time f(k) n ,where f is an arbitrary function and is a constant.
Definition does not change iff(k) n
is replaced byf(k) + n (!)
Parameterized complexity - Definitions
Mk for every n solves the problem in time f(k) n
For each k there is a constant ck, such that f(k) n > n + 1 for n ck
M'k: - simulates Mk for n ck
- looks up value from the table for n ck
M'k solves the problem in time f(k) ck + n a+1
Some parameterized problemsVERTEX COVER
Instance: A graph G=(V,E) Parameter: A positive integer k
Question: Is there a subset SV, such that |S|=k and for all{x,y}E either xS or yS?
[Adapted from R.Downey and M.Fellows]
Some parameterized problemsGRAPH GENUS
Instance: A graph G=(V,E)Parameter: A positive integer k
Question: Does graph G have genus k?
[Adapted from R.Downey and M.Fellows]
Some parameterized problemsGRAPH LINKING NUMBER
Instance: A graph G=(V,E) Parameter: A positive integer k
Question: Can G be embedded in 3-space such that the maximum size of a collection of topologically linked disjoint cycles is bounded by k?
[Adapted from R.Downey and M.Fellows]
Some parameterized problemsVERTEX COVER:
A single algorithm running in time 2k |G| for each k [Downey and Fellows 1992]
GRAPH GENUS:
A single algorithm which for each fixed k determines whether graph G has genus k in time O(|G|3) [Fellows and Langston 1988]
GRAPH LINKING NUMBER:
For each k there is an algorithm k, which determineswhether graph G has linking number k in time O(|G|3)[Fellows and Langston 1988]
Parameterized complexity - Definitions
A problem L is uniformly FPT, if there is an algorithm , a constant c and a function f, such that:
- the running time of (‹x,k›) is at most f(k)|x|c
- ‹x,k›A iff (‹x,k›) = 1.
A problem L is strongly uniformly FPT, if L is uniformlyFPT via some and f, such that f is recursive.
A problem L is nonuniformly FPT if there is a constant c, afunction f and a collection of algorithms {k}kN, such thatfor each k:
- the running time of k(‹x,k›) is at most f(k)|x|c
- ‹x,k›A iff k(‹x,k›) = 1.
"klam" values
Algorithms for VERTEX COVER:
• O(f(k) n3) [Fellows, Langston 1986]
• O(f(k) n2) [Johnson, 1987]
Tower of 2's of height described by tower of 2's of height
described by tower of 2's... (impractical even for k = 1 :)
22500k
FPT if solvable in time f(k)+nc
klam value - the largest k for whichf(k) is less that some universal"speed limit" U (e.g. U= 1020)
[Adapted from R.Downey and M.Fellows]
Parameterized complexity
• Parametrized tractability (methods for constructing FPT algorithms)
• Parametrized intractability (how to "prove" that there are no FPT algorithm for a given
problem)
Bounded search tree methods
• First, construct a search space (tree), such that the sizesearch space depends only from parameter k
• Then run some relatively efficient algorithm (say DFS)on each branch of the tree
For fixed k search space is of constant size, thus weobtain a FPT algorithm
Bounded search tree methods - Vertex cover
, G
{v1}, G-{v1}{u1}, G-{u1}
{v1,v2}, G-{v1,v2}{v1,u2}, G-{v1,u2}{u2,v2}
{u1,v1}
k+1
Theorem [Downey and Fellows 1992]
VERTEX COVER is solvable in time O(2k |V(G)|).
By considering only graphs with vertices of degree 3 or higher, itis possible to shrink search space from 2k to (51/4)k
[Balasubramanian et al 1997]
Kernel methods
The main idea of the reduction to problem kernel is toreduce a problem instance I to an equivalent instance I',where the size of I' is bounded by some function of theparameter k.
The instance I' is then exhaustively analyzed, and a solution for I' lifted to a solution to I.
Usually this will give and additive rather that multiplicative f(k) exponential factor
Kernel methods - Vertex coverTheorem [Buss 1989]
VERTEX COVER is solvable in time O((2k)k + k |V(G)|). ObservationAny vertex of degree greater than k must belong to every k-elementvertex cover.
Step 1Locate all vertices in G of degree greater than k; let p equal the number of such vertices. If p > k, there is no k-vertex cover. Otherwise let k' = k – p.
Step 2Discard all vertices found in step 1 and the edges incident to them. If the resulting graph G' has more than k'(k+1) vertices, reject.
Kernel methods - Vertex coverObservationAny vertex of degree greater than k must belong to every k-elementvertex cover.
Step 1Locate all vertices in G of degree greater than k; let p equal the number of such vertices. If p > k, there is no k-vertex cover. Otherwise let k' = k – p.
Step 2Discard all vertices found in step 1 and the edges incident to them. If the resulting graph G' has more than k'(k+1) vertices, reject.
Step 3If G' has no k'-vertex cover, reject. Otherwise, any k'-vertex cover of G' plus the p vertices from step 1 constitutes a k-vertex cover for G.
Graph with k' vertex cover and vertex degree bounded by k has up to k'(k+1) vertices
Doable in O((2k)k) time
Kernel methods - Vertex cover
Kernel method
O((2k)k + k |V(G)|)
Search tree method
O(2k |V(G)|) O((51/4)k |V(G)|)
If we use reduction to problem kernel first, and thenapply search tree method to problem kernel, we improveadditive bounds to:
O(kn + 2kk2) [Balasubramanian et al 1992]
O(kn + ((51/4)kk2) [Balasubramanian et al 1992]
Closest string problem
Closest string problem
Closest string problem