Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parameterized algorithms and their applications

Similar presentations


Presentation on theme: "Parameterized algorithms and their applications"— Presentation transcript:

1 Parameterized algorithms and their applications
Juris Viksna Riga, IMCS

2 Approaches to NP-hard problems
Branch-and-bound algorithms Heuristic methods Approximation algorithms Probabilistic algorithms Pseudo-polynomial algorithms Parameterized algorithms

3 Parameterized complexity
Combinatorial "explosion" for NP-hard problems. Parameterized complexity attempts to confine combinatorial "explosion“. [Adapted from R.Downey and M.Fellows]

4 Parameterized complexity - Definitions
Definition (FPT) A parameterized 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 (independent of k). Definition does not change if f(k) n is replaced by f(k) + n (!!!) [Adapted from R.Downey and M.Fellows]

5 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 ) + na+1

6 Some parameterized problems
VERTEX COVER Instance: A graph G=(V,E) Parameter: A positive integer k Question: Is there a subset SV, such that |S|=k and for all {x,y}E either xS or yS? NP-complete simple 2-approximation algorithm 2-(1/(log n)1/2)-approximation algorithm is known there is O(1.2738k n) parameterized algorithm (this could be practical for values of k up to 80–90) [Adapted from R.Downey and M.Fellows]

7 Algorithms for Vertex Cover
O(f(k) n3) [Fellows, Langston, 1986] O(f(k) n2) [Johnson, 1987] O(2k n) (polynomial for k=O(log n)) [Fellows, 1988] O(kn + 2k k2k+2) [Buss, 1989] O(kn + 2k k2) [Balasubramanian et al, 1992] O(3k n) [Papadimitriu, 1993] O(kn + (4/3)k k2) [Balasubramanian et al, 1996] O(1.2738k n) [Dinur, Safra, 2005]

8 Some parameterized problems
VERTEX COVER Instance: A graph G=(V,E) Parameter: A positive integer k Question: Is there a subset SV, such that |S|=k and for all {x,y}E either xS or yS? [Adapted from R.Downey and M.Fellows]

9 Some parameterized problems
GRAPH 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]

10 Some parameterized problems
GRAPH 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]

11 Some parameterized problems
VERTEX COVER: A single algorithm G running in time 2k |G| for each k [Downey and Fellows 1992] GRAPH GENUS: A single algorithm F, 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 determines whether graph G has linking number k in time O(|G|3) [Adapted from R.Downey and M.Fellows]

12 How to construct a parameterized algorithm?
Bounded Search Tree methods Construct a search space (tree), such that the size search space depends only from parameter k. Run some relatively efficient algorithm (say DFS) to traverse the tree. Kernel methods Reduce a problem instance I to an equivalent instance I', where the size of I' is bounded by some function of the parameter k. Use exhaustive search to solve instance I', then lift a solution for I' to a solution to I.

13 Bounded search tree methods – Vertex Cover
, G {u1,v1} {u1}, G-{u1} {v1}, G-{v1} k+1 {u2,v2} {v1,u2}, G-{v1,u2} {v1,v2}, G-{v1,v2} By considering only graphs with vertices of degree 3 or higher, it is possible to shrink search space from 2k to (51/4)k [Balasubramanian et al 1997] Theorem [Downey and Fellows 1992] VERTEX COVER is solvable in time O(2k |V(G)|).

14 Kernel methods – Vertex Cover
Theorem [Buss 1989] VERTEX COVER is solvable in time O((2k)k + k |V(G)|). Observation Any vertex of degree greater than k must belong to every k-element vertex cover. Step 1 Locate all vertices in G of degree greater than k; let p equal the number of such vertices. If k < p, there is no k-vertex cover. Otherwise let k' = p – k. Step 2 Discard 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.

15 Kernel methods – Vertex Cover
Observation Any vertex of degree greater than k must belong to every k-element vertex cover. Step 1 Locate all vertices in G of degree greater than k; let p equal the number of such vertices. If k < p, there is no k-vertex cover. Otherwise let k' = p – k. Step 2 Discard 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 3 If 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

