1 Introduction

A graph is a threshold graph if there exist a vertex-weight function and a real number called a weight lower bound such that two vertices are adjacent in the graph if and only if the associated vertex weight sum is at least the weight lower bound. Threshold graphs and their generalizations are well studied because of their beautiful structures and applications in many areas [6, 15]. In particular, the edge-intersections of two threshold graphs, and their complements (i.e., the union of two threshold graphs) have attracted several researchers in the past, and recognition algorithms with running time \(O(n^5)\) by Ma [14], \(O(n^4)\) by Raschle and Simon [19], and \(O(n^3)\) by Sterbini and Raschle [24] have been developed, where n is the number of vertices.

In this paper, we study the class of double-threshold graphs, which is a proper generalization of threshold graphs and a proper specialization of the graphs that are edge-intersections of two threshold graphs [11]. A graph is a double-threshold graph if there exist a vertex-weight function and two real numbers called weight lower and upper bounds such that two vertices are adjacent if and only if the sum of their weights is at least the lower bound and at most the upper bound. Our main result in this paper is a linear-time recognition algorithm for double-threshold graphs based on a new characterization.

As described below, there are at least two different lines of recent studies that led to this class of graphs: one is on multithreshold graphs and the other is on pairwise compatibility graphs.

Multithreshold graphs Jamison and Sprague [12] introduced multithreshold graphs as a generalization of threshold graphs. The threshold number of a graph \(G = (V,E)\) is the minimum positive integer k such that there are k distinct thresholds \(\theta _{1}, \ldots , \theta _{k}\) and a weight function \(\mathtt {w}:V \rightarrow \mathbb {R}\) such that \(uv \in E\) if and only if the number of thresholds \(\theta _{i}\) satisfying \(\theta _{i} \le \mathtt {w}(u)+\mathtt {w}(v)\) is odd. Intuitively, the thresholds break the real line into “yes” and “no” regions such that two vertices are adjacent if and only if the sum of their weights belongs to a yes region. Clearly, a graph has threshold number 1 if and only if it is a threshold graph and has threshold number at most 2 if and only if it is a double-threshold graph. They showed that every graph has threshold number, and asked some questions including the complexity for recognizing double-threshold graphs. Puleo [18] showed that there is no single choice of three thresholds that can represent all graphs of threshold number at most 3. Jamison and Sprague [11] later focused on double-threshold graphs and showed that all double-threshold graphs are permutation graphs and that the bipartite double-threshold graphs are exactly the bipartite permutation graphs. Our new characterization is closely related to these facts and our algorithm uses them.

Pairwise compatibility graphs Motivated by uniform sampling from phylogenetic trees in bioinformatics, Kearney, Munro, and Phillips [13] defined pairwise compatibility graphs. A graph \(G=(V,E)\) is a pairwise compatibility graph if there exists a quadruple (T, \(\mathtt {w}\), \(\mathtt {lb}\), \(\mathtt {ub}\)), where T is a tree, \(\mathtt {w}:E(T) \rightarrow \mathbb {R}\), and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\), such that the set of leaves in T coincides with V and \(uv \in E\) if and only if the (weighted) distance \(d_{T}(u, v)\) between u and v in T satisfies \(\mathtt {lb}\le d_{T}(u,v) \le \mathtt {ub}\). Since its introduction, several authors have studied properties of pairwise compatibility graphs, but the existence of a polynomial-time recognition algorithm for that graph class has been open. The survey article by Calamoneri and Sinaimeri [4] proposed to look at the class of pairwise compatibility graphs defined on stars (i.e., star pairwise compatibility graphs), and asked for a characterization of star pairwise compatibility graphs. As we will see later, the star pairwise compatibility graphs are precisely the double-threshold graphs (see Observation 2.2).

Polynomial-time recognition of double-threshold graphs Xiao and Nagamochi [26] solved the open problem of Calamoneri and Sinaimeri [4] by giving a vertex-ordering characterization and an \(O(n^{3} m)\)-time recognition algorithm for star pairwise compatibility graphs, where n an m are the numbers of vertices and edges, respectively. Their result also answered the question by Jamison and Sprague [12] about the recognition of double-threshold graphs by the equivalence of the graph classes. In this paper, we further improve the running time to \(O(m+n)\).

Other generalizations of threshold graphs There are many other generalizations of threshold graphs such as bithreshold graphs [8], threshold signed graphs [3], threshold tolerance graphs [17], quasi-threshold graphs (also known as trivially perfect graphs) [27], weakly threshold graphs [1], paired threshold graphs [20], and mock threshold graphs [2]. We omit the definitions of these graph classes and only note that some small graphs show that these classes are incomparable to the class of double-threshold graphs (e.g., \(3K_{2}\) and the bull for bithreshold graphs, \(3K_{2}\) and the bull for threshold signed graphs, \(2K_{2}\) and the bull for threshold tolerance graphs, \(C_{4}\) and \(2 K_{3}\) for quasi-threshold graphs, \(2K_{2}\) and the bull for weakly threshold graphs, \(C_{4}\) and the bull for paired threshold graphs, \(K_{3} \cup C_{4}\) and the bull for mock threshold graphsFootnote 1).

Note that the concept of double-threshold digraphs [7] is concerned with directed acyclic graphs defined from a generalization of semiorders involving two thresholds and not related to threshold graphs or double-threshold graphs.

Organization of the paper We first review in Sect. 2 some known relationships between double-threshold graphs and permutation graphs, and then show that connected bipartite permutation graphs admit representations with some restrictions that we use in subsequent sections. In Sect. 3, which is the main body of this paper, we give a new characterization of double-threshold graphs. Using the characterization, we present in Sect. 4 a simple linear-time algorithm for recognizing double-threshold graphs.

Graph classes In Fig. 1, we summarize the inclusion relations among some of the graph classes mentioned so far. We can see that the class of double-threshold graphs connects several other graph classes studied before.

Fig. 1
figure 1

The hierarchy of graph classes mentioned in the introduction. The class of the edge-intersections of two threshold graphs is abbreviated as \(\text {threshold} \cap \text {threshold}\). A line segment between two classes indicates that the one below is a subclass of the one above

2 Preliminaries

All graphs in this paper are undirected, simple, and finite. A graph G is given by the pair of its vertex set V and its edge set E as \(G=(V,E)\). The vertex set and the edge set of G are often denoted by V(G) and E(G), respectively. For a vertex v in a graph \(G = (V,E)\), its neighborhood is the set of vertices that are adjacent to v, and denoted by \(N_{G}(v) = \{ u \mid uv \in E\}\). When the graph G is clear from the context, we often omit the subscript. A linear ordering \(\prec \) on a set S with \(|S| = n\) can be represented by a sequence \(\langle s_{1}, s_{2}, \ldots , s_{n} \rangle \) of the elements in S, in which \(s_{i} \prec s_{j}\) if and only if \(i< j\). With abuse of notation, we sometimes write \({\prec } = \langle s_{1}, s_{2}, \ldots , s_{n} \rangle \).

2.1 Double-Threshold Graphs

A graph \(G=(V,E)\) is a threshold graph if there exist a vertex-weight function \(\mathtt {w}:V \rightarrow \mathbb {R}\) and a real number \(\mathtt {lb}\in \mathbb {R}\) with the following property:

$$\begin{aligned} uv \in E \iff \mathtt {lb}\le \mathtt {w}(u) + \mathtt {w}(v). \end{aligned}$$

A graph \(G=(V,E)\) is a double-threshold graph if there exist a vertex-weight function \(\mathtt {w}:V \rightarrow \mathbb {R}\) and two real numbers \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) with the following property:

