Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parameterized algorithms and their applications Juris Viksna Riga, IMCS.

Similar presentations


Presentation on theme: "Parameterized algorithms and their applications Juris Viksna Riga, IMCS."— 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 [Adapted from R.Downey and M.Fellows] Combinatorial "explosion" for NP-hard problems. Parameterized complexity attempts to confine combinatorial "explosion“.

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 M k for every n solves the problem in time f(k) n  For each k there is a constant c k, such that f(k) n  < n  + 1 for n  c k M' k :- simulates M k for n  c k - looks up value from the table for n  c k M' k solves the problem in time (f'(k) = c k ) + n a+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? [Adapted from R.Downey and M.Fellows] NP-complete simple 2-approximation algorithm 2-  (1/(log n) 1/2 )-approximation algorithm is known there is O(1.2738 k n) parameterized algorithm (this could be practical for values of k up to 80–90)

7 Algorithms for Vertex Cover O(f(k) n 3 ) [Fellows, Langston, 1986] O(f(k) n 2 ) [Johnson, 1987] O(2 k n) (polynomial for k=O(log n)) [Fellows, 1988] O(kn + 2 k k 2k+2 ) [Buss, 1989] O(kn + 2 k k 2 ) [Balasubramanian et al, 1992] O(3 k n) [Papadimitriu, 1993] O(kn + (4/3) k k 2 ) [Balasubramanian et al, 1996] O(1.2738 k 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  running in time 2 k |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 determines whether graph G has linking number k in time O(|G| 3 ) [Fellows and Langston 1988] [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 {v 1 }, G-{v 1 } {u 1 }, G-{u 1 } {v 1,v 2 }, G-{v 1,v 2 }{v 1,u 2 }, G-{v 1,u 2 } {u 2,v 2 } {u 1,v 1 } k+1 Theorem [Downey and Fellows 1992] VERTEX COVER is solvable in time O(2 k |V(G)|). By considering only graphs with vertices of degree 3 or higher, it is possible to shrink search space from 2 k to (5 1/4 ) k [Balasubramanian et al 1997]

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(2 k n) O((5 1/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 + 2 k k 2 )[Balasubramanian et al 1992] O(kn + ((5 1/4 ) k k 2 )[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

19 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 x 1,x 2,... of S contains an infinite chain; for every infinite sequence x 1,x 2,... of S there are indices i and j such that i < j and x i  x j ; [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 x 1,x 2,...  i,j: i < j and x i  x j  S,  is WQO for each finite set and equality relation . Each infinite sequence x 1,x 2,... will contain at least one repeated element x i Other examples?

22 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 w 1,w 2,... be the smallest infinite antichain there is a  S, such that infinite number of w i 's starts with a let the sequence of these w i 's be w i 1,w i 2,... denote w ij with the first symbol a removed by w' ij then w 1,...,w i 1 -1,w' i 1,w' i 2,... is antichain and smaller than the smallest one (!!!)

24 Ordering relations on graphs Subgraph relation: A graph H=(V 1,E 1 ) is a subgraph of G=(V 2,E 2 ) if there is an injective mapping  : V 1  E 1, such that {x,y}  E 1  {  (x),  (y)}  E 2. H  S G  H is a subgraph of G. SS 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=(V 1,E 1 ) is topologically embedded in G=(V 2,E 2 ) if there is an mapping  : E 1  P(G), such that for all pairs of distinct edges e 1,e 2  E 1 the corresponding paths  (e 1 ) and  (e 2 ) are vertex-disjoint. H  T G  there is a topological embedding of H in G.

26 Ordering relations on graphs Graph minor relation: A graph H=(V 1,E 1 ) is a minor of G=(V 2,E 2 ) 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. K 4  M K 3,3 Edge contraction Edge contraction

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

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

29 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. Theorem [N.Robertson, P.Seymour] Every infinite set of graphs contains two graphs such that one is immersed in another. Ordering relations on graphs 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(n 3 ) [Robertson and Seymour 1995] IMMERSION ORDER TEST is FPT-solvable in polynomial time poly(n) [Fellows and Langston 1988]

32 WQO and graph planarity GRAPH PLANARITY Instance: Graph G=(V,E) Question: Is G planar? 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 GRAPH PLANARITY Instance:Graph G=(V,E) Question:Is G planar? This already gives a concrete P-time algorithm for graph planarity problem Kuratowski theorem {K 3,3, K 5 } is an obstruction set for the ideal of planar graphs under  M ordering. [Adapted from R.Downey and M.Fellows]

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

35 WQO and Vertex Cover 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. 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? For fixed k VERTEX COVER is in P VERTEX COVER  FPT

36 Self reduction 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. HAMILTONICITY Instance:A graph G=(V,E) Question:Does graph G has 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: 1.start with B=  2.check whether there exists y  B with y  x 3.if such y exists the answer is no 4.otherwise try to self-reduce, if solution is found the answer is yes 5.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 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 GH  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 s 1,..,s k over finite alphabet  of length n each Parameter:Positive integers k and d Question:Find a string s such that d(s,s i )  d for all i=1,...,k Can be solved in time O(kn +kd d+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: K k+1 is a k-tree; if G is a k-tree and H is a subgraph of G isomorphic to K k, 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 K k+1, is a k-tree. Definition 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 T x  V and the following conditions hold: for every {v,w}  E there is x with v,w  T x. for every v  V and every x,y: v  T x and v  T y there is a path between x and y in T. Definition A treewidth tw(G) of graph G is the smallest k for which there exists a tree decomposition T of G with | T x |  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 Graph treewidth [Adapted from J.Blum and M.Grohe] Tree decomposition - example

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

46 Computing graph treewidth [Adapted from J.Blum and M.Grohe] p(k) = 32k 3  Although the algorithm is simple and constructive, it is still non-practical and exhaustive search n k 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|).

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? Do exhaustive search to find all compatible colourings of leaves Do exhaustive search to find all colourings compatible with vertex and both of its children DP on tree decompositions

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.

50 Myhill-Nerode theorem 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 (!!!) 12t12t

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

52 Test sets and Hamiltonicity [Adapted from R.Downey, M.Fellows] 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.

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

54 Bandwidth [Adapted from H.Bodlaender] 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

55 From WQO and treewidth methods to the “Real World” A “nice” approach to a problem: 1.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). 2.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) > 2 k k k 

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(9 k n 2 ) 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.42 k + poly(m, n)) algorithm [S.Bocker et al, 2009]

60 Multiple sequence alignment Dynamic programming: O(n k ) The problem is W[1]-hard  [K.Pietrzak, 2002] FPT, if parameterized by length of sequence s LONGEST COMMON SUBSEQUENCE Instance:A set of sequences s 1,..,s k 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 s i.

61 Pathways in molecular interaction networks Deterministic O(d k n) algorithm (where k is length of path) [J.Scott et al, 2006] d however is very large  Probabilistic O(4 k n) 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 Genotypes and haplotypes Haplotypes: Chromosome 1 Chromosome 2 A:...AGTGTTTACG ...ACTGTATACG   TCACAAATGC...  TGACATATGC... B:...ACTGTTTACG ...AGTGTATACG   TGACAAATGC...  TCACATATGC... Haplotypes A and B are different, but both have the same genotype: {A,A},{C,G},{T,T},{G,G}{T,T},{A,T},{T,T},{A,A},{C,C},{G,G}

63 Clark’s consistency graphs Clark’s consistency graph: An undirected graph vertices of which correspond to individuals and are labeled by “chromosomes”. Each pair of graph vertices is connected by edge  these individuals share at least one of the “chromosomes”. Originally used in different context, but here we assume that given are sets of graph’s vertices and edges, and our tasks are either to reconstruct labels or to show that this can be done consistently. a ba bb cb c c dc da da d a ba ?a ? a ?a ?? ?? ?

64 Haplotype reconstruction problem Haplotype Reconstruction Problem: Given undirected graph G=(V,E) and a number k  N, decide whether we can remove from E at most k edges to obtain graph G=(V,E') in which each vertex v  V can be labeled with two labels h 1 (v),h 2 (v)  N in such a way that for each clique there is exactly one label shared by all clique’s vertices. Theorem (?) [J.Viksna, B.Halldorsson]: There is an algorithm that solves Haplotype Reconstruction Problem in time O(nc k ).

65 Haplotype reconstruction problem Theorem (?) [J.Viksna, B.Halldorsson]: There is an algorithm that solves Haplotype Reconstruction Problem in time O(nc k ). Proof? Interestingly “easy” methods doesn’t seem to work in this case – the required property is not preserved by minors or immersed graphs; also there is no bound on treewidth. However there are just small number of forbidden subgraphs.

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

67 Thank you for your attention!


Download ppt "Parameterized algorithms and their applications Juris Viksna Riga, IMCS."

Similar presentations


Ads by Google