A recognition algorithm for adjusted interval digraphs
aa r X i v : . [ c s . D M ] O c t A recognition algorithm for adjusted interval digraphs
Asahi Takaoka a a Department of Information Systems Creation, Faculty of Engineering, Kanagawa University,Rokkakubashi 3-27-1, Kanagawa-ku, Yokohama-shi, Kanagawa, 221–8686, Japan
Abstract
Min orderings give a vertex ordering characterization, common to some graphsand digraphs such as interval graphs, complements of threshold tolerance graphs(known as co-TT graphs), and two-directional orthogonal ray graphs. An adjustedinterval digraph is a reflexive digraph that has a min ordering. Adjusted intervaldigraph can be recognized in O ( n ) time, where n is the number of vertices of thegiven graph. Finding a more e ffi cient algorithm is posed as an open question. Thisnote provides a new recognition algorithm with running time O ( n ). The algorithmproduces a min ordering if the given graph is an adjusted interval digraph. Keywords:
Adjusted interval digraphs, Min ordering, Recognition algorithm
1. Introduction
All graphs and directed graphs (digraphs for short) considered in this paperare finite and have no multiple edges but may have loops. We write uv for theundirected edge joining a vertex u and a vertex v ; we write ( u , v ) for the directededge from u to v . We write V ( H ) for the vertex set of a digraph H ; we write E ( H )for the edge set of H . We say that u dominates v (and that v is dominated by u ) ina digraph H if ( u , v ) ∈ E ( H ), and denote it by u → v or v ← u .A digraph H is an interval digraph [5] if for each vertex v of H , there is apair of intervals I v and J v on the real line such that u → v in H if and only if I u intersects J v . An interval digraph is an adjusted interval digraph [2] if the twointervals I v and J v have the same left endpoint for each vertex v . A digraph iscalled reflexive if every vertex has a loop, and every adjusted interval digraph isreflexive by definition. Email address: [email protected] (Asahi Takaoka)
Preprint submitted to arXiv October 16, 2018 djusted interval digraphs have been introduced by Feder et al. [2] in connec-tion with the study of list homomorphisms. They have shown two characteriza-tions and a recognition algorithm of this graph class.A min ordering of a digraph H is a linear ordering ≺ of the vertices of H such that for any two edges ( u , v ) and ( u ′ , v ′ ) of H , we have ( u , v ′ ) ∈ E ( H ) if u ≺ u ′ and v ′ ≺ v . We remark that ( u , v ) can be a loop, and similarly for ( u ′ , v ′ ).A reflexive digraph has a min ordering if and only if it is an adjusted intervaldigraph [2]. Min orderings give similar characterizations of some graph classessuch as interval graphs, complements of threshold tolerance graphs (known asco-TT graphs) [4], two-directional orthogonal ray graphs [6], and signed-intervaldigraphs [3]. See [3] for details.Suppose that a digraph H has a min ordering ≺ , and let ( u , v ) , ( u ′ , v ′ ) be twoedges of H with ( u , v ′ ) < E ( H ). We have v , v ′ from ( u , v ) ∈ E ( H ) and ( u , v ′ ) < E ( H ); similarly, we have u , u ′ from ( u ′ , v ′ ) ∈ E ( H ) and ( u , v ′ ) < E ( H ). If u ≺ u ′ and v ′ ≺ v , then ( u , v ′ ) ∈ E ( H ) by the property of min orderings, a contradiction.Thus, u ≺ u ′ implies v ≺ v ′ and v ′ ≺ v implies u ′ ≺ u . We can capture this forcingrelation with an auxiliary digraph. The pair digraph H + associated with a digraph H is a digraph such that the vertex set V ( H + ) is the set { ( u , v ) : u , v } of orderedpair of two vertices of H , and ( u , u ′ ) → ( v , v ′ ) and ( v ′ , v ) → ( u ′ , u ) in H + if andonly if ( u , v ) , ( u ′ , v ′ ) ∈ E ( H ) and ( u , v ′ ) < E ( H ).An invertible pair of a digraph H is a pair of two vertices u , v of H such thatin H + , the vertices ( u , v ) and ( v , u ) are in the same strong component. It is clearthat if H has an invertible pair, then H does not have any min ordering. Feder etal. [2] have shown that the converse also holds; therefore, a reflexive digraph hasno invertible pairs if and only if it has a min ordering.The characterizations of adjusted interval digraphs yield a recognition algo-rithm with running time O ( m + n ), where n and m are the number of verticesand edges of the given graph, respectively [2]. Finding a linear-time recogni-tion algorithm is posed as an open question [2, 3]. In this paper, we show an O ( n )-time recognition algorithm for adjusted interval digraphs. The algorithmproduces a min ordering or finds an invertible pair of the given graph if it exists.As a byproduct, we also give an alternative proof to show that a reflexive digraphhas a min ordering if and only if it has no invertible pairs.
2. Algorithm
In the case of reflexive digraphs, there is an equivalent simpler definition ofmin orderings. 2 heorem 1 (Feder et al. [2]) . Let H be a reflexive digraph. A linear ordering ≺ ofthe vertices of H is a min ordering if and only if for any three vertices u , v , w withu ≺ v ≺ w, – ( u , w ) ∈ E ( H ) implies ( u , v ) ∈ E ( H ) , and – ( w , u ) ∈ E ( H ) implies ( v , u ) ∈ E ( H ) . In other words, a linear ordering ≺ of the vertices of a reflexive digraph is amin ordering if it contains no triples of vertices u , v , w with u ≺ v ≺ w such that( u , w ) ∈ E ( H ) and ( u , v ) < E ( H ), or ( w , u ) ∈ E ( H ) and ( v , u ) < E ( H ). We call suchtriples of vertices the forbidden patterns .Let H be an adjusted interval digraph with a min ordering ≺ . Let u , v , w bedistinct vertices of H with ( u , w ) ∈ E ( H ) and ( u , v ) < E ( H ), or ( w , u ) ∈ E ( H ) and( v , u ) < E ( H ). In both cases, if u ≺ v ≺ w then we have a forbidden pattern. Thus, u ≺ v implies w ≺ v and v ≺ w implies v ≺ u . To capture this forcing relation, wedefine an auxiliary digraph associated with H . Definition 2.
Let H be a reflexive digraph. The implication graph H ∗ of H is adigraph such that the vertex set V ( H ∗ ) is the set { ( u , v ) : u , v } of ordered pair oftwo vertices of H , and for any three vertices u , v , w of H , we have ( u , v ) → ( w , v )and ( v , w ) → ( v , u ) in H ∗ if and only if – ( u , w ) ∈ E ( H ) and ( u , v ) < E ( H ), or – ( w , u ) ∈ E ( H ) and ( v , u ) < E ( H ).We can use the implication graphs for recognizing adjusted interval digraphs. Lemma 3.
Let H and H ∗ be a reflexive digraph and its implication graph, respec-tively. A pair of two vertices u , v ∈ V ( H ) is an invertible pair if and only if in H ∗ ,the vertices ( u , v ) and ( v , u ) are in the same strong component.Proof. Let H + be the pair digraph of H . Let u , v , w be three vertices of H suchthat ( u , v ) → ( w , v ) in H ∗ (or equivalently, ( v , w ) → ( v , u ) in H ∗ ). By definition,( u , w ) ∈ E ( H ) and ( u , v ) < E ( H ), or ( w , u ) ∈ E ( H ) and ( v , u ) < E ( H ). Sincethe vertex v has a loop, in both cases ( u , v ) → ( w , v ) and ( v , w ) → ( v , u ) in H + .Therefore, H ∗ is a subgraph of H + .Assume that ( u , v ) → ( u ′ , v ′ ) in H + . By definition, ( u , u ′ ) , ( v , v ′ ) ∈ E ( H ) and( u , v ′ ) < E ( H ), or ( u ′ , u ) , ( v ′ , v ) ∈ E ( H ) and ( v ′ , u ) < E ( H ). In both cases, if ( u , u ′ )or ( v , v ′ ) is a loop, then ( u , v ) → ( u ′ , v ′ ) in H ∗ . Thus we may assume u , u ′ and v , v ′ . We have u , v ′ since H is reflexive. Recall that u , v and u ′ , v ′ . Thus,3he vertices u , v , v ′ are distinct, and ( u , v ) → ( u , v ′ ) in H ∗ . Similarly, the vertices u , u ′ , v ′ are distinct, and ( u , v ′ ) → ( u ′ , v ′ ) in H ∗ . Therefore, if ( u , v ) → ( u ′ , v ′ ) in H + , then H ∗ has a directed path from ( u , v ) to ( u ′ , v ′ ).Lemma 3 gives an algorithm to find an invertible pair if it exists. Given areflexive digraph H , the algorithm first construct the implication graph H ∗ of H ,then compute the strong components of H ∗ , and finally check for the existence ofa pair ( u , v ) and ( v , u ) within one strong component. The implication graph H ∗ has n ( n −
1) vertices, and at most 2 nm edges since H ∗ has at most two edges for eachpair of a vertex and an edge of H . Therefore, we can construct H ∗ in time O ( nm ),and check for the existence of invertible pairs in the same time bound.We next describe the algorithm for producing a min ordering of an adjustedinterval digraph. Let H and H ∗ be a reflexive digraph and its implication graph,respectively. As an auxiliary graph, we use a complete graph K with the vertexset V ( H ). An orientation of K is a digraph obtained from K by orienting eachedge of K , that is, replacing each edge uv ∈ E ( K ) with either ( u , v ) or ( v , u ). Anorientation of K is acyclic if it contains no directed cycles; an acyclic orientationof K is equivalent to a linear ordering of the vertices of H .We say that a vertex ( u , v ) of H ∗ is an implicant of a vertex ( u ′ , v ′ ) if H ∗ has adirected walk from ( u ′ , v ′ ) to ( u , v ). We say that an orientation T of K is consistentwith H if for each vertex ( u , v ) of H ∗ , we have u → v in T implies u ′ → v ′ for every implicant ( u ′ , v ′ ) of ( u , v ). It is clear that an acyclic orientation of K isconsistent with H if and only if it contains no forbidden patterns of min orderings.Therefore, a min ordering of H is equivalent to an orientation of K that is acyclicand consistent with H .It is su ffi cient for the existence of a min ordering of H that there is an orienta-tion of K consistent with H . Lemma 4.
There is a min ordering of H if and only if there is an orientation of Kconsistent with H.
Let T be an orientation of K consistent with H that is not acyclic. In order toprove Lemma 4, we provide an algorithm for producing another orientation of K that is acyclic and consistent with H .A directed triangle is a directed cycle of length 3. It is well known that anorientation of a complete graph is acyclic if and only if it contains no directedtriangles. Let u be a vertex of K , and let E u be the set of all the edges ( v , w ) ∈ E ( T )such that u → v , v → w , and w → u in T . The reversal E − u of E u is the setof directed edges obtained from E u by reversing the direction of all the edges4n E u , that is, E − u = { ( x , y ) : ( y , x ) ∈ E u } . We define that T ′ is the orientationof K obtained from T by reversing the direction of all the edges in E u , that is, E ( T ′ ) = ( E ( T ) − E u ) ∪ E − u .We will show that the orientation T ′ has the following properties: T ′ is stillconsistent with H ; T ′ contains no directed triangles having the vertex u ; the re-versing the direction of edges in E u generates no directed triangles. Therefore,by repeated application of this procedure for each vertex of K , we can obtainan orientation of K that is acyclic and consistent with H ; the complexity of thealgorithm is O ( n ).To show that T ′ is still consistent with H , we prove a lemma for directedtriangles in the orientation of K consistent with H . Lemma 5.
Let T be an orientation of K consistent with H. Suppose that T hasthree vertices u , v , w such that u → v, v → w, and w → u in T . If v ′ → w ′ in Tand ( v ′ , w ′ ) → ( v , w ) in H ∗ , then u → v ′ , v ′ → w ′ , and w ′ → u in T .Proof. We say that a set of vertices S ⊆ V ( H ) is complete if ( x , y ) , ( y , x ) ∈ E ( H )for any two vertices x , y ∈ S , and is independent if ( x , y ) , ( y , x ) < E ( H ). We claimthat the set of vertices { u , v , w } is complete or independent. Suppose ( u , v ) ∈ E ( H ).If ( w , v ) < E ( H ), then ( v , w ) → ( u , w ) in H ∗ , a contradiction. Thus ( w , v ) ∈ E ( H ).If ( w , u ) < E ( H ), then ( w , u ) → ( v , u ) in H ∗ , a contradiction. Thus ( w , u ) ∈ E ( H ).If ( v , u ) < E ( H ), then ( u , v ) → ( w , v ) in H ∗ , a contradiction. Thus ( v , u ) ∈ E ( H ).Continuing in this way, we have that { u , v , w } is complete.We have either v ′ = v or w ′ = w . Suppose v ′ = v . Since ( v ′ , w ′ ) → ( v , w ) in H ∗ ,we have ( v , w ) < E ( H ) and ( w ′ , w ) ∈ E ( H ), or ( w , v ) < E ( H ) and ( w , w ′ ) ∈ E ( H ).In both cases, the set of vertices { u , v , w } is independent. Since ( u , w ) < E ( H ) and( w ′ , w ) ∈ E ( H ), or ( w , u ) < E ( H ) and ( w , w ′ ) ∈ E ( H ), we have ( w , u ) → ( w ′ , u ) in H ∗ ; therefore, w ′ → u in T .We next suppose w ′ = w . Since ( v ′ , w ′ ) → ( v , w ) in H ∗ , we have ( v ′ , w ′ ) < E ( H ) and ( v ′ , v ) ∈ E ( H ), or ( w ′ , v ′ ) < E ( H ) and ( v , v ′ ) ∈ E ( H ). Due to symmetry,we may assume ( v ′ , w ′ ) < E ( H ) and ( v ′ , u ) ∈ E ( H ). If ( v ′ , u ) ∈ E ( H ), we have( v ′ , w ′ ) → ( u , w ) in H ∗ , a contradiction. Thus ( v ′ , u ) < E ( H ). We now have( u , v ) → ( u , v ′ ) in H ∗ , and therefore, u → v ′ in T .Suppose that T ′ is not consistent with H . Then, there exist three vertices x , y , z such that x → y and y → z in T ′ but ( x , y ) → ( z , y ) in H ∗ (or equivalently,( y , z ) → ( y , x ) in H ∗ ). Since T is consistent with H , we have ( x , y ) ∈ E − u or( y , z ) ∈ E − u . Suppose ( x , y ) , ( y , z ) ∈ E − u . We have that ( x , y ) ∈ E − u implies u → y in T and ( y , z ) ∈ E − u implies y → u in T , a contradiction. If ( x , y ) ∈ E − u and5 y , z ) < E − u , then ( y , x ) ∈ E u and y → z in T . Since ( y , z ) → ( y , x ) in H ∗ , wehave from Lemma 5 that ( y , z ) ∈ E u , a contradiction. Similarly, if ( x , y ) < E − u and( y , z ) ∈ E − u , then x → y in T and ( z , y ) ∈ E u . Since ( x , y ) → ( z , y ) in H ∗ , we havefrom Lemma 5 that ( x , y ) ∈ E u , a contradiction. Therefore, T ′ is still consistentwith H .Trivially, T ′ contains no directed triangles having the vertex u .Let x , y , z be three vertices such that x → y , y → z , and z → x in T ′ . Suppose( x , y ) , ( y , z ) ∈ E − u . We have that ( x , y ) ∈ E − u implies u → y in T and ( y , z ) ∈ E − u implies y → u in T , a contradiction. Thus at most one edge on the directed triangleis in E − u . Suppose ( x , y ) ∈ E − u and ( y , z ) , ( z , x ) < E − u . We have u → y , y → z , z → x ,and x → u in T . If u → z in T then ( z , x ) ∈ E u ; if z → u in T then ( y , z ) ∈ E u , acontradiction. Therefore, the reversing the direction of edges in E u generates nodirected triangles, and we have Lemma 4.We now show an algorithm for finding an orientation of K consistent with H . We use an algorithm for the 2-satisfiability problem. An instance of the 2-satisfiability problem is a , a Boolean formula in conjunctive normalform with at most two literals per clause. We construct the 2CNF formula φ H associated with H . Assume that the vertices of H are linearly ordered, and let x ( u , v ) be a Boolean variable if a vertex u of H precedes a vertex v in this ordering.We denote the negation of x ( u , v ) by x ( v , u ) . We define that φ H is a 2CNF formulaconsisting of all the clauses ( x ( u , v ) ∨ x ( v , w ) ) such that ( u , w ) ∈ E ( H ) and ( u , v ) < E ( H ), or ( w , u ) ∈ E ( H ) and ( v , u ) < E ( H ).Let τ be a truth assignment of φ H . We define that an orientation of K associatedwith τ is an orientation T τ such that u → v in T τ if and only if x ( u , v ) = τ for anytwo vertices u , v of K . It is clear from the construction of φ H that T τ is consistentwith H if and only if τ satisfies φ H . Lemma 6.
There is an orientation of K consistent with H if and only if φ H issatisfiable. The 2CNF formula φ H has at most n ( n − / nm clauses since φ H has at most one clause for each pair of a vertex and an edge of H . Thus φ H can be constructed in O ( nm ) time. Since a satisfying truth assignmentof φ H can be computed in time linear to the size of φ H (see [1] for example), wecan find an orientation of K consistent with H in O ( nm ) time.Let φ be a 2CNF formula. For a Boolean variable x i in φ , the negation of x i is denoted by x i . The implication graph G ( φ ) of φ is the digraph constructed asfollows: for each variable x i , we add two vertices named x i and x i to G ( φ ); foreach clause ( x i , x j ), we add two edges to G ( φ ) so that x i → x j and x j → x i . A6CNF formula φ is satisfiable if and only if in G ( φ ), any pair of vertices x i and x i are not in the same strong component [1].For a reflexive digraph H , it is clear from the construction of φ H and H ∗ that G ( φ H ) is isomorphic to the subgraph of H ∗ obtained by removing all the isolatedvertices of H ∗ . Therefore, we have the following. Lemma 7.
The 2CNF formula φ H is satisfiable if and only if H has no invertiblepairs. From Lemmas 4, 6, and 7, we now have an alternative proof for the theoremof Feder et al. [2].
Theorem 8.
A reflexive digraph has a min ordering if and only if it contains noinvertible pairs.
We finally summarize our algorithm for recognizing adjusted interval graphs.This algorithm produces a min ordering of the given graph if it is an adjustedinterval digraph, and finds an invertible pair if otherwise.
Algorithm 9.
Let H be a reflexive digraph. Step 1.
Compute a 2CNF formula φ H from H . Step 2.
Find a satisfying truth assignment of φ H .If φ H is satisfiable, go to Step 3. Otherwise, go to Step 4. Step 3.
Let τ be a satisfying truth assignment of φ H .Compute an orientation T τ of K associated with τ .Compute a min ordering of H from T τ if T τ is not acyclic.Output the min ordering of H , and halt. Step 4.
Construct the implication graph H ∗ of H . Then, find an invertible pair.Output the invertible pair of H , and halt.The correctness of the algorithm follows from Lemmas 4, 6, and 7. Steps 1, 2,and 4 can be performed in O ( nm ) time; Step 3 can be performed in O ( n ) time. Theorem 10.
Adjusted interval digraphs can be recognized in O ( n ) time. References [1] B. Aspvall, M. F. Plass, and R. E. Tarjan.A linear-time algorithm for testing the truth of certain quantified boolean formulas.
Inf. Process. Lett. , 8(3):121–123, 1979.72] T. Feder, P. Hell, J. Huang, and A. Rafiey.Interval graphs, adjusted interval digraphs, and reflexive list homomorphisms.
Discrete Appl. Math. , 160(6):697–707, 2012.[3] P. Hell, J. Huang, R. M. McConnell, and A. Rafiey.Interval-Like Graphs and Digraphs. In I. Potapov, P. Spirakis, and J. Worrell,editors,
Proceedings of the 43rd International Symposium on MathematicalFoundations of Computer Science (MFCS 2018) , volume 117 of
LeibnizInternational Proceedings in Informatics (LIPIcs) , pages 68:1–68:13. SchlossDagstuhl – Leibniz-Zentrum f¨ur Informatik, 2018.[4] C. L. Monma, B. Reed, and W. T. Trotter. Threshold tolerance graphs.
J.Graph Theory , 12(3):343–362, 1988.[5] M. Sen, S. Das, A. B. Roy, and D. B. West.Interval digraphs: An analogue of interval graphs.
J. Graph Theory ,13(2):189–202, 1989.[6] A. M. S. Shrestha, S. Tayu, and S. Ueno. On orthogonal ray graphs.