$$\begin{aligned} uv \in E \iff \mathtt {lb}\le \mathtt {w}(u) + \mathtt {w}(v) \le \mathtt {ub}. \end{aligned}$$

Then, we say that the double-threshold graph G is defined by \(\mathtt {w}\), \(\mathtt {lb}\) and \(\mathtt {ub}\).

Jamison and Sprague [12] showed that we can use any values as \(\mathtt {lb}\) and \(\mathtt {ub}\) for defining a double-threshold graph and that we do not have to consider degenerated cases, where some vertices have the same weight or some weight sum equals to the lower or upper bound.

Lemma 2.1

[12] Let \(G = (V,E)\) be a double-threshold graph. For every pair \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) with \(\mathtt {lb}< \mathtt {ub}\), there exists \(\mathtt {w}:V \rightarrow \mathbb {R}\) defining G with \(\mathtt {lb}\) and \(\mathtt {ub}\) such that \(\mathtt {w}(u) \ne \mathtt {w}(v)\) if \(u \ne v\), and \(\mathtt {w}(u) + \mathtt {w}(v) \notin \{\mathtt {lb}, \mathtt {ub}\}\) for all \((u,v) \in V^{2}\).

Every threshold graph is a double-threshold graph as one can set a dummy upper bound \(\mathtt {ub}> \max \{\mathtt {w}(u) + \mathtt {w}(v) \mid u,v \in V\}\). From the definition of double-threshold graphs, we can easily see that they coincide with the star pairwise compatibility graphs.

Observation 2.2

A graph is a double-threshold graph if and only if it is a star pairwise compatibility graph.

Proof

Let \(G = (V,E)\) be a double-threshold graph defined by \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\). We construct an edge-weighted star S with the center c and the leaf set V such that the weight \(\mathtt {w}'(vc)\) of each edge \(vc \in E(S)\) is \(\mathtt {w}(v)\). Then, G is the star pairwise compatibility graph defined by \((S, \mathtt {w}',\mathtt {lb},\mathtt {ub})\).

Let \(G = (V,E)\) be a star pairwise compatibility graph defined by \((S, \mathtt {w}, \mathtt {lb}, \mathtt {ub})\), where the star S has c as its center. For each \(v \in V\), we set \(\mathtt {w}'(v) = \mathtt {w}(vc)\). Then, G is the double-threshold graph defined by \(\mathtt {w}'\), \(\mathtt {lb}\), and \(\mathtt {ub}\). \(\square \)

Observation 2.2 allows us to state the following useful property shown by Xiao and Nagamochi [26] in terms of double-threshold graphs.

Lemma 2.3

[26] A graph is a double-threshold graph if and only if it contains at most one non-bipartite component and all components are double-threshold graphs.

The following simple observation is useful when we conduct a detailed analysis on a specific triple \(\mathtt {w}\), \(\mathtt {lb}\), \(\mathtt {ub}\) defining a double-threshold graph.

Observation 2.4

Let \(G = (V,E)\) be a double-threshold graph defined by \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\). If \(\mathtt {w}(x) \le \mathtt {w}(y) \le \mathtt {w}(z)\) and \(xy, yz \in E\) hold for distinct vertices \(x,y,z \in V\), then \(xz \in E\).

Proof

Since \(\mathtt {lb}\le \mathtt {w}(x) + \mathtt {w}(y) \le \mathtt {w}(x) + \mathtt {w}(z) \le \mathtt {w}(y) + \mathtt {w}(z) \le \mathtt {ub}\), we have \(xz \in E\).

\(\square \)

The definition of double-threshold graphs can be understood visually in the plane, by its so called slab representation. See Fig. 2 for an example. In the xy-plane, we consider the slab defined by \(\{(x,y) \mid \mathtt {lb}\le x+y \le \mathtt {ub}\}\) that is illustrated in gray. Then, two vertices \(u,v \in V\) are joined by an edge if and only if the point \((\mathtt {w}(u),\mathtt {w}(v))\) lies in the slab.

Fig. 2
figure 2

(Left) A double-threshold graph. The weight of each vertex is given as \(\mathtt {w}(a)=1\), \(\mathtt {w}(b)=3\), \(\mathtt {w}(c)=5\), and \(\mathtt {w}(d)=7\); the lower bound is \(\mathtt {lb}=4\) and the upper bound is \(\mathtt {ub}=8\). (Right) The slab representation of the graph. A white dot represents the point \((\mathtt {w}(u),\mathtt {w}(v))\) for distinct vertices uv, and a cross represents the point \((\mathtt {w}(v),\mathtt {w}(v))\) for a vertex v. Two distinct vertices u and v are joined by an edge if and only if the corresponding white dot lies in the gray slab

2.2 Permutation Graphs

A graph \(G=(V,E)\) is a permutation graph if there exist linear orderings \(\prec _1\) and \(\prec _2\) on V with the following property:

$$\begin{aligned} uv \in E \iff (u \prec _1 v \text { and } v \prec _2 u) \text { or } (u \prec _2 v \text { and } v \prec _1 u). \end{aligned}$$
(1)

A graph is a bipartite permutation graph if it is a bipartite graph and a permutation graph. It is known that every permutation graph admits a transitive orientation [6], which gives a direction to each edge in such a way that the existence of directed edges from x to y and from y to z implies a directed edge from x to z as well.

Jamison and Sprague [11] showed that permutation graphs and bipartite permutation graphs have strong connections to double-threshold graphs as follows.

Lemma 2.5

[11] Every double-threshold graph is a permutation graph.

Lemma 2.6

[11] The bipartite double-threshold graphs are exactly the bipartite permutation graphs.

We say that the orderings \(\prec _{1}\) and \(\prec _{2}\) in (1) define the permutation graph G. We call \(\prec _{1}\) a permutation ordering of G if there exists a linear ordering \(\prec _{2}\) satisfying the condition above. Since \(\prec _{1}\) and \(\prec _{2}\) play a symmetric role in the definition, \(\prec _{2}\) is also a permutation ordering of G. Note that for a graph G and a permutation ordering \(\prec _{1}\) of G, the other ordering \(\prec _{2}\) that defines G together with \(\prec _{1}\) is uniquely determined. Also note that if \(\prec _{1}\) and \(\prec _{2}\) define G, then \(\prec _{1}^{\mathrm {R}}\) and \(\prec _{2}^{\mathrm {R}}\) also define G, where \(\prec _{i}^{\mathrm {R}}\) denotes the reversed ordering of \(\prec _{i}\).

We often represent a permutation graph with a permutation diagram, which is drawn as follows (see Fig. 3 for an illustration). Imagine two horizontal parallel lines \(\ell _1\) and \(\ell _2\) on the plane. Then, we place the vertices in V on \(\ell _1\) from left to right according to the permutation ordering \(\prec _1\) as distinct points, and similarly place the vertices in V on \(\ell _2\) from left to right according to \(\prec _2\) as distinct points. The positions of \(v\in V\) can be represented by x-coordinates on \(\ell _{1}\) and \(\ell _{2}\), which are denoted by \(\mathtt {x}_{1}(v)\) and \(\mathtt {x}_{2}(v)\), respectively. We connect the two points representing the same vertex with a line segment. The process results in a diagram (called a permutation diagram) with |V| line segments. By definition, \(uv \in E\) if and only if the line segments representing u and v cross in the permutation diagram, which is equivalent to the inequality \((\mathtt {x}_1(u)-\mathtt {x}_1(v)) (\mathtt {x}_2(u)-\mathtt {x}_2(v)) < 0\).

