Skip to main content
QUICK REVIEW

[Paper Review] On the Complexity of Exact Pattern Matching in Graphs: Binary Strings and Bounded Degree

Massimo Equi, Roberto Grossi|arXiv (Cornell University)|Jan 1, 2019
Algorithms and Data CompressionComputer Science23 references4 citations
TL;DR

This paper establishes a conditional lower bound for exact pattern matching in labeled graphs, proving that no algorithm can solve the problem in subquadratic time (O(|E|^{1−ϵ}m) or O(|E|m^{1−ϵ})) for any ϵ > 0 unless the Strong Exponential Time Hypothesis (SETH) is false. The result holds even for undirected graphs of maximum degree three and directed acyclic graphs with bounded total degree, showing that exact and approximate pattern matching on graphs are equally hard under SETH, unlike in strings where exact matching is linear and approximate is quadratic.

ABSTRACT

Exact pattern matching in labeled graphs is the problem of searching paths of a graph $G=(V,E)$ that spell the same string as the pattern $P[1..m]$. This basic problem can be found at the heart of more complex operations on variation graphs in computational biology, of query operations in graph databases, and of analysis operations in heterogeneous networks, where the nodes of some paths must match a sequence of labels or types. We describe a simple conditional lower bound that, for any constant $ε>0$, an $O(|E|^{1 - ε} \, m)$-time or an $O(|E| \, m^{1 - ε})$-time algorithm for exact pattern matching on graphs, with node labels and patterns drawn from a binary alphabet, cannot be achieved unless the Strong Exponential Time Hypothesis (SETH) is false. The result holds even if restricted to undirected graphs of maximum degree three or directed acyclic graphs of maximum sum of indegree and outdegree three. Although a conditional lower bound of this kind can be somehow derived from previous results (Backurs and Indyk, FOCS'16), we give a direct reduction from SETH for dissemination purposes, as the result might interest researchers from several areas, such as computational biology, graph database, and graph mining, as mentioned before. Indeed, as approximate pattern matching on graphs can be solved in $O(|E|\,m)$ time, exact and approximate matching are thus equally hard (quadratic time) on graphs under the SETH assumption. In comparison, the same problems restricted to strings have linear time vs quadratic time solutions, respectively, where the latter ones have a matching SETH lower bound on computing the edit distance of two strings (Backurs and Indyk, STOC'15).

Motivation & Objective

  • To establish a conditional lower bound for exact pattern matching in labeled graphs under the Strong Exponential Time Hypothesis (SETH).
  • To clarify the complexity gap between exact and approximate pattern matching in graphs, contrasting it with the known linear vs. quadratic complexity in string matching.
  • To demonstrate that the problem remains hard even under structural constraints, such as bounded degree in undirected graphs and bounded indegree+outdegree in DAGs.
  • To provide a direct, self-contained reduction from SETH to exact pattern matching in graphs, making the result accessible to researchers in computational biology, graph databases, and graph mining.

Proposed method

  • A direct reduction from the Strong Exponential Time Hypothesis (SETH) to the exact pattern matching problem in labeled graphs.
  • Design of a binary encoding scheme for graph node labels to simulate pattern occurrences via binary substrings.
  • Construction of a transformed graph with bridges that enforce directional traversal from 'e' to 'b' nodes, ensuring only valid pattern matches are preserved.
  • Use of a revised pattern P' that avoids spurious matches by ensuring its binary encoding does not contain the encoding of 'be'.
  • Proof that pattern matches in the original graph if and only if their binary encodings match in the transformed graph, preserving correctness.
  • Adaptation of the reduction to work for directed acyclic graphs (DAGs) by orienting edges from first to last bridge in a path, ensuring acyclicity.

Experimental results

Research questions

  • RQ1Can exact pattern matching in labeled graphs be solved in subquadratic time, i.e., o(|E|m) time, under SETH?
  • RQ2Is there a fundamental complexity difference between exact and approximate pattern matching in graphs, as exists in strings?
  • RQ3Does the complexity of exact pattern matching remain high even under structural constraints like bounded degree or bounded indegree+outdegree?
  • RQ4Can the SETH-based lower bound be extended to deterministic graphs, where each node has at most one outgoing edge per label?
  • RQ5Is the quadratic barrier for pattern matching in graphs inherent, or could a more efficient algorithm exist under different assumptions?

Key findings

  • An O(|E|^{1−ϵ}m)-time or O(|E|m^{1−ϵ})-time algorithm for exact pattern matching in labeled graphs with a binary alphabet cannot exist unless the Strong Exponential Time Hypothesis (SETH) is false.
  • The conditional lower bound holds even for undirected graphs with maximum degree three, demonstrating the problem's hardness under strong structural constraints.
  • The same lower bound applies to directed acyclic graphs (DAGs) with maximum sum of indegree and outdegree three, extending the result to important graph classes in knowledge graphs and variation graphs.
  • The paper shows that exact and approximate pattern matching on graphs have the same complexity under SETH, in contrast to strings where exact matching is linear and approximate is quadratic.
  • The reduction is self-contained and directly derives the lower bound from SETH, making it accessible and applicable to researchers in computational biology, graph databases, and graph mining.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.