The parity of the length of paths and cycles is a classical and well-studied topic in graph theory and theoretical computer science. The parity constraints can be extended to label constraints in a group-labeled graph, which is a directed graph with each arc labeled by an element of a group. Recently, paths and cycles in group-labeled graphs have been investigated, such as packing non-zero paths and cycles, where “non-zero” means that the identity element is a unique forbidden label. In this paper, we present a solution to finding an s–t path with two labels forbidden in a group-labeled graph. This also leads to an elementary solution to finding a zero s–t path in a Z3-labeled graph, which is the first nontrivial case of finding a zero path. This situation in fact generalizes the 2-disjoint paths problem in undirected graphs, which also motivates us to consider that setting. More precisely, we provide a polynomial-time algorithm for testing whether there are at most two possible labels of s–t paths in a group-labeled graph or not, and finding s–t paths attaining at least three distinct labels if exist. The algorithm is based on a necessary and sufficient condition for a group-labeled graph to have exactly two possible labels of s–t paths, which is the main technical contribution of this paper.
All Science Journal Classification (ASJC) codes
- Theoretical Computer Science
- Discrete Mathematics and Combinatorics
- Computational Theory and Mathematics