Fig. 3
figure 3

An example of a permutation diagram. (Left) A permutation graph G. (Right) A permutation diagram that represents G

Conversely, from a permutation diagram of G, we can extract linear orderings \(\prec _{1}\) and \(\prec _{2}\) as

$$\begin{aligned} \mathtt {x}_1(u)< \mathtt {x}_1(v)&\iff u \prec _{1} v,\\ \mathtt {x}_2(u) < \mathtt {x}_2(v)&\iff u \prec _{2} v. \end{aligned}$$

When those conditions are satisfied, we say that the orderings of the x-coordinates on \(\ell _1\) and \(\ell _2\) are consistent with the linear orderings \(\prec _{1}\) and \(\prec _{2}\), respectively.

Although a permutation graph may have an exponential number of permutation orderings, it is essentially unique for a connected bipartite permutation graph in the sense of Lemma 2.7 below. For a graph \(G = (V,E)\), linear orderings \(\langle v_{1}, \ldots , v_{n} \rangle \) and \(\langle v'_{1}, \ldots , v'_{n} \rangle \) on V are neighborhood-equivalent if \(N(v_{i}) = N(v'_{i})\) for all i.

Lemma 2.7

[9] Let G be a connected bipartite permutation graph defined by \(\prec _{1}\) and \(\prec _{2}\). Then, every permutation ordering of G is neighborhood-equivalent to \(\prec _{1}\), \(\prec _{2}\), \(\prec _{1}^{\mathrm {R}}\), or \(\prec _{2}^{\mathrm {R}}\).

A bipartite graph (XYE) is a unit interval bigraph if there is a set of unit intervals \(\{I_{v} = [l_{v}, l_{v}+1] \mid v \in X \cup Y\}\) such that \(xy \in E\) if and only if \(I_{x} \cap I_{y} \ne \emptyset \) for \(x \in X\) and \(y \in Y\). The class of unit interval bigraphs is known to be equal to the class of bipartite permutation graphs.

Proposition 2.8

[10, 21, 25] A graph is a bipartite permutation graph if and only if it is a unit interval bigraph.

The following lemma shows that a bipartite permutation graph can be represented by a permutation diagram with the special property that the segments representing vertices of the same set of the bipartition are parallel. An illustration is given in Fig. 4.

Fig. 4
figure 4

An illustration of Lemma 2.9. (Left) A permutation diagram of a bipartite permutation graph \(G=(X,Y;E)\). The vertices in X are represented by blue segments, and the vertices in Y are represented by red segments. (Right) A permutation diagram that represents G obtained by Lemma 2.9

Lemma 2.9

Let \(G=(X, Y; E)\) be a bipartite permutation graph. Then, G can be represented by a permutation diagram in which \(\mathtt {x}_{2}(x)=\mathtt {x}_{1}(x)+1\) for \(x \in X\) and \(\mathtt {x}_{2}(y)=\mathtt {x}_{1}(y)-1\) for \(y \in Y\).

Proof

By Proposition 2.8, there is a set of unit intervals \(\{I_{v} = [l_{v}, l_{v}+1] \mid v \in X \cup Y\}\) such that for \(x \in X\) and \(y \in Y\), \(xy \in E\) if and only if \(I_{x} \cap I_{y} \ne \emptyset \). We can assume that all endpoints of the intervals are distinct; that is, \(l_{u} \notin \{l_{v}, l_{v}+1\}\) for all \(u,v \in X \cup Y \) with \(u \ne v\) [25]. For each \(x \in X\), we set \(\mathtt {x}_{1}(x) = l_{x}\) and \(\mathtt {x}_{2}(x) = l_{x} + 1\). For each \(y \in Y\), we set \(\mathtt {x}_{1}(y) = l_{y}+1\) and \(\mathtt {x}_{2}(y) = l_{y}\). It suffices to show that this permutation diagram represents G. Observe that line segments corresponding to vertices from the same set, X or Y, are parallel and thus do not cross. For \(x \in X\) and \(y \in Y\), we have

$$\begin{aligned} I_{x} \cap I_{y} \ne \emptyset&\iff |l_{x} - l_{y}|< 1&(\because \text { all endpoints are distinct}) \\&\iff l_{x}< l_{y} + 1 \text { and } l_{y}< l_{x} + 1 \\&\iff \mathtt {x}_{1}(x)< \mathtt {x}_{1}(y) \text { and } \mathtt {x}_{2}(y)< \mathtt {x}_{2}(x)&(\because x \in X, \ y \in Y) \\&\iff (\mathtt {x}_{1}(x)-\mathtt {x}_{1}(y)) (\mathtt {x}_{2}(x)-\mathtt {x}_{2}(y)) < 0. \end{aligned}$$

The \(\Leftarrow \) direction of the last equivalence holds since \(\mathtt {x}_{1}(x) < \mathtt {x}_{2}(x)\) and \(\mathtt {x}_{1}(y) > \mathtt {x}_{2}(y)\). Therefore, we conclude that the diagram represents G. \(\square \)

We can show that for every permutation ordering of a connected bipartite permutation graph, there exists a permutation diagram consistent with the ordering that satisfies the conditions in Lemma 2.9.

Corollary 2.10

Let \(G=(X, Y; E)\) be a connected bipartite permutation graph defined by permutation orderings \(\prec _{1}\) and \(\prec _{2}\). If the first vertex in \(\prec _{1}\) belongs to X, then G can be represented by a permutation diagram such that the orderings of the x-coordinates on \(\ell _{1}\) and \(\ell _{2}\) are consistent with \(\prec _{1}\) and \(\prec _{2}\), respectively, and that \(\mathtt {x}_2(x)=\mathtt {x}_1(x)+1\) for every \(x\in X\) and \(\mathtt {x}_2(y)=\mathtt {x}_1(y)-1\) for every \(y\in Y\).

Proof

Since G is connected, the last vertex in \(\prec _{1}\) belongs to Y, the first vertex in \(\prec _{2}\) belongs to Y, and the last vertex in \(\prec _{2}\) belongs to X.

By Lemma 2.9, G can be represented by a permutation diagram \(D'\) in which \(\mathtt {x}_{2}(x)=\mathtt {x}_{1}(x)+1\) for \(x \in X\) and \(\mathtt {x}_{2}(y)=\mathtt {x}_{1}(y)-1\) for \(y \in Y\). Let \(\prec '_{1}\) and \(\prec '_{2}\) be the permutation orderings corresponding to \(\ell _{1}\) and \(\ell _{2}\), respectively, in this diagram \(D'\). Lemma 2.7 and the assumption on the first vertex in \(\prec _{1}\) imply that \(\prec _{1}\) is neighborhood-equivalent to \(\prec '_{1}\) or \((\prec '_{2})^{R}\). We may assume that \(\prec _{1}\) is neighborhood-equivalent to \(\prec '_{1}\) since otherwise we can rotate the diagram \(D'\) by 180 degrees and get a permutation diagram of G in which the ordering on \(\ell _{1}\) is \(\prec _{1}\), \(\mathtt {x}_{2}(x)=\mathtt {x}_{1}(x)+1\) for \(x \in X\), and \(\mathtt {x}_{2}(y)=\mathtt {x}_{1}(y)-1\) for \(y \in Y\).

Now we can construct a desired permutation diagram of G using \(\prec _{1}\) and \(D'\) by appropriately giving a mapping between segments and vertices. That is, for each \(i \in \{1, \ldots , |X \cup Y|\}\), we assign the ith vertex in \(\prec _{1}\) to the segment in \(D'\) with the ith smallest x-coordinate on \(\ell _1\). This new diagram is a permutation diagram of G since \(\prec _{1}\) is neighborhood-equivalent to \(\prec '_{1}\). Since G and \(\prec _{1}\) uniquely determine the ordering on \(\ell _{2}\), the x-coordinates \(\mathtt {x}_{2}\) on \(\ell _{2}\) are consistent with \(\prec _{2}\). \(\square \)

3 New Characterization

In this section, we present a new characterization of double-threshold graphs (Theorem 3.1). This is one of our main results and a key ingredient of the linear-time algorithm given in the next section. Recall that Lemma 2.6 characterizes the bipartite double-threshold graphs as the bipartite permutation graphs, which can be recognized in linear time [22, 23]. Thus, we are going to focus on non-bipartite graphs in this section.

Let \(G=(V,E)\) be a graph. From G and a vertex subset \(M \subseteq V\), we construct an auxiliary bipartite graph \(G'_{M}=(V',E')\) defined as follows (see Fig. 5):

$$\begin{aligned} V'&= \{v,\overline{v} \mid v \in V\},&E'&= \{u\overline{v} \mid uv \in E\} \cup \{v\overline{v} \mid v \in M\}. \end{aligned}$$

Note that \((V, \{\overline{v} \mid v \in V\})\) is a bipartition of \(G'_{M}\) no matter what M is.

Fig. 5
figure 5

An example of an auxiliary bipartite graph. (Left) A graph G and \(M=\{e,f\}\). (Right) The auxiliary bipartite graph \(G'_M\)

An efficient maximum clique K of a graph G is a maximum clique (i.e., a clique of the maximum size) that minimizes the degree sum \(\sum _{v \in K} \deg _{G}(v)\). See Fig. 6.

Fig. 6
figure 6

An example of an efficient maximum clique. (Left) A slab representation of a double-threshold graph G. (Right) The vertices of G are ordered in the increasing order of their weights. The graph G has two maximum cliques \(Q_1=\{c,e,f,g\}\) and \(Q_2=\{d,e,f,g\}\). The degree sums are \(\sum _{v \in Q_1}\deg _G(v) = 5+4+4+4 = 17\), and \(\sum _{v \in Q_2}\deg _G(v) = 4+4+4+4 = 16\). Therefore, \(Q_2\) is the only efficient maximum clique of G

Using these terms, we present a characterization of non-bipartite double-threshold graphs as follows.

Theorem 3.1

For a non-bipartite graph G, the following are equivalent.

  1. 1.

    G is a double-threshold graph.

  2. 2.

    For every efficient maximum clique M of G, the graph \(G'_{M}\) is a bipartite permutation graph.

  3. 3.

    For some efficient maximum clique M of G, the graph \(G'_{M}\) is a bipartite permutation graph.

The rest of this section is devoted to a proof of Theorem 3.1. The following is a quick overview of the proof steps (some terms will be defined later).

  1. 1.

    We first prove the key lemma (Lemma 3.3) ensuring that a graph is a double-threshold graph if and only if \(G'_{M}\) is a permutation graph with a “symmetric” permutation diagram, where \(M \subseteq V\) is the set of “mid-weight” vertices.

  2. 2.

    We then show that every efficient maximum clique can be the set of mid-weight vertices by proving a couple of lemmas (Lemmas 3.4 and 3.6).

  3. 3.

    Next, we show that the symmetry required in the key lemma follows for free if M is a clique (Lemma 3.10), which is true when we set M to be the set of mid-weight vertices.

  4. 4.

    Finally, we complete the proof of Theorem 3.1 by putting everything together.

We start with the following simple but useful fact.

Lemma 3.2

For a connected non-bipartite graph \(G=(V, E)\) and a vertex subset \(M \subseteq V\), \(G'_{M}\) is connected.

Proof

For any \(u, v \in V\), since G is connected and non-bipartite, G contains both an odd walk and an even walk from u to v. This shows that \(G'_{M}\) contains walks from u to v, from u to \({\bar{v}}\), from \({\bar{u}}\) to v, and from \({\bar{u}}\) to \({\bar{v}}\). Hence, \(G'_{M}\) is connected. \(\square \)

For the auxiliary graph \(G'_{M} = (V', E')\) of \(G=(V,E)\), a linear ordering on \(V'\) represented by \(\langle w_1, w_2, \ldots , w_{2n} \rangle \) is symmetric if \(w_i=v\) implies \(w_{2n-i+1}={\bar{v}}\) for any \(v \in V\) and any \(i \in \{1,2,\ldots , 2n\}\).

Lemma 3.3

Let \(G=(V,E)\) be a non-bipartite graph and \(M \subseteq V\). The following are equivalent.

  1. 1.

    G is a double-threshold graph defined by \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb},\mathtt {ub}\in \mathbb {R}\) such that \(M = \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\).

  2. 2.

    The auxiliary graph \(G'_{M} = (V',E')\) can be represented by a permutation diagram in which both orderings \(\prec _1\) and \(\prec _2\) are symmetric.

Proof

(1 \(\implies \) 2) An illustration is given in Fig. 7. Let G be a double-threshold graph defined by \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) such that \(M = \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\). By Lemma 2.1, we can assume that \(\mathtt {lb}= 0\) and \(\mathtt {ub}= 2\), that \(\mathtt {w}(u) + \mathtt {w}(v) \notin \{0,2\}\) for every \((u,v) \in V^{2}\), and that \(\mathtt {w}(u) \ne \mathtt {w}(v)\) if \(u \ne v\). We construct a permutation diagram of \(G'_{M}\) as follows. Let \(\ell _{1}\) and \(\ell _{2}\) be two horizontal parallel lines. For each vertex \(w \in V'\), we set the x-coordinates \(\mathtt {x}_{1}(w)\) and \(\mathtt {x}_{2}(w)\) on \(\ell _{1}\) and \(\ell _{2}\) as follows: for any \(v\in V\),

$$\begin{aligned} \mathtt {x}_1(v)&=\mathtt {w}(v)-1,&\mathtt {x}_1({\bar{v}})&=1-\mathtt {w}(v), \\ \mathtt {x}_2(v)&=\mathtt {w}(v),&\mathtt {x}_2({\bar{v}})&=-\mathtt {w}(v). \end{aligned}$$

Since \(\mathtt {w}(u) + \mathtt {w}(v) \notin \{0,2\}\) for every \((u,v) \in V^{2}\) and \(\mathtt {w}(u) \ne \mathtt {w}(v)\) if \(u \ne v\), the x-coordinates are distinct on \(\ell _{1}\) and on \(\ell _{2}\). By connecting \(\mathtt {x}_{1}(w)\) and \(\mathtt {x}_{2}(w)\) with a line segment for each \(w \in V'\), we get a permutation diagram. The line segments corresponding to the vertices in V have negative slopes, and the ones corresponding to the vertices in \(V' {\setminus } V\) have positive slopes. Thus, for any two vertices \(u,v \in V\), the line segments corresponding to u and \(\bar{v}\) cross if and only if both \(\mathtt {x}_1(u) \le \mathtt {x}_1({\bar{v}})\) and \(\mathtt {x}_2(u) \ge \mathtt {x}_2({\bar{v}})\) hold, which is equivalent to \(0 \le \mathtt {w}(u)+\mathtt {w}(v) \le 2\), and thus to \(u \bar{v} \in E'\). Similarly, the line segments corresponding to v and \(\bar{v}\) cross if and only if \(0 \le 2 \mathtt {w}(v) \le 2\), i.e., \(v \in M\). This shows that the obtained permutation diagram represents \(G'_{M}\). Let \(\prec _{1}\) be the ordering on \(V'\) defined by \(\mathtt {x}_{1}\). Since \(\mathtt {x}_{1}(v) = - \mathtt {x}_{1}(\bar{v})\) for each \(v \in V\), \(\prec _{1}\) is symmetric. Similarly, the ordering \(\prec _{2}\) defined by \(\mathtt {x}_{2}\) is symmetric.

(2 \(\implies \) 1) Suppose we are given a permutation diagram of \(G'_{M}\) in which both \(\prec _1\) and \(\prec _2\) are symmetric. We may assume by symmetry that the first vertex in \(\prec _{1}\) belongs to V. Since \(G'_{M}\) is connected by Lemma 3.2, Corollary 2.10 shows that we can represent \(G'_{M}\) by a permutation diagram in which the x-coordinates \(\mathtt {x}_{1}\) and \(\mathtt {x}_{2}\) on \(\ell _{1}\) and \(\ell _{2}\) satisfy that

$$\begin{aligned} \mathtt {x}_2(v)=\mathtt {x}_1(v)+1 \quad \text{ and } \quad \mathtt {x}_2({\bar{v}})=\mathtt {x}_1({\bar{v}})-1 \quad (v\in V) \end{aligned}$$
(2)

and that the orderings of the x-coordinates on \(\ell _{1}\) and \(\ell _{2}\) are consistent with \(\prec _{1}\) and \(\prec _{2}\), respectively. Since \(\prec _{1}\) is symmetric, if \(u, v \in V\) are the ith and the jth vertices in \(\prec _{1}\), then \(\bar{u}, \bar{v}\) are the \((2n-i+1)\)st and the \((2n-j+1)\)st vertices in \(\prec _{1}\). Since \(i < 2n-j+1\) is equivalent to \(j < 2n-i+1\), we have that \(u \prec _{1} \bar{v}\) if and only if \(v \prec _{1} \bar{u}\). As \(\mathtt {x}_{1}\) is consistent with \(\prec _{1}\), it holds for \(u, v \in V\) that \(\mathtt {x}_1(u) \le \mathtt {x}_1({\bar{v}})\) if and only if \(\mathtt {x}_1(v) \le \mathtt {x}_1({\bar{u}})\), and hence

$$\begin{aligned} \mathtt {x}_1(u) \le \mathtt {x}_1({\bar{v}}) \iff \mathtt {x}_1(u)+\mathtt {x}_1(v) \le \mathtt {x}_1({\bar{v}})+\mathtt {x}_1({\bar{u}}). \end{aligned}$$

Similarly, we can show that for \(u,v \in V\),

$$\begin{aligned} \mathtt {x}_2(u) \ge \mathtt {x}_2({\bar{v}}) \iff \mathtt {x}_2(u)+\mathtt {x}_2(v) \ge \mathtt {x}_2({\bar{v}})+\mathtt {x}_2({\bar{u}}). \end{aligned}$$

Thus, for any two distinct vertices \(u,v \in V\), it holds that

$$\begin{aligned} uv \in E&\iff u{\bar{v}} \in E' \nonumber \\&\iff \mathtt {x}_1(u) \le \mathtt {x}_1({\bar{v}}) \text{ and } \mathtt {x}_2(u) \ge \mathtt {x}_2({\bar{v}}) \nonumber \\&\iff \mathtt {x}_1(u)+\mathtt {x}_1(v) \le \mathtt {x}_1({\bar{v}}) + \mathtt {x}_1({\bar{u}}) \text{ and } \mathtt {x}_2(u)+\mathtt {x}_2(v) \ge \mathtt {x}_2({\bar{v}})+\mathtt {x}_2({\bar{u}}). \end{aligned}$$
(3)

For each \(v\in V\), define

$$\begin{aligned} \mathtt {w}(v)= \frac{\mathtt {x}_2(v)-\mathtt {x}_2({\bar{v}})}{2}. \end{aligned}$$

By (2), we can see that (3) is equivalent to

$$\begin{aligned} 0 \le \mathtt {w}(u)+\mathtt {w}(v) \le 2, \end{aligned}$$

which shows that \(\mathtt {w}\), \(\mathtt {lb}=0\), and \(\mathtt {ub}= 2\) define G. Furthermore, for any \(v\in V\),

$$\begin{aligned} v \in M&\iff v {\bar{v}} \in E' \\&\iff \mathtt {x}_1(v) \le \mathtt {x}_1({\bar{v}}) \hbox { and } \mathtt {x}_2(v) \ge \mathtt {x}_2({\bar{v}}) \\&\iff 0 \le \mathtt {w}(v) \le 1, \end{aligned}$$

which shows that \(M = \{v \in V \mid 0\le \mathtt {w}(v) \le 1\}\). \(\square \)

Fig. 7
figure 7

An illustration of (1 \(\implies \) 2) in Lemma 3.3. (Top left) A double-threshold graph G with \(M=\{d,e\}\). The auxiliary bipartite graph \(G'_M\) is also depicted. (Top right) A slab representation of G. (Bottom) A permutation diagram of \(G'_M\) as given in the proof

To utilize Lemma 3.3, we need to find the set M of mid-weight vertices; that is, the vertices with weights in the range \([\mathtt {lb}/2, \mathtt {ub}/2]\). The first observation is that M has to be a clique as the weight sum of any two vertices in M is in the range \([\mathtt {lb}, \mathtt {ub}]\). In the following, we show that an efficient maximum clique can be chosen as M. To this end, we first prove that we only need to consider (inclusion-wise) maximal cliques.

Lemma 3.4

For a connected non-bipartite double-threshold graph \(G = (V,E)\), there exist \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) defining G such that \(\{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\) is a maximal clique of G.

Proof

Let G be a non-bipartite double-threshold graph \(G = (V,E)\) defined by \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\). Let \(M = \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\). We choose \(\mathtt {w}\), \(\mathtt {lb}\), and \(\mathtt {ub}\) in such a way that for any \(\mathtt {w}':V \rightarrow \mathbb {R}\) and \(\mathtt {lb}', \mathtt {ub}' \in \mathbb {R}\) defining G, M is not a proper subset of \(\{v \in V \mid \mathtt {lb}'/2 \le \mathtt {w}'(v) \le \mathtt {ub}'/2\}\). Suppose to the contrary that M is not a maximal clique of G. Observe that if \(M = \emptyset \), then V can be partitioned into two independent sets \(\{v \in V \mid \mathtt {w}(v) < \mathtt {lb}/2\}\) and \(\{v \in V \mid \mathtt {w}(v) > \mathtt {ub}/2\}\), which is a contradiction to the non-bipartiteness of G. Hence, M is non-empty.

Let \(G'_{M}\) be the auxiliary graph constructed from G and M as before. By Lemma 3.3, \(G'_{M}\) has a permutation diagram in which both \({\prec _{1}} = \langle w_{1}, \ldots , w_{2n} \rangle \) and \({\prec _{2}} = \langle w'_{1}, \ldots , w'_{2n} \rangle \) are symmetric. Let \(\overline{M} = \{\bar{v} \mid v \in M\}\). By the definition of \(G'_{M}\), \(M \cup \overline{M}\) induces a complete bipartite graph in \(G'_{M}\). By symmetry, we may assume that \(M \prec _{1} \overline{M}\) and \(\overline{M} \prec _{2} M\). That is, in \(\prec _{1}\) all vertices in M appear before any vertex in \(\overline{M}\) appears, and in \(\prec _{2}\) all vertices in \(\overline{M}\) appear before any vertex in M appears. Note that these assumptions imply that for each edge \(x \bar{y} \in E(G'_{M})\), \(x \prec _{1} \bar{y}\) and \(\bar{y} \prec _{2} x\) hold since \(G'_{M}\) is connected by Lemma 3.2 (see Fig. 8 (Left)).

As M is not a maximal clique in G, there is a vertex \(v \notin M\) such that \(M \subseteq N_{G}(v)\). If \(\bar{v} \prec _{1} v\), then we have

$$\begin{aligned} M \prec _{1} \bar{v} \prec _{1} v \prec _{1} \overline{M} \quad \text { and } \quad \bar{v} \prec _{2} \overline{M} \prec _{2} M \prec _{2} v \end{aligned}$$
(4)

since \(v \bar{v} \notin E(G'_{M})\), \(\overline{M} \subseteq N_{G'_{M}}(v)\), and \(M \subseteq N_{G'_{M}}(\bar{v})\). Similarly, if \(v \prec _{1} \bar{v}\), then we have

$$\begin{aligned} v \prec _1 M \prec _{1} \overline{M} \prec _{1} \bar{v} \quad \text { and } \quad \overline{M} \prec _{2} v \prec _{2} \bar{v} \prec _{2} M, \end{aligned}$$

or equivalently,

$$\begin{aligned} M \prec _{2}^{R} \bar{v} \prec _{2}^{R} v \prec _{2}^{R} \overline{M} \quad \text { and } \quad \bar{v} \prec _{1}^{R} \overline{M} \prec _{1}^{R} M \prec _{1}^{R} v. \end{aligned}$$

Thus, by replacing \(\prec _{1}\) with \(\prec _{2}^{R}\) and \(\prec _{2}\) with \(\prec _{1}^{R}\) if necessary, we may assume that (4) holds (see Fig. 8 (Left)). We further assume that v has the smallest position in \(\prec _{1}\) under these conditions. \(\square \)

Claim 3.5

\(w_{n+1} = v\) (and thus \(w_{n} = \bar{v}\)).

Proof

(Claim 3.5) By the symmetry of \(\langle w_{1}, \ldots , w_{2n} \rangle \), it suffices to show that there is no vertex \(x \in V\) such that \(\bar{v} \prec _{1} x \prec _{1} v\). Suppose that such a vertex x exists. In \(G'_{M}\), x is not adjacent to \(\bar{v}\). This implies that \(xv \notin E\), and hence \(x \notin M\). On the other hand, in \(G'_{M}\), x is adjacent to all vertices in \(\overline{M}\). Thus, we have \(M \subseteq N_{G}(x)\). This contradicts that v has the smallest position in \(\prec _{1}\) under those conditions. \(\square \)

Now we obtain \(\prec '_{1}\) from \(\prec _{1}\) by swapping v and \(\bar{v}\) (see Fig. 8 (Right)). By Claim 3.5, this new ordering \(\prec '_{1}\) gives (together with \(\prec _{2}\)) the graph obtained from \(G'_{M}\) by adding the edge \(v\bar{v}\). Observe that this new graph can be expressed as \(G'_{M \cup \{v\}}\). Since \(\prec '_{1}\) and \(\prec _{2}\) are symmetric, Lemma 3.3 implies that there are \(\mathtt {w}':V \rightarrow \mathbb {R}\) and \(\mathtt {lb}', \mathtt {ub}' \in \mathbb {R}\) defining G such that \(\{u \in V \mid \mathtt {lb}'/2 \le \mathtt {w}'(u) \le \mathtt {ub}'/2\} = M \cup \{v\}\). This contradicts the choice of \(\mathtt {w}\), \(\mathtt {lb}\), and \(\mathtt {ub}\).

Fig. 8
figure 8

(Left) Relative positions of v, \(\bar{v}\), M, and \(\overline{M}\). (Right) \(\prec '_{1}\) is obtained from \(\prec _{1}\) by swapping v and \(\bar{v}\)

We show that every efficient maximum clique can be the set of mid-weight vertices, given an appropriate choice of \(\mathtt {w}\), \(\mathtt {lb}\), and \(\mathtt {ub}\).

Lemma 3.6

Let G be a non-bipartite double-threshold graph. For every efficient maximum clique K of G, there exist \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) defining G such that \(K = \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\).

Proof

Let K be an efficient maximum clique of G. By Lemma 2.5, G is a permutation graph, and thus cannot contain an induced odd cycle of length 5 or more [6]. As G is non-bipartite, G contains \(K_{3}\). This implies that \(|K| \ge 3\).

By Lemma 3.4, there exist \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) defining G such that \(M := \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\) is a maximal clique of G. Assume that \(\mathtt {w}\), \(\mathtt {lb}\), and \(\mathtt {ub}\) are chosen so that the size of the symmetric difference \(|M \vartriangle K| = |M {\setminus } K| + |K {\setminus } M|\) is minimized. Assume that \(K \ne M\) since otherwise we are done. This implies that \(K \not \subseteq M\) and \(K \not \supseteq M\) as both K and M are maximal cliques. Observe that \(G - M\) is bipartite. This implies that \(|K {\setminus } M| \in \{1,2\}\) and that \(K \cap M \ne \emptyset \) as \(|K| \ge 3\). Since K is a maximum clique, \(|M {\setminus } K| \le |K {\setminus } M|\) holds.

Let \(u \in K {\setminus } M\). By symmetry, we may assume that \(\mathtt {w}(u) < \mathtt {lb}/2\). Note that no other vertex in K has weight less than \(\mathtt {lb}/2\) as K is a clique. Let \(v \in M\) be a non-neighbor of u that has the minimum weight among such vertices. Such a vertex exists since M is a maximal clique. Note that \(v \in M {\setminus } K\).

We now observe that v has the minimum weight in M. If \(w \in M\) is a non-neighbor of u, then \(\mathtt {w}(v) \le \mathtt {w}(w)\) follows from the definition of v. If \(w \in M\) is a neighbor of u, then \(\mathtt {w}(v) < \mathtt {w}(w)\) holds, since otherwise \(\mathtt {w}(u) < \mathtt {lb}/2 \le \mathtt {w}(w) \le \mathtt {w}(v)\) and \(uw, wv \in E\) imply that \(uv \in E\) by Observation 2.4.

We are going to show that \(N(v) = N(u)\). \(\square \)

Claim 3.7

\(N(u) \cap \{x \mid \mathtt {w}(x)< \mathtt {lb}/2\} = N(v) \cap \{x \mid \mathtt {w}(x) < \mathtt {lb}/2\} = \emptyset \).

Proof

(Claim 3.7) Since \(\mathtt {w}(u) < \mathtt {lb}/2\), \(N(u) \cap \{x \mid \mathtt {w}(x) < \mathtt {lb}/2\} = \emptyset \). Suppose to the contrary that v has a neighbor x with \(\mathtt {w}(x) < \mathtt {lb}/2\). The maximality of M implies that x has a non-neighbor \(y \in M\). Since \(y \in M\), \(\mathtt {w}(v) \le \mathtt {w}(y)\) holds. However, \(\mathtt {w}(x) < \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {w}(y)\) and \(xv, vy \in E\) imply \(xy \in E\) by Observation 2.4. \(\square \)

Claim 3.8

\(N(u) \cap M = N(v) \cap M = M {\setminus } \{v\}\).

Proof

(Claim 3.8) Since M is a clique and \(v \in M\), we have \(N(v) \cap M = M {\setminus } \{v\}\). Thus, the claim is equivalent to \(M {\setminus } \{v\} \subseteq N(u)\). This holds if \(M {\setminus } K = \{v\}\). Assume that \(M {\setminus } K = \{v, v'\}\) for some \(v' \ne v\). To show the claim, it suffices to show that \(uv' \in E\).

Since \(|M {\setminus } K| \le |K {\setminus } M| \le 2\), we have \(K {\setminus } M = \{u,u'\}\) for some \(u' \ne u\). Since \(\mathtt {w}(u) < \mathtt {lb}/2\) and \(uu' \in E\), we have \(\mathtt {w}(u') \ge \mathtt {lb}/2\). Moreover since \(u' \notin M\), we have \(\mathtt {w}(u') > \mathtt {ub}/2\). Let \(w \in M \cap K\). If \(\mathtt {w}(w) > \mathtt {w}(v')\), then, by Observation 2.4, we have \(u'v, u'v' \in E\) since \(\mathtt {w}(v) \le \mathtt {w}(v') < \mathtt {w}(w) \le \mathtt {w}(u')\) and \(vw, v'w, wu' \in E\). This implies that \(M \subseteq N(u')\), which contradicts the maximality of M. Hence, \(\mathtt {w}(w) \le \mathtt {w}(v')\) holds. This implies by Observation 2.4 that \(uv' \in E\) as \(\mathtt {w}(u) \le \mathtt {w}(w) \le \mathtt {w}(v')\) and \(uw, wv' \in E\). \(\square \)

Claim 3.9

\(N(u) \cap \{x \mid \mathtt {w}(x)> \mathtt {ub}/2\} \supseteq N(v) \cap \{x \mid \mathtt {w}(x) > \mathtt {ub}/2\}\).

Proof

(Claim 3.9) Let \(w \in K \cap M\). For \(z \in N(v)\) with \(\mathtt {w}(z) > \mathtt {ub}/2\), we have

$$\begin{aligned} \mathtt {lb}\le \mathtt {w}(u) + \mathtt {w}(w) \le \mathtt {w}(u) + \mathtt {ub}/2< \mathtt {w}(u) + \mathtt {w}(z)< \mathtt {lb}/2 + \mathtt {w}(z) < \mathtt {w}(v) + \mathtt {w}(z) \le \mathtt {ub}, \end{aligned}$$

and thus \(z \in N(u)\) holds. \(\square \)

Claims 3.7, 3.8, and 3.9 imply that \(N(v) \subseteq N(u)\). To show that \(N(v) = N(u)\), suppose to the contrary that N(v) is a proper subset of N(u). We show that K cannot be an efficient maximum clique in this case. Let \(K' = K {\setminus } \{u\} \cup \{v\}\). We first argue that \(K'\) is a maximum clique. To this end, it suffices to show that \(K'\) is a clique as \(|K'| = |K|\). If \(K {\setminus } M = \{u\}\), then \(K' = M\) is a clique. Assume that \(K {\setminus } M = \{u, u'\}\) for some \(u' \ne u\). Since \(\mathtt {w}(u) < \mathtt {lb}/2\) and \(u' \in K {\setminus } M\), we have \(\mathtt {w}(u') > \mathtt {ub}/2\) as before. Let \(w \in K \cap M\). Then, \(vw, wu' \in E\). Since \(\mathtt {w}(v) \le \mathtt {w}(w) \le \mathtt {ub}/2 < \mathtt {w}(u')\), we have \(vu' \in E\) by Observation 2.4. Thus, \(K'\) is a clique. The assumption \(N(v) \subsetneq N(u)\) implies that \(\deg _{G}(v) < \deg _{G}(u)\), and thus,

$$\begin{aligned} \sum _{w \in K'} \deg _{G}(w) = \left( \sum _{w \in K} \deg _{G}(w)\right) - \deg _{G}(u) + \deg _{G}(v) < \sum _{w \in K} \deg _{G}(w). \end{aligned}$$

This contradicts that K is efficient. Therefore, we conclude that \(N(v) = N(u)\).

Now, we define a weight function \(\mathtt {w}':V \rightarrow \mathbb {R}\) by setting \(\mathtt {w}'(u) = \mathtt {w}(v)\), \(\mathtt {w}'(v) = \mathtt {w}(u)\), and \(\mathtt {w}'(x) = \mathtt {w}(x)\) for all \(x \in V {\setminus } \{u,v\}\). Then, \(\mathtt {w}'\), \(\mathtt {lb}\), and \(\mathtt {ub}\) define G and \(M' := \{w \in V \mid \mathtt {lb}/2 \le \mathtt {w}'(w) \le \mathtt {ub}/2\} = M \cup \{u\} {\setminus } \{v\}\) as \(N(u) = N(v)\). This contradicts the choice of \(\mathtt {w}\) as \(|M' \vartriangle K| < |M \vartriangle K|\).

Next, we show that the symmetry required in Lemma 3.3 follows for free when M is a clique.

Lemma 3.10

Let \(G = (V,E)\) be a connected non-bipartite graph and M be a clique of G. Then, \(G'_{M}\) is a permutation graph if and only if \(G'_{M}\) can be represented by a permutation diagram in which both orderings \(\prec _1\) and \(\prec _2\) are symmetric.

Proof

The if part is trivial. To prove the only-if part, we assume that \(G'_{M}\) is a permutation graph.

First we observe that we only need to deal with the twin-free case. Assume that \(N_{G'_{M}}(u) = N_{G'_{M}}(v)\) (or equivalently \(N_{G'_{M}}(\bar{u}) = N_{G'_{M}}(\bar{v})\)) for some \(u, v \in V\), i.e., uv are twins in \(G'_{M}\). If \(G'_{M} - \{v,\bar{v}\}\) has a permutation diagram in which both permutation orderings \(\prec _{1}\) and \(\prec _{2}\) are symmetric, then we can obtain symmetric permutation orderings \(\prec '_{1}\) and \(\prec '_{2}\) of \(G'_{M}\) by inserting v right after u, and \(\bar{v}\) right before \(\bar{u}\) in both \(\prec _{1}\) and \(\prec _{2}\). Thus, it suffices to show that \(G'_{M} - \{v,\bar{v}\} = (G - v)'_{M {\setminus } \{v\}}\) has a permutation diagram in which both permutation orderings \(\prec _{1}\) and \(\prec _{2}\) are symmetric.

Observe that \(G-v\) might be bipartite, but \((G - v)'_{M {\setminus } \{v\}}\) is still connected. Hence, we can assume in the following that no pair of vertices in \(G'_{M}\) have the same neighborhood and that \(G'_{M}\) is connected (but G might be bipartite). We also assume that \(|V| \ge 2\) since otherwise the statement is trivially true.

Let \(\prec _{1}\) and \(\prec _{2}\) be the permutation orderings corresponding to a permutation diagram of \(G'_{M}\). By Lemma 2.7, the assumption of having no twins implies that \(\prec _{1}\), \(\prec _{2}\), \(\prec _{1}^{\mathrm {R}}\), and \(\prec _{2}^{\mathrm {R}}\) are all the permutation orderings of \(G'_{M}\). Since \(G'_{M}\) is connected, we may assume that the first vertex in \(\prec _{1}\) belongs to V, the last in \(\prec _{1}\) belongs to \(V' {\setminus } V\), the first in \(\prec _{2}\) belongs to \(V' {\setminus } V\), and the last vertex in \(\prec _{2}\) belongs to V. Let \(\langle w_{1}, \ldots , w_{2n} \rangle \) be the ordering defined by \(\prec _{1}\).

Let \(\varphi :V' \rightarrow V'\) be a map such that \(\varphi (v) = \bar{v}\) and \(\varphi (\bar{v}) = v\) for each \(v \in V\). This map \(\varphi \) is an automorphism of \(G'_{M}\). Thus, \(\langle \varphi (w_{1}), \ldots , \varphi (w_{2n}) \rangle \) is also a permutation ordering of \(G'_{M}\). Let \({\prec '} = \langle \varphi (w_{1}), \ldots , \varphi (w_{2n}) \rangle \) denote this ordering. Then,

$$\begin{aligned} {\prec '} \in \{\prec _{1}, \prec _{2}, \prec _{1}^{\mathrm {R}}, \prec _{2}^{\mathrm {R}}\}. \end{aligned}$$

We claim that \({\prec '} = {\prec _{1}^{\mathrm {R}}}\). First, observe that \({\prec '} \notin \{\prec _{1},\prec _{2}^{\mathrm {R}}\}\) as the first vertex of \(\prec '\) belongs to \(V' {\setminus } V\) but the first vertices of \(\prec _{1}\) and \(\prec _{2}^{\mathrm {R}}\) belong to V.

Suppose to the contrary that \({\prec '} = {\prec _{2}}\). Then, for each \(w \in V'\), the positions of w in \(\prec _{1}\) and \(\varphi (w)\) in \({\prec _{2}}\) (\(= {\prec '}\)) are the same. Thus, \(w_{i} \prec _{1} \varphi (w_{i})\) implies \(\varphi (w_{i}) \prec _{2} \varphi (\varphi (w_{i})) = w_{i}\). Hence, we have \(v \bar{v} \in E(G'_{M})\) for all \(v \in V\), and thus \(M = V\). As M is a clique, \(M = V\) implies that G is a complete graph \(K_{|V|}\) and that \(G'_{M}\) is a complete bipartite graph \(K_{|V|, |V|}\). This contradicts the assumption that \(G'_{M}\) has no twins as \(|V| \ge 2\). Therefore, we conclude that \({\prec '} = {\prec _{1}^{\mathrm {R}}}\), and in particular that \(\varphi (w_{i}) = w_{2n-i+1}\) for each i. This means that \(w_{i} = v\) implies \(w_{2n-i+1} = \bar{v}\) for all \(v \in V\) and \(i \in \{1,\ldots ,2n\}\). Hence, \(\prec _{1}\) is symmetric. \(\square \)

Now we can prove Theorem 3.1 restated below.

Theorem

3.1 For a non-bipartite graph G, the following are equivalent.

  1. 1.

    G is a double-threshold graph.

  2. 2.

    For every efficient maximum clique M of G, the graph \(G'_{M}\) is a bipartite permutation graph.

  3. 3.

    For some efficient maximum clique M of G, the graph \(G'_{M}\) is a bipartite permutation graph.

Proof

To show that 1 \(\implies \) 2, assume that G is a non-bipartite double-threshold graph. Let M be an efficient maximum clique of G. By Lemma 3.6, there exist \(\mathtt {w}:V \rightarrow \mathbb {R}\) and \(\mathtt {lb}, \mathtt {ub}\in \mathbb {R}\) defining G such that \(M = \{v \in V \mid \mathtt {lb}/2 \le \mathtt {w}(v) \le \mathtt {ub}/2\}\). Now by Lemma 3.3, \(G'_{M}\) is a bipartite permutation graph.

The implication 2 \(\implies \) 3 is trivial.

We now show that 3 \(\implies \) 1. Assume that for an efficient maximum clique M of a non-bipartite graph G, the graph \(G'_{M}\) is a bipartite permutation graph.

Let H be a non-bipartite component of G. Then, H contains an induced odd cycle of length \(k \ge 3\). This means that, if H does not contain M, then \(G'_{M}\) contains an induced cycle of length \(2k \ge 6\). However, this is a contradiction as a permutation graph cannot contain an induced cycle of length at least 5 [5]. Thus, H contains M. Also, there is no other non-bipartite component in G as it does not intersect M. Since H contains M, \(H'_{M}\) is a component of \(G'_{M}\). By Lemma 3.10, \(H'_{M}\) can be represented by a permutation diagram in which both \(\prec _1\) and \(\prec _2\) are symmetric, and thus H is a double-threshold graph by Lemma 3.3.

Let B be a bipartite component of G (if one exists). Since B does not intersect M, \(G'_{M}\) contains two isomorphic copies of B as components. Since \(G'_{M}\) is a permutation graph, B is a permutation graph too. By Lemma 2.6, B is a double-threshold graph.

Now we know that all components of G are double-threshold graphs and exactly one of them is non-bipartite. By Lemma 2.3, G is a double-threshold graph. \(\square \)

4 Linear-Time Recognition Algorithm

We now present a linear-time recognition algorithm for double-threshold graphs.

Theorem 4.1

There is an \(O(m+n)\)-time algorithm that accepts a given graph \(G = (V,E)\) if and only if the graph is a double-threshold graph, where \(n = |V|\) and \(m = |E|\).

Proof

Given a graph G, we accept G if and only if

  • G is a bipartite permutation graph, or

  • G is a non-bipartite permutation graph and \(G'_{M}\) is a permutation graph, where M is an efficient maximum clique of G.

By Lemma 2.6 and Theorem 3.1, this algorithm is correct. Thus, it suffices to present a linear-time implementation of this algorithm.

We first test whether G is a permutation graph in \(O(m+n)\) time [16]. If G is not a permutation graph, we can reject it by Lemma 2.5. Otherwise, we check in linear time whether G is bipartite. If so, we can accept G by Lemma 2.6.

In the remaining case, G is a non-bipartite permutation graph. Assume for now that we already have an efficient maximum clique M of G. Since \(|V(G'_{M})| = 2n\) and \(|E(G'_{M})| = 2m + |M|\), we can construct \(G'_{M}\) and test whether it is a permutation graph in \(O(m+n)\) time. Hence, by Theorem 3.1, it suffices to show that M can be found in \(O(m+n)\) time.

To find an efficient maximum clique of G, we set to each vertex \(v \in V\) the weight \(f(v) = n^{2} - \deg _{G}(v)\), and then find a maximum-weight clique of G with respect to f. It is known that a transitive orientation of a permutation graph can be computed in \(O(m+n)\) time [16], and then using the orientation, we can find a maximum-weight clique M in \(O(m+n)\) time [6, pp. 133–134]. We show that M is an efficient maximum clique of G. Let K be an efficient maximum clique of G. Since \(\sum _{v \in K}f(v) \le \sum _{v \in M} f(v)\), we have

$$\begin{aligned} |K| \cdot n^{2} - \sum _{v \in K} \deg _{G}(v) \le |M| \cdot n^{2} - \sum _{v \in M} \deg _{G}(v). \end{aligned}$$
(5)

Since \(0 \le \sum _{v \in S} \deg _{G}(v) < n^{2}\) for any \(S \subseteq V\), it holds that \( |K| \cdot n^{2} - n^{2} < |M| \cdot n^{2}\). This implies that \(|K| = |M|\) as \(|K| \ge |M|\). It follows from (5) that \(\sum _{v \in K} \deg _{G}(v) \ge \sum _{v \in M} \deg _{G}(v)\). Therefore, M is an efficient maximum clique. \(\square \)

5 Conclusion

We have presented a new characterization of double-threshold graphs and a linear-time recognition algorithm for them based on the characterization. For a better understanding of this graph class, it would be good to have the list of minimal forbidden induced subgraphs. We believe that our characterization will be useful for this direction as well.