A characterization of maximal 2-dimensional subgraphs of transitive graphs
aa r X i v : . [ c s . D M ] A p r Discrete Mathematics and Theoretical Computer Science
DMTCS vol.
VOL :ISS, 2019,
A characterization of maximal 2-dimensionalsubgraphs of transitive graphs
Henning Koehler
Massey University, New Zealand received 2019-04-07 , revised - , accepted - . A transitive graph is 2-dimensional if it can be represented as the intersection of two linear orders. Such repre-sentations make answering of reachability queries trivial, and allow many problems that are NP-hard on arbitrarygraphs to be solved in polynomial time. One may therefore be interested in finding 2-dimensional graphs that closelyapproximate a given graph of arbitrary order dimension.In this paper we show that the maximal 2-dimensional subgraphs of a transitive graph G are induced by the optimalnear-transitive orientations of the complement of G . The same characterization holds for the maximal permutationsubgraphs of a transitively orientable graph. We provide an algorithm that enables this problem reduction in near-linear time, and an approach for enlarging non-maximal 2-dimensional subgraphs, such as trees. Keywords: permutation graph, transitive orientation, order dimension
Approximating graphs that do not possess a simple structure with graphs that do has been a successfulapproach for many applications. So far, trees (or forests) have been the primary tool of choice for thispurpose – e.g. approximating graphs with maximal sub-trees has led to the tree-cover indexing scheme [1]for answering reachability queries, while the notion of tree-width has led to a wide range of tracktablealgorithms for NP-hard problems.Expanding the class of trees to the class of all 2-dimensional graphs should enable us to find closerapproximations. This does not make answering of reachability queries any harder, and many NP-hardproblems that become easy on trees can still be solved in polynomial time on arbitrary 2-dimensionalgraphs, including maximal clique, independent set, vertex cover, vertex coloring and clique cover [7].In the following, we aim to take a small step towards making 2-dimensional graphs a viable tool forapproximation. We will show that for a transitive graph G , any orientation of its complement induces a2-dimensional subgraph of G , and that every maximal 2-dimensional subgraph can be induced in this way.This reduces the problem of finding a maximal 2-dimensional subgraph to that of finding an orientationof its complement with minimal transitive closure.To make this reduction effective, we provide a near-linear time algorithms for computing the 2-dimen-sional subgraph induced by an orientation of the complement. The reverse problem of finding a comple-ment orientation inducing a maximal 2-dimensional subgraph can be solved with existing algorithms. ISSN subm. to DMTCS c (cid:13)
Henning Koehler
To begin, we introduce some helpful tools and terminology. Throughout the paper we consider all graphsto be simple and directed, and represent undirected edges as pairs of directed edges.
Definition 1 (inverse, undirected, complement, oriented, transitive) . (i) The inverse of an edge ( a, b ) is the edge ( a, b ) − = ( b, a ) . The inverse of a graph G = ( V, E ) is thegraph G − = ( V, E − ) , where E − = { ( a, b ) − | ( a, b ) ∈ E } .(ii) We say that a graph G = ( V, E ) is undirected iff E = E − . The undirected closure of a graph G = ( V, E ) is the graph U ( G ) = ( V, E U ) , where E U = E ∪ E − .(iii) The complement of G = ( V, E ) is the graph G = ( V, V ◦ × V \ E U ) , where V ◦ × V = { ( a, b ) | a, b ∈ V, a = b } .(iv) A graph G = ( V, E ) is oriented iff E ∩ E − = ∅ . A graph G ′ = ( V, E ′ ) is an orientation of G = ( V, E ) iff E ′ is a maximal oriented subset of E .(v) A graph G = ( V, E ) is transitive iff for all edges ( a, b ) , ( b, c ) ∈ E with a = c we also have ( a, c ) ∈ E . The transitive closure of a graph G = ( V, E ) is G ∗ = ( V, E ∗ ) , where E ∗ is the minimaltransitive superset of E . Any acyclic transitive graph can be viewed as a partial order, and any partial order can be characterizedas intersection of linear orders [3]. The minimal number of linear orders required for this is called the order dimension of the graph. In this paper, any references to dimension will be w.r.t. order dimension.We call a graph n -dimensional if its order dimension is n or less.In this work we shall focus exclusively on 2-dimensional graphs. While the use of n -dimensional graphclasses for larger n would enable ever closer approximations, we note that there is no evidence that NP-hard problems tend to become easier when restricted to n -dimensional graphs for n > . In particular,deciding whether a graph is n -dimensional for n > has been shown to be NP-hard [9].For most of our results we shall assume that given transitive graphs are acyclic. For cyclic graphs theresults can be applied to their condensation into strongly connected components. We call a graph transitively orientable iff it possesses a transitive orientation. Transitive orientations ofgraphs are typically represented by providing a total ordering of vertices, which applies only to edges inthe graph to be oriented. As this representation only requires space (near)-linear in the number of vertices,it can be computed efficiently even if the graph is large – e.g. the complement of a given sparse graph.An undirected graph is a permutation graph iff both it and its complement are transitively orientable. Itis well-known that any transitive orientation of a permutation graph is 2-dimensional, and that reverselythe undirected closure of a 2-dimensional graph is a permutation graph.
Lemma 1 ([3, Theorem 3.61]) . A transitive graph is 2-dimensional iff its complement is transitively orientable.
The linear orders describing a 2-dimensional digraph G can be found by merging G with the transitiveorientation O of its complement, and with its inverse O − . Example 1.
Consider the graph shown on the left. A transitive orientation of the complement of itstransitive closure is given in the center. Merging these graphs results in a linearization L . characterization of maximal 2-dimensional subgraphs of transitive graphs AB C DE Finput DAG + AB C DE FTO of complement = AB C DE F1 st linearizationMerging G with the inverse orientation of its complement provides the second linearization L .AB C DE Finput DAG + AB C DE Finverse TO = AB C DE F2 nd linearizationThe partial ordering induced by G can now be represented as L ∩ L . An efficient algorithm for combining the partial order described by G ∗ with a transitive orientation ofits complement, given as a linear ordering, can e.g. be found in [4, Proof of Lemma 2]. It is reproduced asAlgorithm 1 below. The rank of a vertex is the number of smaller vertices w.r.t. to some linear ordering. Algorithm 1
Merge G with transitive orientation of complement Input:
Acyclic digraph G , linear order L G describing transitive orientation O of G ∗ Output:
Linear extension L of G and O procedure M ERGE ( G, L G ) L = [ ] S = { v ∈ V | v has no incoming edges } while S = ∅ do remove from S vertex s ∈ S with minimal rank in L G append s to L add successors of s with no other incoming arcs to S remove s from G return L Henning Koehler
Using a heap to represent S , we can update S and retrieve the minimal rank vertex s in O (log n ) ,resulting in an overall running time of O ( m + n · log n ) .The issue of finding a transitive orientation of a transitively orientable graph has received much attentionin the literature. We point to ordered vertex partitioning [8] as a practical algorithm that runs in near-linear time. A transitive orientation of the complement of a graph, again described as a linear ordering ofvertices, can also be obtained in near-linear time with a little tweak [2, Section 11.2]. At the core of transitive orientations is the forcing relationship between edges, where orientation of oneedge forces the orientation of another to maintain transitivity [5].
Definition 2 (forced orientation) . Let G be an undirected graph. We say that two edges ( a, b ) , ( c, d ) in G force each other , denoted as ( a, b ) Γ ( c, d ) , iff either a = c and b, d are not adjacent, or b = d and a, c are not adjacent. We denotethe transitive closure of relation Γ by Γ ∗ . The forcing relationship can be linked to the transitivity of orientations as follows:
Lemma 2 ([6, Chapter 5]) . An orientation O of G is transitive iff(i) O contains all edges forced by edges in O , and(ii) O does not contain any cycles. Example 2.
Consider the graph G below, which is the complement of the graph from Example 1. If wepick an orientation of one edge, e.g. E → F , then the orientation of most other edges is forced by it. E.g. E → F forces E → D , which in turn forces B → D .AB C DE F orient ==== ⇒ one edge AB C DE F forced ===== ⇒ orientation AB C DE FOrienting the remaining unforced edge as B → C yields the transitive orientation from Example 1.Orienting it as C → B yields another transitive orientation. We shall now relate 2-dimensional subgraphs of a transitive graph G with orientations of its complement.It turns out that any maximal 2-dimensional subgraph of G can be obtained by removing edges that liein the undirected closure of the transitive closure of some orientation of G . Here we use the term near-transitive orientation to indicate that we are interested in orientations whose transitive closure is small.Consider now a directed acyclic graph G which is not transitive. A critical observation in relatingtransitive orientations of G ∗ and G , if they exist, is that the transitive closures of their forcing relationships characterization of maximal 2-dimensional subgraphs of transitive graphs directly force each other if they are related via Γ , andthat they indirectly force each other if they are related via Γ ∗ . Lemma 3.
Let ( a, b ) , ( c, d ) be two edges in G ∗ that indirectly force each other in G ∗ , i.e., we have ( a, b ) Γ ∗ ( c, d ) . Then ( a, b ) , ( c, d ) indirectly force each other in G . Proof:
Let ( x, a ) , ( x, b ) be two edges in G ∗ that force each other directly. Then either ( a, b ) or ( b, a ) liesin G ∗ , say ( a, b ) . This means G contains a path a → v → . . . → v n → b , for some n .Assume ( x, v i ) does not lie in G , for ≤ i ≤ n . Then either ( x, v i ) or ( v i , x ) must lie in G . If ( x, v i ) lies in G , then ( x, b ) lies in G ∗ , contradicting ( x, b ) ∈ G ∗ . If ( v i , x ) lies in G , then ( a, x ) lies in G ∗ ,contradicting ( x, a ) ∈ G ∗ .Hence ( x, v i ) must lie in G for all i = 1 . . . n , so the following forcing relationships hold in G : ( x, a ) Γ ( x, v ) Γ . . . Γ ( x, v n ) Γ ( x, b ) This shows the claim for edges that directly force each other in G ∗ . For edges that force each otherindirectly, the claim then follows by transitivity of Γ ∗ .As a consequence, any transitive orientation of G is a transitive orientation of G ∗ as well: Theorem 1.
Let H be a transitive orientation of G . Then H ∩ G ∗ is a transitive orientation of G ∗ . Proof:
We show that conditions (i) and (ii) of Lemma 2 hold for H ∩ G ∗ .(i) By Lemma 3 any two edges in G ∗ forcing each other also force each other in G . Thus condition (i)for H implies condition (i) for H ∩ G ∗ .(ii) Since H is cycle-free, any subgraph of H must be as well.In particular, for any transitive graph G , its complement G is a graph with transitively orientable com-plement. This allows us to construct a 2-dimensional subgraph of G : Corollary 1.
Let G be transitive and H an orientation of G . Then G \ U ( H ∗ ) is 2-dimensional. Proof: As G is a transitive orientation of H , it follows from Theorem 1 that G induces a transitiveorientation on H ∗ , namely G \ U ( H ∗ ) . Thus G \ U ( H ∗ ) is a transitive graph, and its complement has atransitive orientation H ∗ , which makes it 2-dimensional by Lemma 1.We illustrate this construction with an example. Example 3.
Consider the graph G shown on the left. An orientation H of G is shown in the center.AB C DE FGraph G AB C DE FOrientation H (with t-edge) AB C DE F G ∗ \ U ( H ∗ ) Henning KoehlerObserve that the only transitivity violation occurs for A → C, C → D , causing H ∗ to contain the extraedge A → D . When we remove this edge from G ∗ , we obtain a 2-dimensional subgraph. We note that not every 2-dimensional subgraph can be constructed using Corollary 1 (consider e.g. adigraph representing a linear ordering). However, when approximating G with a 2-dimensional subgraph,we want this subgraph to be as big as possible, either w.r.t. the subgraph relationship (local optimality),or w.r.t. the number of edges (global optimality). Thus it would be sufficient if all maximal G \ U ( H ∗ ) as the subgraph of G induced by H . Lemma 4.
Let G be transitive and S a 2-dimensional subgraph of G . Then S is transitively orientable,and for any transitive orientation H S of S the subgraph S ′ := G \ U ( H ∗ ) induced by H := H S ∩ G is a2-dimensional supergraph of S . Proof: S is transitively orientable by Lemma 1, and by Corollary 1 S ′ is 2-dimensional, so it remains toshow S ⊆ S ′ . From H ⊆ H S and transitivity of H S we get H ∗ ⊆ H S , and thus S ′ = G \ U ( H ∗ ) ⊇ G \ U ( H S ) = G \ S = S Together with Corollary 1, this give us the following:
Theorem 2.
Let G be transitive. Then(i) every orientation H of G induces a 2-dimensional subgraph of G , and(ii) every locally maximal 2-dimensional subgraph of G is induced by some orientation H of G . Proof:
Condition (i) is just a restatement of Corollary 1.To show (ii) let S be a locally maximal 2-dimensional subgraph of G . By Lemma 4 there exists a2-dimensional subgraph S ′ with S ⊆ S ′ such that S ′ is induced by some orientation H of G . But since S is locally maximal we must have S ′ = S , so S is induced by H .Theorem 2 reduces the problem of finding a maximal 2-dimensional subgraph of G to that of findingan optimal near-transitive orientation of G , that is, an orientation with minimal transitive closure. As seen in Lemma 1, the notions of 2-dimensional graph and permutation graph are closely related. Thisrelationship can be strengthened further for maximal subgraphs.
Lemma 5.
Let G be transitive and S a subgraph of G . Then S is a (locally) maximal 2-dimensionalsubgraph of G iff U ( S ) is a (locally) maximal permutation subgraph of U ( G ) . Proof: If U ( S ) is a permutation graph, then S is transitively orientable, and by Theorem 1 so is S ∗ . Thismakes U ( S ∗ ) a permutation subgraph of U ( G ) . If U ( S ) is maximal, then we must have U ( S ∗ ) = U ( S ) and thus S ∗ = S , so S is 2-dimensional by Lemma 1.Conversely, if S is a 2-dimensional subgraph of G , it follows by Lemma 1 that U ( S ) is a permutationsubgraph of U ( G ) . Maximality of one now clearly implies maximality of the other.As a consequence, permutation subgraphs of a transitively orientable graph can be characterized in thesame way as 2-dimensional subgraphs of a transitive graph. characterization of maximal 2-dimensional subgraphs of transitive graphs Corollary 2.
Let G be transitively orientable. Then(i) every orientation H of G induces a permutation subgraph of G , and(ii) every locally maximal permutation subgraph of G is induced by some orientation H of G . Ideally we would like an efficient algorithm for finding optimal near-transitive orientations. Until such analgorithm is discovered (if one exists – the hardness of this optimization problem is currently open), analternative could be to use Lemma 4 to improve a given 2-dimensional subgraph, such as the one providedby the tree-cover algorithm [1]. The example below illustrates this approach.
Example 4.
Consider the following graph G , and a tree-cover T of G (transitive edges omitted):AB C DE F GGraph G AB C DE F GTree-cover T of G As T is 2-dimensional, we can obtain a transitive orientation H T of its complement.AB C DE F G H T : TO of complement AB C DE F G H : restriction of H T AB C DE F Gsupergraph T ′ of T Restricting H T to G give us the near-transitive graph H shown in the center. Removing from G the edgesin U ( H ∗ ) , namely D → F , results in the 2-dimensional supergraph T ′ of T . For some 2-dimensional subgraphs S , a transitive orientation of S can be found easily, e.g. when S is a tree. More general cases could be handled by any algorithm for finding transitive orientations – inparticular, the ordered vertex partitioning approach of [8], together with a tweak from [2, Section 11.2],allows us to construct a transitive orientation of S in time near-linear in the size of S . Henning Koehler
In order to make the problem reduction described in Section 3 effective, we require a fast algorithm forconstructing the 2-dimensional subgraph induced by an orientation of the complement.Since G H := G \ U ( H ∗ ) is 2-dimensional, we can describe it with two linear orderings, such as G H ∪ H ∗ and G H ∪ ( H ∗ ) − , as illustrated in Example 1. We therefore require an algorithm which takes G and a linear ordering describing H as input, and returns the linear ordering describing G H ∪ H ∗ . As H can be much larger than G , we want this algorithm to be near-linear in the size of G . Example 5.
Consider again the graph from Example 3, reproduced below. The linear ordering BEACDF,short for
B < E < A < C < D < F , describes the orientation of its complement given in the center.AB C DE FGraph G AB C DE FOrientation H (with t-edge) AB C DE F G H = G ∗ \ U ( H ∗ ) We are looking for an algorithm that combines G and BEACDF into ABCEDF describing G H ∪ H ∗ . Thesame algorithm can then be employed to combine G and the inverse orientation FDCAEB into DCAFBEdescribing G H ∪ ( H ∗ ) − . G H is now represented as the intersection of ABCEDF and DCAFBE. To design such an algorithm, we employ the same approach as in Algorithm 1, that is:1. We keep track of all vertices whose ancestors in H have been processed, and2. among those we pick the minimal one w.r.t. the ordering imposed by G .As nodes will have a large number of ancestors in H when G is sparse, we do not track the set ofunprocessed ancestors, but only their number, which we shall refer to as the countdown of a vertex. Theinitial countdown value for a vertex v can easily be computed ascountdown ( v ) = rank H ( v ) − |{ ( v, w ) ∈ U ( G ) | rank H ( w ) < rank H ( v ) }| where rank H ( v ) denotes the number of vertices smaller than v in the linear ordering describing H .When we process a vertex v , i.e., append it to the current output ordering, we would then need to reducethe countdown for all descendants of v in H . To avoid the complexity of doing this, we instead increase the countdown for all non- descendants of v in H , which modifies the countdown function to denote thenumber of unprocessed ancestors plus the number of processed vertices. Thus all ancestors of v have beenprocessed once its countdown reaches the number of processed vertices, which is easy to track.Note though that the number of non-descendants of v in H can still be huge (on average it will be evenlarger than the number of descendants). However, non-descendants of v are either ancestors of v in H orneighbors of v in G . As ancestors of v must have been processed already by the time we process v , we no characterization of maximal 2-dimensional subgraphs of transitive graphs v in G to beupdated, and the total number of those is bounded by the size of G .We summarize this description as Algorithm 2. Algorithm 2
Merge H with transitive orientation of complement Input:
Transitive DAG G , linear order L H describing orientation H of G Output:
Linear order L describing G H ∪ H ∗ procedure C OMPLEMENT -M ERGE ( G, L H ) for v ∈ V do countdown ( v ) ← rank H ( v ) − |{ ( v, w ) ∈ U ( G ) | rank H ( w ) < rank H ( v ) }| S ← {} ; L ← [ ] ; L G ← some linearization of G for i = 0 .. ( | V | − do add vertices v with countdown ( v ) = i to S remove from s vertex s ∈ S with minimal rank in L G append s to L for neighbors v of s in G do if countdown ( v ) > i then countdown ( v ) ← countdown ( v ) + 1 return L Correctness of Algorithm 2 should be evident from the preceeding discussion. The first for-loop canbe implemented in O ( m ) by iterating once over the edges in U ( G ) . Using a suitable data structure fortracking vertices by countdown, e.g. an array of lists of vertices together with pointers into these lists, anda heap for S as in Algorithm 1, one can implement the second for-loop to run in O ( m + n · log n ) . With Theorem 2 we have established a tight relationship between 2-dimensional subgraphs of a transitivegraph G (or permutation subgraphs of a transitively orientable graph G ), and orientations of the com-plement of G . Together with Algorithm 2 for computing the 2-dimensional subgraph induced by suchan orientation, this reduces the problem of finding maximal 2-dimensional subgraphs (or permutationsubgraphs) to that of finding optimal near-transitive orientations.This problem reduction is of course only a first step, with many of open problems that still need tobe addressed. Foremost is the issue of finding optimal near-transitive orientations - a polynomial timealgorithm or proof of the problem’s hardness would be the logical next step here. Until then, the approachdescribed in Section 3.2 for extending an existing 2-dimensional subgraph may be of some use.Furthermore, transitive graphs typically arise as the transitive closure of a given graph (e.g. for reach-ability queries). It would thus be helpful if Algorithm 2 could be improved to work with non-transitivegraphs, without explicitly computing the transitive closure first.Finally, we briefly suggested that 2-dimensional subgraphs might be a suitable replacement for trees inthe design of tracktable algorithm. This idea still remains to be explored.0 Henning Koehler
References [1] Rakesh Agrawal, Alexander Borgida, and H. V. Jagadish. Efficient management of transitive relation-ships in large data and knowledge bases. In
SIGMOD , pages 253–262, 1989.[2] Elias Dahlhaus, Jens Gustedt, and Ross M. McConnell. Partially complemented representations ofdigraphs.
Discrete Mathematics & Theoretical Computer Science , 5(1):147–168, 2002.[3] Ben Dushnik and E. W. Miller. Partially ordered sets.
American Journal of Mathematics , 63(3):600–610, 1941.[4] Shimon Even, Amir Pnueli, and Abraham Lempel. Permutation graphs and transitive graphs.
J. ACM ,19(3):400–410, 1972.[5] T. Gallai. Transitiv orientierbare graphen.
Acta Mathematica Academiae Scientiarum Hungarica ,18(1-2):25–66, 1967.[6] Martin Charles Golumbic.
Algorithmic Graph Theory and Perfect Graphs (Annals of Discrete Math-ematics, Vol 57) . North-Holland Publishing Co., Amsterdam, The Netherlands, The Netherlands,2004.[7] Ross M. McConnell and Jeremy Spinrad. Modular decomposition and transitive orientation.
DiscreteMathematics , 201(1-3):189–241, 1999.[8] Ross M. McConnell and Jeremy P. Spinrad. Ordered vertex partitioning.
Discrete Mathematics &Theoretical Computer Science , 4(1):45–60, 2000.[9] Mihalis Yannakakis. The complexity of the partial order dimension problem.