The Longest Path Problem is a question of finding the maximum length between pairs of vertices of a graph. In the general case, the problem is NP-complete. However, there is a small collection of graph classes for which there exists an efficient solution. Current approaches involve either approximation or computational enumeration. For Tree-like classes of graphs, there are approximation and enumeration algorithms which solves the problem efficiently. Despite this, we propose a new method of approaching the longest path problem with exact algebraic solutions that give rise to polynomial-time algorithms. Our method provides algorithms that are proven correct by their underlying algebraic operations unlike existing purely algorithmic solutions to this problem. We introduce a `booleanize' mapping on the adjacency matrix of a graph which we prove identifies the solution for trees, uniform block graphs, block graphs, and directed acyclic graphs with exact conditions and associated polynomial-time algorithms. In addition, we display additional algorithms that can generate every possible longest path of acyclic graphs in efficient time, as well as for block graphs.
字符串中两个索引的最长公共扩展(LCE)是从这两个索引开始的最长相同子串的长度。LCE问题要求将字符串预处理为支持快速LCE查询的紧凑数据结构。在本文中,我们推广的LCE问题的树,并提出了一些应用LCE树尝试和XML数据库。给定一个大小为$n$的带标签和有根树$T$,目标是将$T$预处理成一个紧凑的数据结构,该结构支持$T$中的子路径和子树之间的以下LCE查询。假设$v_1$、$v_2$、$w_1$和$w_2$是$T$的节点,使得$w_1$和$w_2$分别是$v_1$和$v_2$的后代。\begin{itemize} \item $\LCEPP(v_1, w_1, v_2, w_2)$: (path-path $\LCE$) return the longest common prefix of the paths $v_1 \leadsto w_1$ and $v_2 \leadsto w_2$. \item $\LCEPT(v_1, w_1, v_2)$: (path-tree $\LCE$) return maximal path-path LCE of the path $v_1 \leadsto w_1$ and any path from $v_2$ to a descendant leaf. \item $\LCETT(v_1, v_2)$: (tree-tree $…
Polynomial-Time Solutions for Longest Common Subsequence Related Problems Between a Sequence and a Pangenome Graph
College of Big Data Statistics, Guizhou University of Finance and Economics(贵州财经大学大数据统计学院);Algorithm and Computational Complexity Laboratory of School of Information, Guizhou University of Finance and Economics(贵州财经大学信息学院算法与计算复杂性实验室)