16 Algorithms for Vertex Cover
Kernel method O((2k)k + k n) Search tree method O(2k n) O((51/4)k n) If we use reduction to problem kernel first, and then apply search tree method to problem kernel, we improve additive bounds to: O(kn + 2kk2) [Balasubramanian et al 1992] O(kn + ((51/4)kk2) [Balasubramanian et al 1992]

17 Quasi orderings Let S be a set and  a binary relation defined on set S. S, is quasi ordering, if for all x,y,zS: xx (reflexivity) xy and yz  xz (transitivity)

18 Quasi orderings - terminology
Let S, be a quasi ordering. Let a0,a1,... be a sequence of elements of S. a0,a1,... is chain if ij  ai aj a0,a1,... is antichain if ij  ai | aj a0,a1,... is infinite decreasing sequence if ij  ai> aj (i.e. ai aj and ai ≰ aj )

19 Quasi orderings - terminology
S' S - filter if xS' and yx  yS' F(A)={yS | xA: xy} - filter generated by A S' S - ideal if xS' and yx  yS' I(A)={yS | xA: xy} - ideal generated by A If F is a filter then S–F is an ideal and vice versa A filter S' is finitely generated if S'=F(A) for a finite set A S. S, has a finite basis property if F(A) is finitely generated for all AS.

20 WQO (Well-quasi ordering)
A quasi ordering S, is well-quasi ordering (WQO) if any of the following holds: every infinite sequence x1,x2,... of S contains an infinite chain; for every infinite sequence x1,x2,... of S there are indices i and j such that i < j and xi  xj; [simplest to verify] there are no infinite antichains or infinite decreasing sequences; S, has a finite basis property [most useful]

21 Examples of WQO N, is WQO under usual order relation .
For each x1,x2,... i,j: i < j and xi  xj S, is WQO for each finite set and equality relation . Each infinite sequence x1,x2,... will contain at least one repeated element xi Other examples?

22 Higman’s Lemma Higman’s Lemma
Let S be a finite set and S* be a set of all finite sequences of elements of S. Let  be defined on set S* as follows: v  w  v is a subsequence of w. Then S*, is WQO.

23 Higman’s Lemma Higman's Lemma - the idea of proof:
assume (S*,) is not WQO let w1,w2,... be the smallest infinite antichain there is aS, such that infinite number of wi's starts with a let the sequence of these wi's be wi1,wi2,... denote wij with the first symbol a removed by w'ij then w1,...,wi1-1,w'i1,w'i2,... is antichain and smaller than the smallest one (!!!)

24 Ordering relations on graphs
Subgraph relation: A graph H=(V1,E1) is a subgraph of G=(V2,E2) if there is an injective mapping : V1  E1, such that {x,y}E1  {(x), (y)}E2. H S G  H is a subgraph of G. S S

25 Ordering relations on graphs
Topological embedding relation: For a graph G let P(G) denote a set of all simple paths in G. A graph H=(V1,E1) is topologically embedded in G=(V2,E2) if there is an mapping : E1  P(G), such that for all pairs of distinct edges e1,e2E1 the corresponding paths (e1) and (e2) are vertex-disjoint. H T G  there is a topological embedding of H in G. Kuratowski Theorem Graph G is planar  K5 ≰T G and K3,3 ≰T G.

26 Ordering relations on graphs
Graph minor relation: A graph H=(V1,E1) is a minor of G=(V2,E2) if H is a subgraph of graph G' obtained from G by a sequence of edge contractions. H M G  H is minor of G. K4 M K3,3 Edge contraction

27 Ordering relations on graphs
Graph immersion relation: A graph H=(V1,E1) is immersion in G=(V2,E2) if there is an mapping : E1  P(G), such that for all pairs of distinct edges e1,e2E1 the corresponding paths (e1) and (e2) are edge-disjoint. H I G  H is immersion in G. I

28 Ordering relations on graphs
Are any of these orderings WQO? subgraph relation S is not WQO topological embedding T is not WQO ...... ......

29 Ordering relations on graphs
graph minor relation M is WQO graph immersion relation I is WQO Theorem [N.Robertson, P.Seymour] Every infinite set of graphs contains two graphs such that one is a minor of another. Every infinite set of graphs contains two graphs such that one is immersed in another. The proof is spread over 23 articles published in Journal of Algorithms from 1983 to 2009 

30 Graph minor theorem

31 Testing graph minor and immersion properties
MINOR ORDER TEST is FPT-solvable in time O(n3) [Robertson and Seymour 1995] IMMERSION ORDER TEST is FPT-solvable in polynomial time poly(n) [Fellows and Langston 1988]

32 WQO and graph planarity
Instance: Graph G=(V,E) Question: Is G planar? Observation If G is planar and H M G, then H is planar. Conversely: G is non-planar, G M H  H is non-planar. Thus a set N of non-planar graphs is a filter and since M is WQO, N has a finite basis B. To show that graph G is planar it suffices to show H ≰M G that for all GB. Graph planarity is in P However, Graph Minor Theorem is intrinsically nonconstructive – there is no algorithm, which for a given filter computes its basis...

33 WQO and graph planarity
Instance: Graph G=(V,E) Question: Is G planar? Kuratowski theorem {K3,3, K5} is an obstruction set for the ideal of planar graphs under M ordering. This already gives a concrete P-time algorithm for graph planarity problem [Adapted from R.Downey and M.Fellows]

34 For fixed k GRAPH GENUS is in P
WQO and Graph Genus For fixed k GRAPH GENUS is in P GRAPH GENUSFPT GRAPH GENUS Instance: A graph G=(V,E) Parameter: A positive integer k Question: Does graph G have genus k? A set of graphs Sk with genus > k is a filter with respect to ordering M  Sk has finite basis  for each k we have polynomial algorithm to check Sk membership

35 For fixed k VERTEX COVER is in P
WQO and Vertex Cover VERTEX COVER Instance: A graph G=(V,E) Parameter: A positive integer k Question: Is there a subset SV, such that |S|=k and for all {x,y}E either xS or yS? If G has vertex cover of size k and H M G,then H has vertex cover of size k. Thus a set of graphs having vertex cover of size > k is a filter. For fixed k VERTEX COVER is in P VERTEX COVERFPT

36 Self reduction HAMILTONICITY Instance: A graph G=(V,E)
Question: Does graph G has a Hamiltonian cycle? Assuming we have an efficient oracle which for a given graph answers yes/no to the above decision problem, if the answer is yes we can also efficiently find a Hamiltonian cycle as follows: for each eE: if G with e removed still has Hamiltonian cycle, remove e from G The edges that will be left in E will form a Hamiltonian cycle.

37 Self reduction Assume that to prove the existence of a parameterized algorithm for deciding membership to F we have used WQO method – i.e. we know that there exists a finite basis B for F complement. In certain cases this still allows us to obtain a concrete algorithm! For given input x: start with B= check whether there exists yB with y  x if such y exists the answer is no otherwise try to self-reduce, if solution is found the answer is yes if solution isn’t found, generate the next element from complement of F that doesn’t have a minor in B, add it to B and go to Step 1.

38 Can other WQO relations also be used for this?
Thus we can use the fact that M is WQO to prove the existence of parameterized algorithms Can other WQO relations also be used for this?

39 Some known WQO relations
H S G  H T G H T G  H M G not comparable H T G  H I G WQO on sequences? S*, WQO (the one we used in Higman’s lemma) WQO on directed graphs? - problem seems to be even much more complicated than for M or I - some alternative “minor” relations can be defined - few results about WQO for special classes of digraphs – e.g. class of all tournaments (complete directed graphs) is WQO [M.Chudnovsky, R.Seymour, 2010]

40 WQO and Closest String CLOSEST STRING
Instance: A set of strings s1,..,sk over finite alphabet  of length n each Parameter: Positive integers k and d Question: Find a string s such that d(s,si)d for all i=1,...,k Can be solved in time O(kn +kdd+1) (simple kernel algorithm [Gramm et al]) There is a parameterized algorithm deciding whether such string s exist due to (slightly generalized) Higman’s lemma

41 Graph treewidth Definition
The class of k-trees is the smallest set of graphs satisfying the following conditions: Kk+1 is a k-tree; if G is a k-tree and H is a subgraph of G isomorphic to Kk, then the graph G' constructed from G by first adding a new vertex v to G and then adding edges to make H{v} a copy of Kk+1, is a k-tree. If G is a subgraph of k-tree, and isn’t a subgraph of k1-tree then G is called a partial k-tree.

42 Examples of k-trees [Adapted from R.Downey and M.Fellows]

43 Graph treewidth Definition A tree-decomposition of a graph G=(V,E) is a tree T each vertex x of which is labeled by a set Tx  V and the following conditions hold: for every {v,w}E there is x with v,w Tx. for every vV and every x,y: v Tx and v Ty there is a path between x and y in T. A treewidth tw(G) of graph G is the smallest k for which there exists a tree decomposition T of G with | Tx |  k+1 for every x. tw(G) is defined equal to k and not k+1 with the purpose to have tw(G) = 1 for trees.

44 Tree decomposition - example
Graph treewidth [Adapted from J.Blum and M.Grohe]

45 Graph treewidth Tree Clique Grid tw = 1 tw = k tw = k Theorem
G is a partial k-tree  tw(G)=k. Tree Clique Grid tw = tw = k tw = k

46 Computing graph treewidth
p(k) = 32k3  Although the algorithm is simple and constructive, it is still non-practical and exhaustive search nk methods work better. Theorem Each tree decomposition T of graph G=(V,E) can be transformed into a tree decomposition T' with at most |V| vertices in time O(|V|). [Adapted from J.Blum and M.Grohe]

47 tw(G) as a parameter 3-COLOURABILITY Instance: A graph G=(V,E)
Parameter: tw(G) Question: Can vertices of G be coloured in 3 colours in such a way that all adjacent vertices have different colours? DP on tree decompositions Do exhaustive search to find all colourings compatible with vertex and both of its children Do exhaustive search to find all compatible colourings of leaves Do exhaustive search to find all compatible colourings of leaves

48 tw(G) as a parameter HAMILTONICITY Instance: A graph G=(V,E)
Parameter: tw(G) Question: Does G have a Hamiltonian cycle? Can also by solved in time O(f(tw(G)) n) by dynamic programming on tree decomposition of G.

49 Myhill-Nerode theorem
 – a finite set; L – language over * Definition (right congruence) (v L w)  (for all z *: vzL  vzL) Definition L has finite index, if it has only a finite number of equivalence classes with respect to L. Myhill-Nerode Theorem L is finite state  L has finite index. L={anbn: n>1} is not regular since an ≁ L am for mn.

50 Myhill-Nerode theorem
U – a set of t-boundary graphs with tw = t. FU. Definition (right congruence) (G1 F G2)  (for all HU: G1 ⊕HF  G2 ⊕H F) Definition F has finite index, if it has only a finite number of equivalence classes with respect to F. Analog of Myhill-Nerode Theorem for treewidth t graphs F is t-finite state  F has finite index. G⊕H 1 2 t The fact that F is t-finite state here is not a property of graphs, but of so called parse-trees. There exists a tree-automata that decides whether a graph for which a parse tree is given belongs to F. This implies that there is O(f(t) n) algorithm for deciding F membership (!!!)

51 Parse trees of graphs [Adapted from R.Downey, M.Fellows]

52 Test sets and Hamiltonicity
F – set of all graphs with tw = 4 having Hamiltonian cycle. Every graph with tw = 4 is F equivalent to one of the graphs shown right. [Adapted from R.Downey, M.Fellows]

53 Cutwidth Graph with cutwidth k has tw = k,
Class of cutwidth k graphs also has finite index  problem is FPT. [Adapted from H.Bodlaender]

54 Bandwidth Graph with bandwidth k has tw = k.
However class of bandwidth k graphs doesn’t have finite index... In this case we want the maximal length of arcs as small as possible [Adapted from H.Bodlaender]

55 From WQO and treewidth methods to the “Real World” 
A “nice” approach to a problem: Use either WQO method to show that a parameterized algorithm exists or treewidth based method to find such algorithm (which however will be completely impractical). In case of success try to design a more practical one. Theorem [M.Frick, M.Grohe] For each positive integer d there is a problem for which a parameterized algorithm exists with running time O(f(k) n), however unless P=NP: ...k d f(k) > 2kkk 

56 Applications of parameterized algorithms to problems in bioinformatics?

57 Protein structure comparison
One approach to protein structure comparison is to use a simplified representation of them in a form of vertex ordered-graphs. A graph with n vertices is vertex-ordered, if its vertex set is {1,...,n}. Subgraph isomorphism problem for vertex ordered graphs Decide whether H is isomorphic to a subgraph of G, if isomorphism function additionally has to satisfy condition: i < j  (i) < (j). O(9k n2) algorithm for cutwidth k graphs [P.Evans, 1999] Heuristic isomorphism algorithm for vertex-ordered graphs [J.Viksna, D.Gilbert, 2001]

58 Phylogenetic trees Phylogenetic trees can be constructed either for species, or for proteins, genes etc.

59 Phylogenetic trees There are number of parameterized algorithm for the problems of phylogenetic tree construction, comparison etc. Perfect Phylogeny Problem Given nm character matrix M for n taxa and m characters, find a minimum number of flips (01) in M that produces perfect phylogeny matrix M'. Perfect phylogenetic tree – a tree with all vertices labeled with 0 or 1 for each of m characters in such a way that for each character there is at most a single edge on which its value has changed from 0 to 1 or vice versa. O(4.42k + poly(m, n)) algorithm [S.Bocker et al, 2009]

60 Multiple sequence alignment
LONGEST COMMON SUBSEQUENCE Instance: A set of sequences s1,..,sk over finite alphabet  of length n each Parameter: Positive integers Question: Find a longest sequence s such for all i=1,...,k sequence s is a subsequence of si. Dynamic programming: O(nk) The problem is W[1]-hard  [K.Pietrzak, 2002] FPT, if parameterized by length  of sequence s

61 Pathways in molecular interaction networks
Deterministic O(dkn) algorithm (where k is length of path) [J.Scott et al, 2006] d however is very large  Probabilistic O(4kn) algorithm [S.Lu et al, 2009] Problems of (approximately) the following form For given vertices x,y,A,B is there a simple path of the form: x... A ... B ... y?

62 Parameterized intractability
[Adapted from J.Blum and M.Grohe] Parameterized intractability

63 Thank you for your attention!


Download ppt "Parameterized algorithms and their applications"

Similar presentations


Ads by Google