1 Introduction and Motivation
An undirected graph is a comparability (or transitively orientable) graph if the edges can be oriented in a way that for any three vertices whenever there is a (directed) edge from to and an edge from to , there is an edge from to . They are a well-studied class of graphs [3, 8] and they can be recognized in polynomial time . Spinrad  generalized this class of graphs and introduced the notion of -clique-extendible orderings (abbr. -C-E ordering) on the vertices of a graph defined as follows.
Definition 1 (-C-E ordering, Spinrad )
An ordering of the vertices of a graph is a -clique-extendible ordering (or -C-E ordering) of if, whenever and are two overlapping cliques of size such that , , , and all the vertices in occur between and in , we have and hence is a -clique.
A graph is said to be -clique-extendible (-C-E for short) if there exists a -clique-extendible ordering of . It can be observed that comparability graphs are exactly the -clique-extendible graphs. Spinrad  observed that -clique-extendible graphs, also called triangle-extendible graphs, arise in the visibility graphs of simple polygons and that a maximum clique can be found in polynomial time in such graphs if a -clique-extendible ordering is given. This result has been generalized to obtain an algorithm for finding a maximum clique in -C-E graphs (given with a -C-E ordering) on vertices . The question of whether there is a polynomial time algorithm to recognise -C-E graphs has been mentioned as an open problem .
We believe that -C-E graphs are natural generalizations of comparability graphs and our main contribution in this paper is a serious study of this class of graphs. Our results show that recognizing -C-E graphs is NP-hard for any fixed and also co-NP-hard when is part of the input. This solves the open problem regarding the complexity of recognizing -C-E graphs and we hope that our results will trigger further study of -C-E graphs in general.
If an ordering of the vertices is given, then it is easy to get an algorithm to determine whether it is a -C-E ordering of the graph (see Section 4). We show that this problem is co-NP-complete and also complete for the parameterized complexity class co-W. The reduction also implies that unless the Exponential Time Hypothesis fails, this problem does not have an algorithm for any function of . However, we show that the problem is fixed-parameter tractable when parameterized by the treewidth of the graph, that is, there is an algorithm for the problem, where is the treewidth of the graph (see Section 2 for definitions).
Organization of the paper. In the next section, we give the necessary notation and definitions. In Section 3, we prove some results about -C-E graphs which are used in our reductions in later sections. In Section 4, we show that the problem of checking whether a given ordering is a -C-E ordering is co-NP-complete and co-W-complete. In this section, we also show that the problem is fixed-parameter tractable when parameterized by the treewidth of the graph. In Section 5 we show that the algorithm for finding maximum clique in a -C-E graph  is likely optimal. Section 6 gives our main NP-hardness reductions for the problem of recognizing -C-E graphs. We give two reductions, one for and another for . We list some open problems in Section 7.
Definition 2 (Fixed-Parameter Tractability)
A parameterized problem (or a language) is said to be fixed-parameter tractable (FPT) if there exists an algorithm , a constant and a computable function such that given any , runs in at most time and decides correctly whether or not. Here is a function only of , and is a constant independent of . We call algorithm as fixed-parameter algorithm, and we also denote a runtime like , a FPT runtime. FPT also denotes the class of fixed-parameter tractable problems. Here is the size of the input and is the parameter.
There is also an intractability (hardness) theory in parameterized complexity that is characterized by a hierarchy of complexity classes . It is believed that the containments are strict and there are canonical complete problems under parameterized reductions.
Definition 3 (Parameterized Reduction, , -complete)
There is a parameterized reduction from a parameterized problem to a parameterized problem , if every instance of can be transformed in FPT time to an equivalent instance where is just a function of . The Clique problem that asks whether a given undirected graph has a clique of size is a canonical -complete problem, where is the parameter. Parameterized problems that have a parameterized reduction to the Clique problem form the class .
We refer readers to the recent textbook  for further discussions on parameterized complexity.
Definition 4 (Tree-decomposition and treewidth )
A tree decomposition of a graph is a pair , where is a tree whose every node is assigned a vertex subset , called a bag, such that the following three conditions hold : . For every , there exists a node of such that bag contains both and . For every , the set induces a connected subtree of . The width of tree decomposition equals . The treewidth of a graph , denoted by , is the minimum possible width of a tree decomposition of .
The following conjecture, known as the Exponential Time Hypothesis, is used to provide lower bounds for hard problems.
Exponential Time Hypothesis (ETH) : There is a positive real such that -CNF-SAT cannot be solved in time where is the number of variables, and is the number of clauses in the formula.
See also  for a survey of various lower bound results using ETH.
All graphs considered in this paper are undirected and simple. Given a graph , by we denote the set of vertices in the graph and by we denote the set of edges in the graph. Let be a graph. For a subset of vertices , we define as the induced subgraph of having vertex set .
Given a linear order of a set , we write to mean that and are two elements of such that occurs before in . Also, we write to mean that and . We say that a vertex comes between vertices and in if or . By we denote the reverse of , that is, if and only if .
Given an ordering of a set and a set , we define to be the ordering of the elements of in the order in which they occur in . Further, we say that are the endpoints of if is the first element of and is the last element of . Given two disjoint sets and , and orderings of the set and of the set , we define that is an ordering on the set , that is, is the concatenation operator on orderings. We will abuse notation to allow sets to be used with the concatenation operator: if is an expression that is a concatenation of orderings and sets, we say that an ordering is of the form , if there exists an ordering for each set appearing in such that replacing each set with its corresponding ordering in yields the ordering .
A clique in a graph is a set of vertices that are pairwise adjacent in the graph. An independent set is a set of vertices that are pairwise non-adjacent. Given subsets , we say that separates and if there is no path from to in . For a pair of nonadjacent vertices of a graph, by identifying with , we mean adding the edges for all and then deleting .
We denote by the graph obtained by removing an edge from the complete graph on vertices. Given an ordering of the vertices of a graph , we say that an induced subgraph of is an ordered in if and . It follows that an ordering of the vertices of a graph is a -C-E ordering if and only if it contains no ordered .
3 Basic Results
We start with the following observations which are used throughout the paper.
An ordering is a -C-E ordering, if and only if its reverse ordering, is also a -C-E ordering.
Given a graph and an induced subgraph of , if an ordering is a -C-E ordering of , then is a -C-E ordering of . Thus every induced subgraph of a -clique-extendible graph is also -clique-extendible.
If is a -colourable graph with colour classes , then any ordering of of the form is a -C-E ordering of . Thus, every -colourable graph is -clique-extendible.
It is not difficult to see that any -clique-extendible ordering of a graph is also a -clique-extendible ordering of it. Thus, every -clique-extendible graph is also a -clique-extendible graph. Note that every graph on vertices is trivially -clique-extendible. So the notion of -clique-extendibility gives rise to a hierarchy of graph classes starting with comparability graphs and ending with the entire set of graphs. This motivates the use of as a graph parameter.
We prove a lemma that will help us construct a -C-E ordering of a graph from -C-E orderings of its subgraphs.
For a graph , let and let be -C-E orderings of and respectively for any , such that the following hold
separates into components and
if is a -clique in and are the endpoints of in , then every vertex that is adjacent to all of satisfies
Then has a -C-E ordering such that and .
Let . Let be the induced ordering between and in so we can rewrite as
Similarly, let be the induced ordering between and in so that
Consider the following ordering of .
That is, we ‘interleave’ each and between the corresponding and . The ordering is constructed such that it preserves the internal ordering of in and in , that is, and and thus also . We will prove that is a -C-E ordering of . Suppose not. Then there exists a set that forms an ordered in . Let be the endpoints of in . It can’t be the case that , otherwise since , would be an ordered in , contradicting the fact that is a -C-E ordering of . Similarly, it can’t be the case that . So, and . As separates and , no vertex in is adjacent to any vertex . Since the only two vertices in that do not have an edge between them are and , we can assume without loss of generality that and , and we further get that . Since is a sized clique and is adjacent to all the vertices of , by the last condition in the lemma, it must be the case that lies between the two endpoints of in , contradicting the fact that is an endpoint of in .
Forbidden Subgraph. We construct a forbidden subgraph for the class of -clique-extendible graphs which is used to build gadgets in our NP-hard reductions.
For a positive integer , let be a sized clique. For every pair of vertices and in , add a vertex such that is adjacent to every vertex in except and . Let be the set of all such for every pair of vertices in . Let be the graph thus obtained having vertex set . See Figure 1 for an example that demonstrates the adjacencies between and when .
is not -clique-extendible.
Suppose not. Let be a -C-E ordering of . Let , where is a permutation on . If the vertex comes after in , then the vertices in form an ordered . On the other hand, if comes before in , then the vertices in form an ordered . In both cases, we get an ordered , so cannot be a -C-E ordering, which contradicts our assumption.
4 Verifying a -C-E Ordering
In this section, we prove that even verifying whether an ordering is a -clique-extendible ordering is hard (assuming is considered as part of the input, rather than a constant).
Verify -C-E Ordering Input: Graph , integer and an ordering of Question: Is a -C-E ordering of ?
Verify -C-E Ordering has a simple algorithm as one can enumerate all subgraphs isomorphic to , and check if any of them are ordered with respect to the ordering. We prove that the problem is co-W-complete and co-NP-complete by a reduction from and to the Clique problem, and that the problem also cannot have a algorithm assuming ETH (see Section 2 for a definition). The reduction maps the YES instances of Verify -C-E Ordering to the NO instances of Clique and vice-versa. Hence showing that Verify -C-E Ordering is co-NP-complete.
Verify -C-E Ordering is co-W-complete, co-NP-complete and there is no algorithm for it unless ETH fails.
We will prove hardness first by giving a reduction from Clique. In the Clique Problem, we are given a graph and a positive integer and asked to check whether there exists a clique of size in .
Given , let be an arbitrary ordering of its vertices. We construct , where and . We then ask whether the ordering is a -C-E ordering of . We claim that has a -clique if and only if is not a -C-E ordering of .
Suppose has a -clique. Without loss of generality, let the clique be . Then the vertices in form an ordered . Thus we conclude that is not a -C-E ordering. Conversely, if does not have a -clique, then cannot have a -clique, so any ordering is trivially a -C-E ordering of .
The above reduction proves that the problem is co-W-hard and co-NP-hard. It remains to show that the problem is in co-W and in co-NP. For this, we give a reduction to the Clique problem.
Given the ordering of vertices of , we do the following. For every pair of non-adjacent vertices , let be the set of common neighbours of both and , that appear between and in the ordering. That is, if and only if and or . Let be the induced subgraph . Let denote the pairs of vertices in which are non-adjacent. We define . That is, is the disjoint union of for all pairs that are non-adjacent. We claim that has a -clique if and ony if is not a -C-E ordering.
Suppose has a -clique . The clique must be in a connected component of , say . Then the vertices and are non-adjacent in , and by construction of , every vertex is such that lies between and in and is a neighbour to both and . Thus forms an ordered in and hence is not a -C-E ordering. Conversely, suppose there is an ordered in . Let be the vertices of the ordered and let and be its endpoints in . Then forms a -clique such that every vertex is a neighbour to both and and lies between and in . Therefore forms a -clique in .
If all the -cliques in a graph can be enumerated in time for some function , then we can verify if an ordering is a -C-E ordering in time by checking every pair of such cliques to see if they form an ordered . We show that a similar situation happens if has bounded treewidth and so the verification problem becomes easy.
(see for example ) For any clique in , there exists a vertex such that all the vertices of appear in the bag corresponding to the vertex in the tree decomposition.
Lemma 4 ()
There exists an algorithm, that given an -vertex graph and an integer , runs in time and either constructs a tree decomposition of of width at most and bags, or concludes that the treewidth of is greater than .
Given an ordering of the vertices of a graph on vertices, we can verify whether it is a -C-E ordering of in time , where is the treewidth of .
Due to Lemma 3, if , will be a trivial -C-E graph as it cannot contain any sized cliques. So, for the problem to remain non-trivial, we assume that .
We use Lemma 4 to obtain a tree decomposition of of width that has bags. We can verify whether an ordering is a -clique-extendible ordering in time as follows. From Lemma 3, every sized clique must appear in one bag. As the bag sizes are bounded by , and the number of bags is , we can enumerate all -cliques within a bag in time. Now, for every such clique and for every pair of vertices in that are non-adjacent, we check whether and the set of vertices of appear between and in the ordering. If they do for at least one such clique and vertex pair , we output “no”, otherwise we output “yes”.
The algorithm takes time. Since is upper bounded by and , this runtime is .
5 Hardness of finding clique
There exists an algorithm for finding a maximum clique in a -C-E graph  when a -C-E ordering is given. In this section, we will prove that this is most likely optimal, that is, we prove that unless ETH fails, there is no algorithm for finding a maximum clique in a -C-E graph even if the ordering is given. We will reduce from the following problem.
Multicoloured Clique Input: Graph , a partition of Question: Does there exist a -clique in such that for each ?
Multicoloured Clique is W-hard and cannot be solved in time unless ETH fails . Given an instance of Multicoloured Clique, we will first remove all edges that lie within each partition . Hence the graph is now -colourable with colour classes . Any -colourable graph is also a -C-E graph by Observation 3, and we can use an ordering of the form to find the maximum clique size of using an algorithm to find maximum clique in a -C-E graph. If the clique size is equal to , we output yes, otherwise output no. The following theorem follows.
Finding a maximum clique in a -C-E graph, even if given a -C-E ordering of the graph, is NP-hard, W-hard and cannot be solved in time unless ETH fails.
6 Finding a -C-E Ordering
In this section, we consider the following problem and prove the main result of the paper.
Find -C-E Ordering Input: Graph , integer Question: Is a -C-E graph?
Note that this is possibly a harder problem than Verify -C-E Ordering, but still Theorem 4.1 doesn’t immediately imply even co-W-hardness for this problem, as one may be able to determine whether has a -C-E ordering without even verifying an ordering. Our main result in this section is to show that Find -C-E Ordering is NP-hard for each . First we will show that Find -C-E Ordering is co-W-hard and co-NP-hard. This result rules out algorithms running in time assuming ETH (where as the NP-hardness rules out even algorithms assuming PNP).
Find -C-E Ordering is co-W-hard and co-NP-hard.
We will reduce from the Clique problem. Given an integer and a graph in which we wish to find a sized clique, we construct another graph such that contains the forbidden subgraph (defined in Section 2) if and only if it has a clique of size .
Let . Let be a sized clique such that each vertex in is connected to every vertex in and let such that is adjacent to all vertices in except for and . Let be the graph where .
has a -clique if and only if does not have a -C-E ordering.
See Fig. 2 for a figure depicting the constructed graph . Suppose is a -clique in . Then will have an induced subgraph isomorphic to such that the -clique of is and the independent set of is a subset of . By Lemma 2, does not have a -C-E ordering and hence, by Observation 2, does not have a -C-E ordering.
Conversely if does not have a -clique then any arbitrary ordering of will be a -C-E ordering of . We will argue that any ordering of the form is a -C-E ordering of .
It is enough to prove that there does not exist an ordered in . For contradiction, suppose forms an ordered in . Let be the endpoints of in so that and . Let and . Note that and are two -cliques and . Since is an independent set (and ), contains at most one vertex from . Therefore, if , then , which is a contradiction as . Similarly, if , then , which is a contradiction as is then a -clique in . We thus have and . But then , which is a contradiction. Therefore, we conclude that there cannot be an ordered in .
The reduction maps the YES-instances of Clique to the NO-instances of Find -C-E Ordering and vice-versa. Hence Find -C-E Ordering is co-W-hard and co-NP-hard.
6.1 NP-hardness for
We now prove the NP-hardness of Find -C-E Ordering by a reduction from Betweenness defined below. The reduction strategy works for all but not for and so we give a different reduction for in the next section.
Betweenness Input: Universe of size , and a set of triples where each is an ordered triple of elements in Question: Does there exist an ordering of such that either or for each triple ?
Betweenness is NP-hard . To prove our reduction, we will require a gadget that takes as input a graph and 3 vertices and converts them to a modified graph in such a way that either or for any -C-E ordering of . Moreover, if is a -C-E ordering of such that or then is also a -C-E of . Thus the gadget ‘prunes’ out the orderings of the graph where does not lie between and in the ordering. The -C-E orderings of are exactly the -C-E orderings of where either or . Thus to construct the reduction, we will start with a graph where all orderings are valid -C-E orderings, and apply the gadget for each . After applying the gadgets, we will have pruned out all the ‘bad’ orderings and we will remain with exactly the set of orderings in which lies between and for each . To describe the construction of the gadget, first we need to define an auxiliary graph .
Definition of the auxiliary graph. Recall the graph , defined in Section 2 on the vertex set where induces a clique on vertices, and every vertex in is indexed by a pair of vertices of to which the vertex is not adjacent. Pick arbitrary vertices and of and let be the vertex of that is adjacent to every vertex of except and . Define . Note that has many vertices.
In any -C-E ordering of , and are the endpoints of . Furthermore, there exists a -C-E ordering of such that is the first element in and is the last.
Suppose that is a -C-E ordering of and suppose for contradiction that and are the endpoints of where . Then there exists that is adjacent to every vertex in except and . Let where is a permutation of such that and .
If the vertex comes after in , then the vertices in form an ordered in . On the other hand, if the vertex comes before in , then the vertices in form an ordered in . In both cases, we get a contradiction to being a -C-E ordering. Therefore every -C-E ordering of is such that and are the endpoints of .
Now we will prove the existence of an ordering of such that is the first element of and is the last. Let be the set of all vertices in that are not adjacent to and let . Note that, since we have removed the vertex from to get , all vertices in are adjacent to and all vertices in are adjacent to .
Consider an ordering of the form . We claim that is a -C-E ordering of . Observe that is the first element of and is the last, thus we will be done once we prove the claim.
Suppose that is not a -C-E ordering of , then there exists that induces an ordered in . Let be the endpoints of in so that and . Let and . Note that and are -cliques and .
Note that at most one vertex from can be contained in because otherwise , which implies that there is at most one vertex (which is ) between and in , contradicting the fact that . If , then by the above observation, we have . Since , we have , which implies that and . By our earlier observation, all vertices in are adjacent to , which contradicts the fact that . We thus have that . By a symmetric argument, we get that . Then , which again contradicts the fact that .
The Gadget. We will use as a gadget to constrict the set of orderings a graph can have. Pick an arbitrary vertex such that . Given a graph , applying the gadget on a triplet of vertices involves taking the disjoint union of and and identifying the vertices with , with and with (See Fig. 3). For technical reasons, we will only be applying the gadget on vertices that induce a clique in . Since has many vertices, the gadget will add vertices to , keeping it well within a polynomial factor. We use notation to denote “ is obtained by applying the gadget on on vertices ”. The valid -C-E orderings of should exactly be the -C-E orderings of where does not come between and . The following lemmas give us exactly that.
Let be a graph and let be vertices of . In any -C-E ordering of , comes between and .
Let and let be a graph that has a -C-E ordering such that comes between and for some three vertices that form a -clique in , then has a -C-E ordering such that .
By Lemma 5, has a -C-E ordering where and are the first and last elements in respectively. Since is identified with and with , we have that for each . We wish to use Lemma 1 on and to obtain a -C-E ordering of . Observe that and separates and , thus the first and second conditions in Lemma 1 hold. Since form a clique in both and in , we have that is isomorphic to and is isomorphic to . Thus is a -C-E ordering of and is a -C-E ordering of . Without loss of generality, we can assume by Observation 1, that in . It also holds that, since is identified with . Therefore , and the third condition also holds. Let be a vertex in . Suppose there exists a clique of size that is adjacent to . Since , it follows that , and thus are the endpoints of in . By the property of , we have . Thus all four conditions for Lemma 1 are satisfied and the lemma follows.
The Reduction. We are now ready to prove that the problem of checking whether a graph has a -C-E ordering is NP-hard for each .
Find -C-E Ordering is NP-hard for each .
We will reduce from Betweenness. Let be the input Betweenness instance. We want to construct a graph such that