Pattern detection in ordered graphs
Guillaume Ducoffe, Laurent Feuilloley, Michel Habib, Fran\c{c}ois, Pitois

TL;DR
This paper investigates the complexity of detecting fixed ordered patterns in graphs, establishing efficient algorithms for many small patterns and conditional lower bounds for larger ones, with implications for recognizing various graph classes.
Contribution
It provides a systematic analysis of pattern detection complexity in ordered graphs, including linear-time algorithms for most three-vertex patterns and parameterized bounds based on merge-width.
Findings
Almost all three-vertex patterns can be detected in linear time.
Subquadratic algorithms are unlikely for many four-vertex patterns.
Detection time can be bounded by the pattern's merge-width, enabling efficient recognition of certain graph classes.
Abstract
A popular way to define or characterize graph classes is via forbidden subgraphs or forbidden minors. These characterizations play a key role in graph theory, but they rarely lead to efficient algorithms to recognize these classes. In contrast, many essential graph classes can be recognized efficiently thanks to characterizations of the following form: there must exist an ordering of the vertices such that some ordered pattern does not appear, where a pattern is basically an ordered subgraph. These pattern characterizations have been studied for decades, but there have been recent efforts to better understand them systematically. In this paper, we focus on a simple problem at the core of this topic: given an ordered graph of size , how fast can we detect whether a fixed pattern of size is present? Following the literature on graph classes recognition, we first look for patternsā¦
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Graph Theory Research Ā· Graph Labeling and Dimension Problems Ā· Limits and Structures in Graph Theory
11institutetext: University of Bucharest, Romania, National Institute for Research and Development in Informatics, Romania 22institutetext: Univ Lyon, CNRS, INSA Lyon, UCBL, LIRIS, UMR5205, F-69622 Villeurbanne, France 33institutetext: IRIF, CNRS & UniversitƩ Paris CitƩ, France 44institutetext: LIB, UniversitƩ Bourgogne Franche-ComtƩ, France
Pattern detection in ordered graphs
Guillaume Ducoffe 11 0000-0003-2127-5989
āā
Laurent Feuilloley 22 0000-0002-3994-0898
āā
Michel Habib 33 0000-0002-8564-2314
āā
FranƧois Pitois 2244 0000-0002-5524-0138
Abstract
A popular way to define or characterize graph classes is via forbidden subgraphs or forbidden minors. These characterizations play a key role in graph theory, but they rarely lead to efficient algorithms to recognize these classes. In contrast, many essential graph classes can be recognized efficiently thanks to characterizations of the following form: there must exist an ordering of the vertices such that some ordered pattern does not appear, where a pattern is basically an ordered subgraph. These pattern characterizations have been studied for decades, but there have been recent efforts to better understand them systematically. In this paper, we focus on a simple problem at the core of this topic: given an ordered graph of size , how fast can we detect whether a fixed pattern of size is present?
Following the literature on graph classes recognition, we first look for patterns that can be detected in linear time. We prove, among other results, that almost all patterns on three vertices (which capture many interesting classes, such as interval, chordal, split, bipartite, and comparability graphs) fall in this category. Then, in a finer-grained complexity perspective, we prove conditional lower bounds for this problem. In particular we show that for a large family of patterns on four vertices it is unlikely that subquadratic algorithm exist. Finally, we define a parameter for patterns, the merge-width, and prove that for patterns of merge-width , one can solve the problem in for some constantĀ . As a corollary, we get that detecting outerplanar patterns and other classes of patterns can be done in time independent of the size of the pattern.
Keywords:
H
ereditary graph classes, forbidden structures, pattern characterization, graph algorithms, fine-grained complexity, parameterized algorithms, subgraph detection, merge-width.
1 Introduction
1.1 Motivation
Forbidden structures characterization and recognition.
The most popular way to define graph classes is to forbid some substructure, typically (induced) subgraphs or minors. This approach has led to a huge amount of results on the structure of these graphs and how to use it e.g. for combinatorial optimization. It is also a versatile framework, in the sense that many useful classes can be described by forbidden subgraphs or minors. For example, [15] established a list of forbidden induced subgraphs characterizing interval graphs, a well-known class, whose original definition does not refer to any forbidden structure.
But when it comes to recognizing graph classes efficiently, forbidden subgraphs become less handy. First, the list of forbidden structures might be long or infinite. For example, the list for interval graphs contains three infinite families. Second, detecting induced subgraphs efficiently can be challenging.
Efficient recognition and forbidden patterns.
The classic efficient approach to recognize classes such as interval or chordal graphs is not to use forbidden subgraphs, but instead to use some specific graph traversals to unveil the inner structure of these graphs. For example, chordal graphs can be recognized in a two-step way: first perform a specific breadth-first search (BFS) called LexBFS, and then check that the reverse order in which the vertices are visited has the property that for any vertex, its neighborhood restricted to its successors is a clique. The key principle behind the efficiency of these recognition algorithms is that many graphs classes are characterized by the existence of an ordering of their vertices with efficiently checkable properties. For example, a graph is an interval graph, if and only if, there exists an ordering of its vertices such that for any three (not necessarily consecutive) vertices , if is an edge, then must also be an edge. A compact way to encode this forbidden structure is to use what is called a patternĀ [9], see FigureĀ 1 and its caption.
Characterizations by forbidden patterns have been established for many classes, such as chordal graphs, interval graphs, co-comparability graphs, trivially perfect graphs, etc. InĀ [9] the authors studied systematically all the classes that can be characterized by forbidden patterns on three vertices, and proved that they basically all correspond to well-known classes, and can almost all be recognized in linear time.
Pattern detection in ordered graphs.
The typical recognition algorithms using forbidden pattern characterization usually have two components: they first build a candidate order, and then check that the pattern does not appear. At first sight, it seems that the first part should be the challenging one, and should dictate the complexity. Indeed, for a graph on vertices, brute-force generation of all vertex orderings takes , while for a pattern on vertices, brute-force checking takes at most . But, as hinted before, for many graph classes, there exists an efficient way to compute a unique candidate ordering via a set of traversals, leading to a polynomial-time algorithm. Then, for the recognition problem, the next step is to optimize the exponent of the polynomial, and it is not clear which part, building the order or verifying the order, is the costliest.
In this paper, we focus on the verification part: we study the fine-grained complexity of detecting patterns in ordered graphs. A selection of questions we want to answer is as follows: Given a pattern on vertices, can we detect it in time much lower thanĀ ? Independent ofĀ ? In linear time? Are there some parameters of the pattern that dictate the complexity? What are the patterns that are hard to detect?
Although our original motivations are on the side of understanding recognition algorithms and pattern characterizations better, our study is also close to the area that studies the efficient detection of subgraphs in (unordered) graphs, i.e. subgraph isomorphism. The fine-grained complexity of this problem has been studied extensively recently (see e.g. [6] and the references therein), and we hope that the new questions and techniques we introduce here can also inform this more established area. The other direction is already fruitful: we use some of their techniques and insights.
Finally, this work also continues a line of work called certifying algorithmsĀ [17]. In this type of algorithms, not only does the algorithm compute the answer, but also a certificate that allows to check quickly that the solution is correct. The motivation being that the code or the execution of the algorithm could be faulty. Typical examples are certifying bipartiteness and planarity, by a 2-coloring and a planar embedding, respectively. In the case of pattern characterization, the ordering avoiding the pattern is a certificate, and in this paper we are interested in the complexity of its authentication.
1.2 Organization of the paper and overview of the results
Because of the page limit and to improve readability, the paper is mainly an overview of our results and technique. Most of the precise formal statements and proofs are deferred to the appendix. The overview is divided in three sections, that correspond to the three types of results obtained. In SectionĀ 3, following the tradition of the graph class recognition literature, we first establish that several interesting types of patterns can be detected in time linear in the number of edges of the ordered graph: most patterns on three vertices, patterns that are basically forests, some patterns arising from geometry, etc. Then, in SectionĀ 4, we prove that the problem is at most as hard as detecting cliques in ordered graphs, and then using fine-grained complexity techniques, we prove lower bounds; in particular, we establish that for a large family of patterns on four vertices, it is unlikely that one could do better than quadratic time. Finally, in SectionĀ 5, we identify a parameter that we call merge-width, such that the complexity of recognizing a pattern is in , for mergewidth and a constant independent from . We prove that this parameter is bounded for various types of patterns related to outerplanar graphs.
2 Model, definitions, and basic properties
We first define formally patterns and the related concepts. We assume that the reader is familiar with basic graph notions.
Definition 1
An ordered graph is an undirected, finite, simple, and loopless graph, denoted by a pair , where is the vertex set, totally ordered by , and is the edge set. The number of vertices will be denoted by and the number of edges by .
The ordered graphs given as input are encoded by adjacency lists.
Definition 2
A pattern is a -tuple where is a totally ordered set of vertices, and every unordered pair of vertices belongs to one of the three disjoint sets , , and called respectively mandatory edges, forbidden edges and undecided pairs.
In the figures (e.g. in FigureĀ 1), we use plain edges for mandatory edges, dashed edges for forbidden edges, and nothing for undecided pairs. Also, in our drawings, the patterns are ordered from left to right. The complement of a pattern is the pattern on the same vertex set where we have exchanged and . The mirror of a pattern is the same pattern with the reverse ordering. A pattern is fully specified if it has no undecided pair, and it is positive if it has no forbidden edge.
Note that āpatternā has multiple definitions in the literature, but in the paper it always refers to DefinitionĀ 2, followingĀ [9].
Definition 3
An ordered graph is a realization of a pattern if and , where . An ordered graph contains a pattern if there exists a set of vertices , such that the ordered subgraph induced by is a realization of . If an ordered graph does not contain a pattern , then it avoids it.
A simpler formalism with only two types of edges can also be considered, but it appears that the pattern formalism is better when handling classic graph classes. (See also the discussion inĀ [9].) Patterns can also be described as acyclic signed graphs with 2 types of arcs (mandatory edges and forbidden edges).
Our focus is on the following algorithmic problem.
Problem: Detection of pattern (where has vertices).
Input: A graph on vertices and edges, described by its adjacency list, and a total ordering of its vertices.
Output: Does contain ?
For short, we will sometimes refer to the problem as -Detection. Often, we will not refer explicitly to , and simply consider that the vertices are named from 1 to in the ordering of . We will also mention the generalization where we want to detect a set of patterns, in this case we want to decide whether the ordered graph contains at least one of the patterns of the set.
Note that detecting a pattern or its mirror are two problems with the same complexity. Also, if we allow quadratic time, then detecting a pattern or its complement are also equivalent, since we can complement the ordered graph.
3 Linear-time detection (overview)
Our first motivation for the study of pattern detection originates from graph classes recognition, and in particular linear-time recognition. For this reason, our first focus in on the question: What are the patterns that can be recognized in linear-time? Note that here linear time means time where is the number of edges. (Throughout the paper, that deals with higher complexities, most complexities will be expressed as a function of the number of vertices .)
Focus on the patterns on three vertices.
Since one can expect that the larger the pattern, the more complicated the detection problem, we start with patterns on three vertices. PaperĀ [9] made a systematic study of the classes of graphs that can be characterized by the existence of a vertex ordering such that a given pattern (or a given family of patterns) on three vertices does not appear. It happens that there are around 20 such classes (and their complements), and that they are almost all well-known classes (paths, trees, interval, chordal, split, permutation, comparability, triangle-free, bipartite graphs etc.). In addition, all of them can be recognized in linear time [9], except for the classes defined by the individual patterns Triangle, Comparability and their complements. (For patterns on three vertices, we will use the notations fromĀ [9]. In particular, the patterns have names in small capital letters, that are related to the graph classes in which they are forbidden. The details are given in AppendixĀ 0.A. The pattern we have just mentioned are illustrated in FigureĀ 3.)
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Frank Pok Man Chu. A simple linear time certifying LBFS-based algorithm for recognizing trivially perfect graphs and their complements. Inf. Process. Lett. , 107(1):7ā12, 2008.
- 2[2] Derek G. Corneil, JĆ©rĆ©mie Dusart, Michel Habib, and Ekkehard Kƶhler. On the power of graph searching for cocomparability graphs. SIAM J. Discrete Math. , 30(1):569ā591, 2016.
- 3[3] Derek G. Corneil and Richard Krueger. A unified view of graph searching. SIAM J. Discrete Math. , 22(4):1259ā1276, 2008.
- 4[4] Derek G. Corneil, Yehoshua Perl, and Lorna K. Stewart. A linear recognition algorithm for cographs. SIAM J. Comput. , 14(4):926ā934, 1985.
- 5[5] Mina Dalirrooyfard, Thuy Duong Vuong, and Virginia Vassilevska Williams. Graph pattern detection: Hardness for all induced patterns and faster non-induced cycles. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing , pages 1167ā1178, 2019.
- 6[6] Mina Dalirrooyfard and Virginia Vassilevska Williams. Induced cycles and paths are harder than you think. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS) , pages 531ā542. IEEE, 2022.
- 7[7] Richard Durstenfeld. Algorithm 235: random permutation. Communications of the ACM , 7(7):420, 1964.
- 8[8] Laurent Feuilloley and Michel Habib. Classifying grounded intersection graphs via ordered forbidden patterns, December, http://arxiv.org/abs/2112.00629Ćø, 2021.
