Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Linear Time Algorithm for the Longest Path Problem on 2-trees joint work with Tzvetalin Vassilev and Krassimir Manev

Similar presentations


Presentation on theme: "A Linear Time Algorithm for the Longest Path Problem on 2-trees joint work with Tzvetalin Vassilev and Krassimir Manev"— Presentation transcript:

1 A Linear Time Algorithm for the Longest Path Problem on 2-trees joint work with Tzvetalin Vassilev /tzvetalv@nipissingu.ca/ and Krassimir Manev /manev@fmi.uni-sofia.bg/ Minko Markov Sofia University, Faculty of Mathematics and Informatics minkom@fmi.uni-sofia.bg

2 Structure of the lecture  Background  Motivation  The algorithm itself  Conclusions 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

3 Background  Longest Path (LP) – a computational problem on undirected connected graphs, either non-weighted or weighted.  u-path: a path with one endpoint vertex u  (u  v)-path: a path with endpoints u and v  (u  v  )-path: a path with one endpoint u and v as an internal vertex  (u,  v)-path: any path with one endpoint u, not containing v 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

4 Definitions (cont’d)  (u  v)-paths: two vertex-disjoint paths, one with endpoint u, the other with endpoint v 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

5 2-Trees 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

6 Complexity Background  LP on general graphs in NP-complete both in the unweighted and weighted version  Best poly-time approximation ratio is close to linear (assuming P ≠ NP)  Fixed Parameter Tractable 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

7 Complexity Background  A linear time algorithm for LP on trees is known since the 1960’s  Poly-time algorithms: Cactus graphs: ○ O(n 2 ) (Uehara, Uno 2007) ○ O(n) (Mugurel et al, 2009, M. and Manev 2009) Block graphs: O(m + n) (Uehara, Uno 2007) Ptolemaic graphs: O(n 5 ) (Takahara et al, 2008) Interval graphs: O(n 4 ) (Ioannidou et al, 2009) 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

8 Complexity Background  For graphs of treewidth bound by a constant k, LP is solvable in O(2 k k! n) time (Bodlaender 1988). The algorithm is only hinted rather than stated explicitly. Allegedly, huge hidden constant. And yet the result implies a linear time algorithm for cactus graph (and thus annuls the result of Uehara and Uno). 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

9 Motivation  First was the linear time algorithm for LP in cactus graphs  What if the cactus cycles have chords? Is it trivial to modify the cacti algorithm to handle chords as well, preserving the linear time complexity? What if the chords are non-crossing (parallel)?  Outerplanar graphs have treewidth two. So let us solve LP on 2-trees in O(n). 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

10 Rooted 2-tree  Any edge can be chosen as a root  If the root is a periphery edge then the rooted 2-tree is simple and we define the root face as well. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures" G1G1 G2G2 uv F G 1 and G 2 are simple or complex 2-trees. They are the branches

11 Rooted 2-tree (cont’d)  If the root is not a periphery edge then there is a collection of simple rooted 2-trees “glued together” at the root. The 2-tree is complex. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures" uv G2G2 G1G1 G3G3 G 1, G 2, and G 3 are the folios

12 The labels  The label of a rooted 2-tree G, root (u,v), is the ordered septuple ‹λ 1, λ 2, λ 3, λ 4, λ 5, λ 6, λ 7 ›, where λ 1 is the length of a longest path in G λ 2 is the length of a longest (u  v)-path λ 3 is the length of a longest (u  v  )-path λ 4 is the length of a longest (u,  v)-path λ 5 is the length of a longest (v  u  )-path λ 6 is the length of a longest (v,  u)-path 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

13 The labels (cont’d) λ 7 is the sum of the lengths of any two (u  v)-paths of maximum total length  In general, the label of the root is (u,v) is different from the label of the root (v,u). The graph is undirected but in general the length of a longest (u  v  )-path is not the same as the length of a longest (v  u  )-path, etc. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

14 The labels (cont’d)  The trivial 2-tree is the single edge. The label of the trivial 2-tree is ‹1, 1, 0, 0, 0, 0, 0›. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

15 The algorithm  Choose any edge as the root. Compute its label with COMPUTE LABEL. The numerical answer is the first element of the label. It is not difficult to compute modify the algorithm so that a longest path is computed as well.  COMPUTE LABEL: if the 2-tree is a single edge, return ‹1, 1, 0, 0, 0, 0, 0›. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

16 COMPUTE LABEL  If the root is not just an edge, it has one or more folios. Compute the label of each one of them with COMPUTE SIMPLE. Using those labels, compute the label of the whole 2-tree with COMBINE ON EDGE 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures" G2G2 G1G1 G3G3 λ = ‹_,_,_,_,_,_,_› G2G2 G3G3

17 COMPUTE SIMPLE  Split the root face and compute the labels of the two obtained rooted 2-trees. Using those two labels, compute the label for the whole 2-tree with COMBINE ON FACE 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures" vu F G2G2 G1G1

18 COMBINE ON EDGE  In the resulting label, each of λ 2, λ 4, and λ 6 is the maximum of the 2 nd, 4 th, and 6 th element, respectively, over the labels of the folia  Each of λ 3, λ 5, and λ 7 is the maximum of two numbers: one is the maximum over the correspondent elements of the folia, the other is a sum of two elements (corresponding to concatenation of two paths) 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

19 COMBINE ON EDGE (cont’d)  λ 1 is the maximum of 11 or 12 numbers: The max λ 1 over all folia The hitherto computed λ 2, λ 3, λ 4, λ 5, λ 6 Five sums over the folia, in case there are 2 folia only, or six sums, otherwise 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

20 COMBINE ON FACE  λ 2 is the sum of the λ 2 ’s of the two branches  The other λ i ’s are obtained as maxima of certain sums of label elements of the two branches, sometimes +1 in order to take into account the addition of the root edge 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

21 LP on partial 2-trees  Given the tree decomposition, it is trivial to deal with the cut vertices – the label of the graph “below” needs only two elements  Within biconnected components, there are missing edges. Fill in with “virtual” missing edges. For each virtual edge, the root there is in fact the two vertices. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

22 LP on partial 2-trees  The labels are the same (7 elements). The decisions are taken likewise, just drop expressions (from the max() functions) that rely on a path passing through the root edge when the root edge is virtual 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

23 Conclusion  It is easy to design an O(n) algorithm for LP on 2-trees.  It seems infeasible to extend this approach to k-trees. 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"

24 THE END 20 February 2016 Minko Markov, Faculty of Mathematics and Informatics. This research is supported by Sofia University Science Fund under project "Discrete Structures"


Download ppt "A Linear Time Algorithm for the Longest Path Problem on 2-trees joint work with Tzvetalin Vassilev and Krassimir Manev"

Similar presentations


Ads by Google