English

Safety in $s$-$t$ Paths, Trails and Walks

Data Structures and Algorithms 2021-11-03 v2

Abstract

Given a directed graph GG and a pair of nodes ss and tt, an \emph{ss-tt bridge} of GG is an edge whose removal breaks all ss-tt paths of GG (and thus appears in all ss-tt paths). Computing all ss-tt bridges of GG is a basic graph problem, solvable in linear time. In this paper, we consider a natural generalisation of this problem, with the notion of "safety" from bioinformatics. We say that a walk WW is \emph{safe} with respect to a set W\mathcal{W} of ss-tt walks, if WW is a subwalk of all walks in W\mathcal{W}. We start by considering the maximal safe walks when W\mathcal{W} consists of: all ss-tt paths, all ss-tt trails, or all ss-tt walks of GG. We show that the first two problems are immediate linear-time generalisations of finding all ss-tt bridges, while the third problem is more involved. In particular, we show that there exists a compact representation computable in linear time, that allows outputting all maximal safe walks in time linear in their length. We further generalise these problems, by assuming that safety is defined only with respect to a subset of \emph{visible} edges. Here we prove a dichotomy between the ss-tt paths and ss-tt trails cases, and the ss-tt walks case: the former two are NP-hard, while the latter is solvable with the same complexity as when all edges are visible. We also show that the same complexity results hold for the analogous generalisations of \emph{ss-tt articulation points} (nodes appearing in all ss-tt paths). We thus obtain the best possible results for natural "safety"-generalisations of these two fundamental graph problems. Moreover, our algorithms are simple and do not employ any complex data structures, making them ideal for use in practice.

Keywords

Cite

@article{arxiv.2007.04726,
  title  = {Safety in $s$-$t$ Paths, Trails and Walks},
  author = {Massimo Cairo and Shahbaz Khan and Romeo Rizzi and Sebastian Schmidt and Alexandru I. Tomescu},
  journal= {arXiv preprint arXiv:2007.04726},
  year   = {2021}
}
R2 v1 2026-06-23T16:58:52.842Z