<<

arXiv:1907.07845v2 [cs.DM] 10 May 2021 reigcaatrzto . characterization ordering etcsaeajcn fadol ftecrepnigobjec corresponding the if a only and if adjacent are vertices nescingaho nevl ntera ie Let line. real the on intervals of graph intersection neetn tutrsadapiain 5 3 23]. 13, [5, applications and structures interesting A ie 1] 1,Term11] ata order partial A 1.11]. Theorem [15, [14], lines recog several and investigated, well is graphs trapezoid of trapezoid iscmltl otelf of left the to completely lies on re sas nw sa as known also is order order eonto loihs[9 6 7.A oe n[9,ti i this di for [19], from in shown orders noted of been As intersection have interv 27]. 26, results an [19, algorithms and structural recognition order Several linear a orders. of such intersection the is it because rniie n hrfr smerc h set The asymmetric. therefore and transitive, nevlon eonzdi oyoiltm.I eto ,w hwtobypr 7. Section two show in research we further 6, and Section results In time. t polynomial showing in invariant, recognized comparability a is linear-semiorder linea a for algorithm recognition polynomial-time a propose L 2 representation emtto graph permutation 2010 Date e od n phrases. and words Key rp san is graph A omngnrlzto ftetogahcassi trapezoi is classes graph two the of generalization common A elkoneape fitreto rpsaeitra gr interval are graphs intersection of examples Well-known hr ssm orsodnebtenprilodr n int and orders partial between correspondence some is There yrsrcigtaeod nterpeetto,mn orde many representation, the in trapezoids restricting By hspprdaswt ptinl resrpeetbeb t by representable orders up-triangle with deals paper This (strict) A en rpzi between trapezoid a define V nti ae,w ilda nywt ata reso finite on orders partial with only deal will we paper, this In . 2 saprilodrrpeetbeb rage pne by spanned triangles by representable order partial a is [2] a 1 2021. 11, May : ahmtc ujc Classification. Subject Mathematics tutrlrslshv enkon hsppritoue a introduces paper This known. been have results structural A linear-semiorder hticmaaiiygah flna-eirescnb re be can linear- of graphs incomparability that prov also We linear-semiorders. for algorithm recognition T nScin3 eso hrceiaino linear-semiord of characterization a show we 3, Section In . bstract L ( v 2 atal ree set ordered partially between ) Fg ) uha re steitreto falna re a order linear a of intersection the is order an Such 1). (Fig. ieritra re steitreto falna ord linear a of intersection the is order linear-interval A . ftegah nescingah fgoercojcshave objects geometric of graphs . the of nescingraph intersection IERSMODR N HI NOPRBLT GRAPHS INCOMPARABILITY THEIR AND LINEAR-SEMIORDERS steitreto rp fln emnsjiigapiton point a joining segments line of graph intersection the is fi steitreto falna re n eire.We semiorder. a and order linear a of intersection the is it if oprblt nain,Lna-nevlodr,P grap PI orders, Linear-interval invariant, Comparability L 1 Iorder PI and T ff L ( rn classes. erent v L 1 .Testo trapezoids of set The ). 2 and sapi ( pair a is uhta o n w elements two any for that such 5 ,8,where 8], 6, [5, fteei e fojcssc htec etxcorresponds vertex each that such objects of set a is there if L 56,0C5 81,0A7. 06A07 68R10, 05C75, 05C62, 2 A . rpzi graph trapezoid V V , P scle a called is P ,where ), naset a on .P 2. .I 1. SH TAKAOKA ASAHI L 1 PI and ntroduction htbigalna-eire sacmaaiiyinvarian comparability a is linear-semiorder a being that e reliminaries onzdi oyoiltime. polynomial in cognized tnsfor stands { T V a noprblt rpso iersmodr a lob also can linear-semiorders of graphs incomparability hat e ucaso ieritra res ecl ata or partial a call We orders. linear-interval of subclass new rudset ground iinagrtm r rsne 1,2,23]. 20, [15, presented are algorithms nition L -eiresi eto .I eto ,w rv htbeing that prove we 5, Section In 4. Section in r-semiorders 1 shv oepyitreto.Testo bet scalled is objects of set The intersection. nonempty a have ts V ( n ftefis eut o eonzn resta r the are that orders recognizing for results first the of one s 2 v sastand set a is lodr euetetr ieritra rest denote to orders linear-interval term the use We order. al steitreto rp fsc rpzis h structure The trapezoids. such of graph intersection the is ): etohrzna ie nthe in lines horizontal two be sa is lse aebe nrdcd[,3 1.An 21]. 3, [2, introduced been have classes r psadpruaingah.An graphs. permutation and aphs hsodrcas[,8 5,icuigpolynomial-time including 25], 8, [6, class order this rada nevlodr o hscaso res several orders, of class this For order. interval an and er reto rpso emti bet ewe h two the between objects geometric of graphs ersection v inlssandb on on point a by spanned riangles dcso h hrceiain efial ics our discuss finally We characterization. the of oducts rps[,9.A nevlon interval An 9]. [8, graphs d rpzi order trapezoid ∈ sets. on on point a u point-interval v , V s eonto loih,Smodr,Tinl res V orders, Triangle Semiorders, algorithm, Recognition hs, n h relation the and } ∈ scle a called is hwacaatrzto n polynomial-time a and characterization a show P V r ntrso ieretnin.W then We extensions. linear of terms in ers ehv that have we , sabnr eainon relation binary a is dasmodr ec ecl ta it call we hence semiorder; a nd enwdl netgtdbcueo their of because investigated widely been L 1 n nitra on interval an and n sa as and , rpzi representation trapezoid ffrec element each for if L 1 n on on point a and P scle (strict) a called is u ≺ x ieritra order linear-interval y v paewith -plane in L L P nevlgraph interval oa betadtwo and object an to V 1 1 L fadol if only and if n nitra on interval an and L hti irreflexive, is that n a and 2 ,showing t, nup-triangle An . 2 v . ∈ e a der ata order partial L V of up-triangle 1 unit-length hr sa is there , above P . linear- sthe is T [19] ertex L ( u 2 e ) . d f a b c d e f L1 c

b e

L a 2

(a) (b)

Figure 1. A partial order (the dual of chevron) with a triangle representation.

We denote partial orders by ≺ instead of P, that is, we write u ≺ v in P if (u,v) ∈ P. Two elements u,v ∈ V are comparable in P if u ≺ v or u ≻ v; otherwise u and v are incomparable, denoted by u k v. A partial order P on a set V is a linear order if any two distinct elements of V are comparable in P. A partial order P on a set V is an if for each element v ∈ V, there is a (closed) interval I(v) on the real line such that for any two elements u,v ∈ V, we have that u ≺ v in P if and only if I(u) lies completely to the left of I(v). Here, the interval I(u) = [l(u), r(u)] lies completely to the left of I(v) = [l(v), r(v)], and we write I(u) ≪ I(v), if r(u) < l(v). The set of intervals {I(v): v ∈ V} is called an interval representation of P. An interval representation is unit if every interval has unit length, and it is proper if no interval properly contains another. An interval order is a semiorder if it has a unit interval representation. It is known that a partial order is a semiorder if and only if it has a proper interval representation [4]. Let P1 and P2 be two partial orders on the same ground set V. The intersection of P1 and P2 is the partial order P = P1 ∩ P2. Equivalently, the intersection of P1 and P2 is the partial order P on V such that u ≺ v in P if and only if u ≺ v in both P1 and P2. We call an ordera linear-semiorder if it is the intersection of a linear order and a semiorder. In addition to partially ordered sets, this paper deals with graphs. All graphs in this paper are finite with no loops or multiple edges. Unless stated otherwise, graphs are assumed to be undirected, but we also deal with graphs with directed edges. We write uv for the undirected edge joining two vertices u and v and write (u,v) for the directed edge from u to v. For a graph G = (V, E), we sometimes write V(G) for the vertex set V and write E(G) for the edge set E. Let P be a partial order on a set V. The of P is the graph G such that uv ∈ E(G) if and only if u and v are comparable in P. The incomparability graph of P is the graph G such that uv ∈ E(G) if and only if u k v in P. Note that the incomparability graph of P is the complement of the comparability graph of P, where the complement of a graph G is the graph G such that V(G) = V(G) and uv ∈ E(G) if and only if uv < E(G) for any two vertices u,v ∈ V(G). Let G be a graph, and let E ⊆ E(G) be a set of (undirected) edges of G. We call a set F of directed edges an orientation of E if F is obtained from E by orienting each edge of E, that is, replacing each edge uv ∈ E with either (u,v)or (v, u). An orientation of G is an orientation of E(G). An orientation F of G is transitive if (u,v) ∈ F and (v,w) ∈ F then (u,w) ∈ F for any three vertices u,v,w ∈ V(G). Note that a partial order P on a set V can be viewed as a transitive orientation F of the comparability graph of P, in which (u,v) ∈ F if and only if u ≺ v in P. We also note that a graph is a comparability graph if and only if it has a transitive orientation. A linear-time algorithm is known for computing a transitive orientation of a comparability graph [18]. However, the algorithm might produce an orientation that is not transitive if the given graph is not a comparability graph. Thus, to recognize comparability graphs, we must verify the transitivity after computing the orientation. An orientation F of a graph G is quasi-transitive if (u,v) ∈ F and (v,w) ∈ F then uw ∈ E(G), that is, either (u,w) ∈ F or (w, u) ∈ F. In other words, an orientation F of G is quasi-transitive if for any three vertices u,v,w ∈ V with uv,vw ∈ E(G) and uw < E(G), either (u,v), (w,v) ∈ F or (v, u), (v,w) ∈ F. We can see that an orientation is transitive if and only if it is quasi-transitive and acyclic. The linear-time algorithm [18] produces a of an orientation F of a given graph G such that F is transitive if G is a comparability graph. Obviously, F is acyclic. We can test whether F is quasi-transitive by checking either (u,v), (w,v) ∈ F or (v, u), (v,w) ∈ F for any pair of a non-edge uw < E(G) and a vertex v ∈ V(G) with uv,vw ∈ E(G). Thus we have the following.

2 z

y w

y z y w x

x z

x (a) (b) (c)

Figure 2. (a) A forbidden configuration for 2 + 2. (b) A forbidden configuration for 3 + 1. (c)A partial order with (x,y), (y, z) ∈ P ∪ R1 ∪ R2 but (x, z) < P ∪ R1 ∪ R2. An arrow u → v denotes that u ≺ v in P; a dashed arrow u d v denotes that u ≺ v in L but u k v in P.

Proposition 1. Comparability graphs can be recognized in O(nm¯ ) time, where n and m¯ are the number of vertices and non-edges of the given graph. A transitive orientation of a graphG can be obtained in the same time bound if G is a comparability graph.

Let G be a graph. A sequence of four vertices (v0,v1,v2,v3) is an induced cycle of length 4 if v0v1,v1v2,v2v3,v3v0 ∈ E(G) and v0v2,v1v3 < E(G), denoted by C4. A graph consisting of four vertices v0,v1,v2,v3 is a claw if v0v1,v0v2,v0v3 ∈ E(G) and v1v2,v2v3,v3v1 < E(G), denoted by K1,3. A sequence of three vertices (v0,v1,v2)is an induced path of length 2 if v0v1,v1v2 ∈ E(G) and v0v2 < E(G), denoted by P3. 3. Characterization Let P be a partial order on a set V. A linear order L on V is a linear extension of P if u ≺ v in L whenever u ≺ v in P. Hence, a linear extension L of P has all the relations of P with additional relations making L linear. We define some properties of linear extensions. The order 2 + 2 of P is a partial order consisting of four elements x, y, z, w of V such that x ≺ y and z ≺ w whereas x k w and z k y in P. Note that x k z and y k w in P; otherwise, we would have x ≺ w or z ≺ y in P. We say that a linear extension L of P fulfills the 2 + 2 rule if y ≺ z or w ≺ x in L for each induced suborder 2 + 2 of P. If y ≺ z in L then x ≺ y ≺ z ≺ w in L; if w ≺ x in L then z ≺ w ≺ x ≺ y in L. Equivalently, a linear extension L of P fulfills the 2 + 2 rule if there are no four elements x,y, z,w of V such that x ≺ y, z ≺ w, x k w, and z k y in P whereas x ≺ w and z ≺ y in L (Fig. 2(a)). We call such an induced suborder a forbidden configuration for 2 + 2. The order 3 + 1 of P is a partial order consisting of four elements x, y, z, w of V such that x ≺ y ≺ z whereas x k w and w k z in P. Note that y k w in P; otherwise, we would have x ≺ w or w ≺ z in P. We say that a linear extension L of P fulfills the 3 + 1 rule if w ≺ x or z ≺ w in L for each induced suborder 3 + 1 of P. If w ≺ x in L then w ≺ x ≺ y ≺ z in L; if z ≺ w in L then x ≺ y ≺ z ≺ w in L. Equivalently, a linear extension L of P fulfills the 3 + 1 rule if there are no four elements x,y, z,w of V such that x ≺ y ≺ z, x k w, and w k z in P whereas x ≺ w ≺ z in L (Fig. 2(b)). We call such an induced suborder a forbidden configuration for 3 + 1. Note that the orders 2 + 2 and 3 + 1 characterize interval orders and semiorders as follows. A partial order is an interval order if and only if it does not contain 2 + 2 as an induced suborder [11]. A partial order is a semiorder if and only if it does not contain 2 + 2 or 3 + 1 as an induced suborder [22]. Our previous work [25] shows that a partial order is a linear-interval order if and only if it has a linear extension fulfilling the 2 + 2 rule. In this paper, we show the following characterization for linear-semiorders. Theorem 2. A partial order is a linear-semiorder if and only if it has a linear extension fulfilling the 2 + 2 and 3 + 1 rules. Proof. The necessity and sufficiency follow immediately from Lemmas 3 and 4, respectively.  Lemma 3. If a partial order P on a set V has a linear order L and a semiorder S with L ∩ S = P, then L is a linear extension of P fulfilling the 2 + 2 and 3 + 1 rules. 3 Proof. The linear order L can be viewed as a linear extension of P. It is shown in [8, 25] that L fulfills the 2 + 2 rule. We now show that L fulfills the 3 + 1 rule. Suppose that L has a forbidden configuration for 3 + 1 consisting of four elements x,y, z,w of V such that x ≺ y ≺ z, x k w, and z k w in P whereas x ≺ w ≺ z in L. Let {I(v): v ∈ V} be a proper interval representation of the semiorder S , and let I(v) = [l(v), r(v)] for each element v of V. Since x ≺ y ≺ z in P, we have r(x) < l(y) ≤ r(y) < l(z). Since x ≺ w in L and x k w in P, we have x ⊀ w in S . Thus l(w) ≤ r(x). Similarly, since w ≺ z in L and w k z in P, we have w ⊀ z in S . Thus l(z) ≤ r(w). Therefore, I(w) ⊇ I(y), contradicting that no interval properly contains another. 

Lemma 4. If a partial order P on a set V has a linear extension L fulfilling the 2 + 2 and 3 + 1 rules, then there is a semiorder S with L ∩ S = P. The semiorder S and its proper interval representation can be obtained in O(n3) time, where n is the number of elements of V. Proof. In this proof, we denote partial orders as a set of ordered pairs of elements. For example, we write (u,v) ∈ P if u ≺ v in P, and write (u,v) ∈ L − P if u k v in P and u ≺ v in L. We define the following two binary relations on V.

2 R1 = {(x,y) ∈ V : there is an element z ∈ V with (x, z) ∈ P and (y, z) ∈ L − P}; 2 R2 = {(x,y) ∈ V : there is an element z ∈ V with (z, x) ∈ L − P and (z,y) ∈ P}.

Let Q = P ∪ R1 ∪ R2. Note that the relation Q is not necessarily transitive. See a partial order in Fig. 2(c). We have (x,y) ∈ R2 and (y, z) ∈ R1, but(x, z) < P ∪ R1 ∪ R2.

Claim 1. There is a linear order LQ on V such that x ≺ y in LQ whenever (x,y) ∈ Q.

Proof of Claim 1. We say that a sequence of distinct elements (v0,v1,...,vk−1) of V is a cycle of Q if (vi,vi+1) ∈ Q for every index i with 0 ≤ i < k (indices are modulo k). The length of the cycle is the number k. To prove the claim, we show by a case analysis that Q has no cycles. Suppose that Q has a cycle of length 2. We first suppose (v0,v1) ∈ R1. Then there is an element u ∈ V with (v0, u) ∈ P and (v1, u) ∈ L − P. If(v1,v0) ∈ P then (v0, u) ∈ P implies (v1, u) ∈ P, a contradiction. If (v1,v0) ∈ R1 then there is an element w ∈ V with (v1,w) ∈ P and (v0,w) ∈ L − S . Thus L has a forbidden configuration for 2 + 2, a contradiction. If (v1,v0) ∈ R2 then there is an elements w ∈ V with (w,v0) ∈ P and (w,v1) ∈ L − S . Thus L has a forbidden configuration for 3 + 1, a contradiction. Therefore, (v0,v1) < R1. A similar argument would show (v0,v1) < R2. We finally suppose (v0,v1) ∈ P. Trivially, (v1,v0) < P. We also have (v1,v0) < R1 and (v1,v0) < R2 by symmetric arguments. Thus (v0,v1) < P. Therefore, Q has no cycles of length 2. Suppose that Q has a cycle of length greater than 2. Let (v0,v1,...,vk−1) be such a cycle with minimal length, that is, there are no relations (vi,v j) ∈ Q with j , i + 1. Suppose further that there is an index i with (vi,vi+1) ∈ P. If (vi+1,vi+2) ∈ P then (vi,vi+2) ∈ P, a contradiction. Suppose (vi+1,vi+2) ∈ R1. Then there is an element u ∈ V with (vi+1, u) ∈ P and (vi+2, u) ∈ L − P. We have (vi, u) ∈ P from (vi,vi+1), (vi+1, u) ∈ P. Now(vi, u) ∈ P and (vi+2, u) ∈ L − P imply (vi,vi+2) ∈ R1, a contradiction. Suppose (vi+1,vi+2) ∈ R2. Then there is an element u ∈ V with (u,vi+1) ∈ L − P and (u,vi+2) ∈ P. We have that vi k vi+2 in P; otherwise, (vi,vi+2) ∈ Q or (vi+2,vi) ∈ Q, a contradiction. Thus the elements u,vi+2,vi,vi+1 induce 2 + 2. Since L fulfills the 2 + 2 rule and (u,vi+1) ∈ L − P, we have (u,vi) ∈ L − P. Now (u,vi) ∈ L − P and (u,vi+2) ∈ P imply (vi,vi+2) ∈ R2, a contradiction. Therefore, there is no index i with (vi,vi+1) ∈ P. Supposethereis an index i with (vi,vi+1), (vi+1,vi+2) ∈ R1. Thenthere are two elements u0, u1 ∈ V with (vi, u0), (vi+1, u1) ∈ P and (vi+1, u0), (vi+2, u1) ∈ L − S . If(vi, u1) ∈ P then (vi+2, u1) ∈ L − P implies (vi,vi+2) ∈ R1, a contradiction. If (vi, u1) ∈ L − P then the elements vi, u0,vi+1, u1 induce a forbidden configuration for 2 + 2, a contradiction. Thus (u1,vi) ∈ L, and we have (vi+2, u0) ∈ L from (vi+2, u1), (u1,vi), (vi, u0) ∈ L. If(vi+2, u0) ∈ P then the elements vi+2, u0,vi+1, u1 induce a forbidden configuration for 2 + 2, a contradiction. If (vi+2, u0) ∈ L − P then (vi, u0) ∈ P implies (vi,vi+2) ∈ R1, a contradiction. Therefore, there is no index i with (vi,vi+1), (vi+1,vi+2) ∈ R1. A similar argument would show that there is no index i with (vi,vi+1), (vi+1,vi+2) ∈ R2. Now, there is an index i with (vi,vi+1) ∈ R1; hence (vi+1,vi+2) ∈ R2 and (vi+2,vi+3) ∈ R1. Note that the vertices vi,vi+1,vi+2 are distinct by assumption, but vi+3 could be identical to v1. Then there are three elements u0, u1, u2 ∈ V with (vi, u0), (u1,vi+2), (vi+2, u2) ∈ P and (vi+1, u0), (u1,vi+1), (vi+3, u2) ∈ L−P. We have u0 , u2; otherwise, the elements u1,vi+2, u2 = u0,vi+1 induce a forbidden configuration for 3 + 1, a contradiction. If (vi+2, u0) ∈ P then the elements u1,vi+2, u0,vi+1 induce a forbidden configuration for 3 + 1, a contradiction. If (vi+2, u0) ∈ L− P then (vi, u0) ∈ P implies (vi,vi+2) ∈ R1, a contradiction. Thus (u0,vi+2) ∈ L, and we have (vi+1, u2) ∈ L from (vi+1, u0), (u0,vi+2), (vi+2, u2) ∈ L. If 4 (vi+1, u2) ∈ P then (vi+3, u2) ∈ L − P implies (vi+1,vi+3) ∈ R1, a contradiction. If (vi+1, u2) ∈ L − P then the elements u1,vi+2, u2,vi+1 induce a forbidden configuration for 3 + 1, a contradiction. Therefore, the relation Q has no cycles, and thus the claim holds. 

Assume that the elements v1,v2,...,vn of V are indexed so that i < j if vi ≺ v j in LQ.

Claim 2. The elements v1,v2,...,vn satisfies the following properties:

(a) There are no three indices i, j, k with i < j < k such that (vi,vk) ∈ L − P and (v j,vk) ∈ P. (b) There are no three indices i, j, k with i < j < k such that (vi,vk) ∈ L − P and (vi,v j) ∈ P. (c) There are no four indices i, j, k, h with i < j < k < h such that (vi,vh) ∈ L − P and (v j,vk) ∈ P.

Proof of Claim 2. Suppose there are three indices i, j, k with i < j < k such that (vi,vk) ∈ L − P and (v j,vk) ∈ P. Then (v j,vi) ∈ R1, which implies v j ≺ vi in LQ, a contradiction. Thus the property (a) holds. Suppose there are three indices i, j, k with i < j < k such that (vi,vk) ∈ L − P and (vi,v j) ∈ P. Then (vk,v j) ∈ R2, which implies vk ≺ v j in LQ, a contradiction. Thus the property (b) holds. Suppose there are four indices i, j, k, h with i < j < k < h such that (vi,vh) ∈ L−P and (v j,vk) ∈ P. If(vi,vk) ∈ P then the indices i, k, h satisfy i < k < h with (vi,vh) ∈ L − P and (vi,vk) ∈ P, contradicting the property (b). If (vi,vk) ∈ L − P then the indices i, j, k satisfy i < j < k with (vi,vk) ∈ L − P and (v j,vk) ∈ P, contradicting the property (a). Thus (vk,vi) ∈ L. A similar argument would show (vh,v j) ∈ L. Then(vi,vh), (vh,v j), (v j,vk), (vk,vi) ∈ L, a contradiction. Thus the property (c) holds. 

We define a function f : {1, 2,..., n} → N recursively as follows. For the base case, we set f (1) = 0; for each index j with 1 < j ≤ n, we set  max{i: f ( j − 1) < i and (vi,v j) ∈ P} if there is an index i with f ( j − 1) < i and (vi,v j) ∈ P, f ( j) =   f ( j − 1) otherwise. Claim 3. The function f satisfies the following properties: (a) 0 ≤ f (i) < i. (b) Ifi < j then f (i) ≤ f ( j). (c) If (vi,v j) ∈ P then i ≤ f ( j). (d) If (vi,v j) ∈ L − P then f ( j) < i.

Proof of Claim 3. Trivially, f satisfies the properties (a)–(c). Suppose there are two indices i and j with (vi,v j) ∈ L − P and i ≤ f ( j). If(v f ( j),v j) ∈ P then i , f ( j), that is, i < f ( j). Hence the indices i, f ( j), j satisfy i < f ( j) < j with (vi,v j) ∈ L − P and (v f ( j),v j) ∈ P, contradicting the property (a) of Claim 2. If (v f ( j),v j) < P then from the definition of f , there is an index k with k < j such that f (k) = f ( j) and (v f (k),vk) ∈ P. Then i ≤ f ( j) = f (k) < k < j with (vi,v j) ∈ L − P and (v f (k),vk) ∈ P, contradicting the property (b) or (c) of Claim 2. Therefore, f satisfies the property (d). 

= + i−1 Let I {[ f (i) n , i]: 1 ≤ i ≤ n} be the set of intervals on the real line. The property (a) of Claim 3 ensures that intervals of I are well-defined. The property (b) of Claim 3 implies that no interval of I properly contains another. Let S be the semiorder obtained from the proper interval representation I. The properties(c) and (d) of Claim 3 imply, respectively, that vi ≺ v j in S if (vi,v j) ∈ P and vi ⊀ v j in S if (vi,v j) ∈ L − P. Therefore, L ∩ S = P. The relation Q is obtained in O(n3) time from P and L. The function f and the representation I of S are obtained 2 3 in O(n ) time from LQ. Thus S and I can be obtained from P and L in O(n ) time. 

In Fig. 3, we illustrate the construction of the semiorder in the proof of Lemma 4. Consider a partial order P in Fig. 3(a). Figure 1 shows that P is a linear-semiorder. Let L be the linear order with a ≺ b ≺ c ≺ d ≺ e ≺ f . We can observe that L fulfills the 2 + 2 and 3 + 1 rules. We have R1 ∪ R2 = {(a, c), (c, b), (c, e), (e, b), (e, d), ( f, d)}. Thus there are two linear orders that contain all ordered pairs of Q = P∪R1 ∪R2, that is, a linear order with a ≺ c ≺ e ≺ b ≺ f ≺ d and a linear order with a ≺ c ≺ e ≺ f ≺ b ≺ d. We choose the latter as LQ. We obtain the six intervals I(a) = [0, 1], = 1 = + 2 = + 3 = + 4 = + 5 I(c) [ 6 , 2], I(e) [1 6 , 3], I( f ) [3 6 , 4], I(b) [3 6 , 5], and I(d) [5 6 , 6] (Fig. 3(c)). We can verify that no interval properly contains another. The semiorder S defined by the intervals is in Fig. 3(b), and we can observe L ∩ S = P. 5 d d f d b f b f c e b e c e c a

a a 0 1 2 3 4 5 6 (a) (b) (c)

Figure 3. (a) A linear-semiorder P. (b) The semiorder S . (c) The proper interval representation of S .

4. Recognition algorithm In this section, we show a recognition algorithm for linear-semiorders. The following is our main result. Theorem 5. A linear-semiorder can be recognized in O(nm¯ ) time. A linear extension fulfilling the 2 + 2 and 3 + 1 rules can be obtained in O(mm¯ 2) time. Here, n, m, and m¯ are the number of elements, comparable pairs, and incomparable pairs of the given order, respectively. Let P be a partial order on a set V, and let G be the comparability graph of P. In this section, we consider V as the vertex set of G and P as the transitive orientation of G. That is, we consider P as the set of directed edges such that for any three vertices u,v,w of G,if(u,v), (v,w) ∈ P then (u,w) ∈ P. Note n = |V| and m = |E(G)|. Let G be the complement of G. Recall that G is the incomparability graph of P, andhencem ¯ = |E(G)|. Let F be an orientation of G, and let P + F denote the union of directed edges of P and F. Note that P + F is the orientation of the on V. Thus if P + F is acyclic then P + F can be viewed as the linear order on V. A forbidden configuration for 2 + 2 is a sequence of vertices (x,y, z,w) with (x,y), (z,w) ∈ P and (z,y), (x,w) ∈ F (Fig. 2(a)). A forbidden configuration for 3 + 1 is a sequence of vertices (x,y, z,w) with (x,y), (y, z) ∈ P and (w, z), (x,w) ∈ F (Fig. 2(b)). The following can be obtained from Theorem 2. Proposition 6. A partial order P on a set V is a linear-semiorder if and only if there is an orientation F of the incomparability graph of P such that P + F is acyclic and contains no forbidden configurations for 2 + 2 or 3 + 1.

Let C4 denote an induced cycle of length 4, and let K1,3 denote a claw. We denote by Eo the set of edges of C4 or K1,3 of G. Note Eo ⊆ E(G) by definition. The proposed algorithm orients the edges of Eo, instead of the edges of G. In the following, we say that even if F is an orientation of not all edges of G, a sequence of vertices (x,y, z,w) is a forbidden configuration for 2 + 2 if (x,y), (z,w) ∈ P and (z,y), (x,w) ∈ F. Similarly, we say that (x,y, z,w)is a forbidden configuration for 3 + 1 if (x,y), (y, z) ∈ P and (w, z), (x,w) ∈ F.

Lemma 7. A partial order P on a set V is a linear-semiorder if and only if there is an orientation F of Eo such that P + F is acyclic and contains no forbidden configurations for 2 + 2 or 3 + 1. If the orientation F exists, every linear extension of P + F fulfills the 2 + 2 and 3 + 1 rules. Before proving Lemma 7, we show the following two observations. Proposition 8. Let x, y, z, w be four vertices of V. If (x,y), (z,w) ∈ P and xw,yz ∈ E(G) then xz,yw ∈ E(G), that is, (x, z,y,w) is C4 of G. Proof. If (x, z) ∈ P then (z,w) ∈ P implies (x,w) ∈ P, contradicting xw ∈ E(G). If(z, x) ∈ P then (x,y) ∈ P implies (z,y) ∈ P, contradicting yz ∈ E(G). Thus xz ∈ E(G). Similarly, we have yw ∈ E(G).  Proposition 9. Let x, y, z, w be four vertices of V. If (x,y), (y, z) ∈ P and xw, zw ∈ E(G) then yw ∈ E(G), that is, the four vertices induce K1,3 of G. Proof. If (y,w) ∈ P then (x,y) ∈ P implies (x,w) ∈ P, contradicting xw ∈ E(G). If(w,y) ∈ P then (y, z) ∈ P implies (w, z) ∈ P, contradicting zw ∈ E(G). Thus yw ∈ E(G).  6 Proof of Lemma 7. The necessity is trivial from Proposition 6. We now show the sufficiency. Let F be an orientation of Eo such that P + F is acyclic and contains no forbidden configurations for 2 + 2 or 3 + 1. Let L be a linear extension of P + F, and let F′ = L − P. Note that F′ is an orientation of G and F′ ⊇ F. Suppose that P + F′ contains a forbidden configuration for 2 + 2, that is, there is a sequence of vertices (x,y, z,w) with (x,y), (z,w) ∈ P and (z,y), (x,w) ∈ F′. ′ Since xw,yz ∈ E(G), Proposition 8 implies that (x, z,y,w) is C4 of G. Thus xw,yz ∈ Eo. Since F ⊆ F , we have (z,y), (x,w) ∈ F, contradicting that P + F contains no forbidden configurations for 2 + 2. Similarly, when we suppose that P + F′ contains a forbidden configuration for 3 + 1, we have a contradiction from Proposition 9. 

The order 2 + 1 of P is the partial order consisting of three elements x, y, z of V such that x ≺ y whereas x k z and y k z in P. A forbidden configuration for 2 + 1 is a sequence of vertices (x,y, z) with (x,y) ∈ P and (y, z), (z, x) ∈ F. If P + F is acyclic then P + F contains no forbidden configurations for 2 + 1. We show in Theorem 18 that if P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, then even if P + F is not acyclic, there is an orientation ′ ′ F of Eo such that P + F is acyclic and contains no forbidden configurations for 2 + 2 or 3 + 1.

Lemma 10. We can computein O(nm¯ ) time an orientation F of Eo such that P+F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. We show two observations to prove Lemma 10.

Proposition 11. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 1. The orientation P + F contains no forbidden configurations for 2 + 2 if and only if for any C4 = (x,y, z,w) of G, either (x,y), (z,y), (z,w), (x,w) ∈ F or (y, x), (y, z), (w, z), (w, x) ∈ F. Proof. The sufficiency is trivial. We now show the necessity. Assume without loss of generality (x, z), (y,w) ∈ P. Suppose (x,y) ∈ F. If(w, x) ∈ F then (y,w, x) is a forbidden configuration for 2 + 1, a contradiction. Thus (x,w) ∈ F. If (y, z) ∈ F then (x, z,y,w) is a forbidden configuration for 2 + 2, a contradiction. Thus (z,y) ∈ F. If(w, z) ∈ F then (y,w, z) is a forbidden configuration for 2 + 1, a contradiction. Thus (z,w) ∈ F. Conversely, suppose (y, x) ∈ F. If(z,y) ∈ F then (x, z,y) is a forbidden configuration for 2 + 1, a contradiction. Thus (y, z) ∈ F. If(x,w) ∈ F then (y,w, x, z) is a forbidden configuration for 2 + 2, a contradiction. Thus (w, x) ∈ F. If (z,w) ∈ F then (x, z,w) is a forbidden configuration for 2 + 1, a contradiction. Thus (w, z) ∈ F. 

Proposition 12. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 1. The orientation P+F contains no forbidden configurations for 3 + 1 if andonlyif forany K1,3 of G consisting of x,y, z,w ∈ V with xw, yw, zw ∈ E(G), either (x,w), (y,w), (z,w) ∈ F or (w, x), (w,y), (w, z) ∈ F. Proof. The sufficiency is trivial. We now show the necessity. Assume without loss of generality (x,y), (y, z) ∈ P. Suppose (x,w) ∈ F. If(w, z) ∈ F then (x,y, z,w) is a forbidden configuration for 3 + 1, a contradiction. Thus (z,w) ∈ F. If(w,y) ∈ F then (y, z,w) is a forbidden configuration for 2 + 1, a contradiction. Thus (y,w) ∈ F. Conversely, suppose (w, x) ∈ F. If(y,w) ∈ F then (x,y,w) is a forbidden configuration for 2 + 1, a contradiction. Thus (w,y) ∈ F. If(z,w) ∈ F then (y, z,w) is a forbidden configuration for 2 + 1, a contradiction. Thus (w, z) ∈ F.  = Proof of Lemma 10. The neighborhood of a vertex v of G is the set NG(v) {u ∈ V : uv ∈ E(G)}. We define that the upper set of v ∈ V is the set U(v) = {u ∈ V :(v, u) ∈ P} and the lower set of v ∈ V is the set L(v) = {u ∈ V :(u,v) ∈ P}. We first show a series of claims. Let uv be an edge of G.

Claim 4. IfU(u) ∩ NG(v) , ∅ and NG(u) ∩ U(v) , ∅, then for any two vertices w ∈ U(u) ∩ NG(v) and z ∈ NG(u) ∩ U(v), we have that (u,v,w, z) is C4. Conversely, each C4 has an edge uv with U(u) ∩ NG(v) , ∅ and NG(u) ∩ U(v) , ∅. Proof of Claim 4. The second claim is trivial. We now show the first claim. If (w, z) ∈ P then (u,w) ∈ P implies (u, z) ∈ P, contradicting uz ∈ E(G). If(z,w) ∈ P then (v, z) ∈ P implies (v,w) ∈ P, contradicting vw ∈ E(G). Thus  wz ∈ EG(G), that is, (u,v,w, z) is C4. By a similar argument, we have the following.

Claim 5. IfL(u) ∩ NG(v) , ∅ and NG(u) ∩ L(v) , ∅, then for any two vertices w ∈ L(u) ∩ NG(v) and z ∈ NG(u) ∩ L(v), we have that (u,v,w, z) is C4. Conversely, each C4 has an edge uv with L(u) ∩ NG(v) , ∅ and NG(u) ∩ L(v) , ∅. The following is trivial. 7 Algorithm 1: Algorithm for computing Eo Input: A partial order P and the incomparability graph G of P. Output: The set Eo of edges of G.

1 Eo ←∅; 2 foreach uv ∈ E(G) do

3 if U(u) ∩ NG(v) , ∅ and NG(u) ∩ U(v) , ∅ then 4 Eo ← Eo + uv; + 5 foreach w ∈ U(u) ∩ NG(v) do Eo ← Eo vw; + 6 foreach z ∈ NG(u) ∩ U(v) do Eo ← Eo uz; 7 end

8 if L(u) ∩ NG(v) , ∅ and NG(u) ∩ L(v) , ∅ then 9 Eo ← Eo + uv; + 10 foreach w ∈ L(u) ∩ NG(v) do Eo ← Eo vw; + 11 foreach z ∈ NG(u) ∩ L(v) do Eo ← Eo uz; 12 end

13 if U(u) ∩ NG(v) , ∅ and L(u) ∩ NG(v) , ∅ then 14 Eo ← Eo + uv; + 15 foreach w ∈ U(u) ∩ NG(v) do Eo ← Eo vw; + 16 foreach z ∈ L(u) ∩ NG(v) do Eo ← Eo vz; 17 end

18 if NG(u) ∩ U(v) , ∅ and NG(u) ∩ L(v) , ∅ then 19 Eo ← Eo + uv; + 20 foreach w ∈ NG(u) ∩ U(v) do Eo ← Eo uw; + 21 foreach z ∈ NG(u) ∩ L(v) do Eo ← Eo uz; 22 end 23 end 24 return Eo;

Claim 6. IfU(u) ∩ NG(v) , ∅ and L(u) ∩ NG(v) , ∅, then for any two vertices w ∈ U(u) ∩ NG(v) and z ∈ L(u) ∩ NG(v), the vertices z, u,w,v induce K1,3. Conversely, each K1,3 has an edge uv with U(u) ∩ NG(v) , ∅ and L(u) ∩ NG(v) , ∅.

Therefore, we can compute Eo by Algorithm 1. Each iteration on lines 2–23 takes O(n) time for each edge of G, and hence the running time is O(nm¯ ). Let P3 denote an induced path of length 2. The following is trivial.

Claim 7. IfU(u) ∩ NG(v) , ∅ then for any vertex w ∈ U(u) ∩ NG(v), we have that (u,v,w) is P3. Conversely, each P3 has an edge uv with U(u) ∩ NG(v) , ∅.

Now, we show an algorithm to find the orientation of F of Eo (Algorithm 2). We use the 2-satisfiability problem in the algorithm. An instance of the 2-satisfiability problemis a 2-CNF formula, a Boolean formula in conjunctive normal form with at most two literals per clause. Assume that the vertices are linearly ordered, and we assign a Boolean variable x(u,v) for each edge uv of G, where u precedes v in the ordering. We denote the negation of x(u,v) by x(v,u). The algorithm first constructs the 2-CNF formula ϕ (lines 1–21), then finds a satisfying truth assignment τ of ϕ (line 22), and finally orients each edge uv ∈ Eo as (u,v) ∈ F if x(u,v) = 0 in τ (line 23). The clauses added in lines 3–10 ensure that for any C4 = (x,y, z,w) of G, either (x,y), (z,y), (z,w), (x,w) ∈ F or (y, x), (y, z), (w, z), (w, x) ∈ F. Similarly, the clauses added in lines 11–18 ensure that for any K1,3 of G consisting of x,y, z,w ∈ V with xw, yw, zw ∈ E(G), either (x,w), (y,w), (z,w) ∈ F or (w, x), (w,y), (w, z) ∈ F. Moreover, the clauses added in lines 19 and 20 ensure that P + F contains no forbidden configurations for 2 + 1. Therefore, we have from Propositions 11 and 12 that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. 8 Algorithm 2: Algorithm for Lemma 10

Input: A partial order P and the set Eo of edges of G. Output: An orientation F of Eo such that P + F contains no forbidden configurations.

1 ϕ ←∅; 2 foreach uv ∈ Eo do /* construct the 2-CNF formula ϕ */ 3 if U(u) ∩ NG(v) , ∅ and NG(u) ∩ U(v) , ∅ then 4 foreach w ∈ U(u) ∩ NG(v) do add the clauses (x(u,v) ∨ x(v,w))and (x(w,v) ∨ x(v,u)) to ϕ; 5 foreach z ∈ NG(u) ∩ U(v) do add the clauses (x(v,u) ∨ x(u,z))and (x(z,u) ∨ x(u,v)) to ϕ; 6 end

7 if L(u) ∩ NG(v) , ∅ and NG(u) ∩ L(v) , ∅ then 8 foreach w ∈ L(u) ∩ NG(v) do add the clauses (x(u,v) ∨ x(v,w))and (x(w,v) ∨ x(v,u)) to ϕ; 9 foreach z ∈ NG(u) ∩ L(v) do add the clauses (x(v,u) ∨ x(u,z))and (x(z,u) ∨ x(u,v)) to ϕ; 10 end

11 if U(u) ∩ NG(v) , ∅ and L(u) ∩ NG(v) , ∅ then 12 foreach w ∈ U(u) ∩ NG(v) do add the clauses (x(u,v) ∨ x(v,w))and (x(w,v) ∨ x(v,u)) to ϕ; 13 foreach z ∈ L(u) ∩ NG(v) do add the clauses (x(u,v) ∨ x(v,z)) and(x(z,v) ∨ x(v,u)) to ϕ; 14 end

15 if NG(u) ∩ U(v) , ∅ and NG(u) ∩ L(v) , ∅ then 16 foreach w ∈ NG(u) ∩ U(v) do add the clauses (x(v,u) ∨ x(u,w)) and(x(w,u) ∨ x(u,v)) to ϕ; 17 foreach z ∈ NG(u) ∩ L(v) do add the clauses (x(v,u) ∨ x(u,z))and (x(z,u) ∨ x(u,v)) to ϕ; 18 end

19 foreach w ∈ U(u) ∩ NG(v) with vw ∈ Eo do add the clause (x(w,v) ∨ x(v,u)) to ϕ ; 20 foreach z ∈ NG(u) ∩ U(v) with uz ∈ Eo do add the clause (x(z,u) ∨ x(u,v)) to ϕ ; 21 end 22 find a satisfying truth assignment τ of ϕ; 23 orient each edge uv ∈ Eo as (u,v) ∈ F if x(u,v) = 0 in τ; 24 return F;

v2 v2

v1 v3 v1 v3

v0 v4 v0 v4

v5 v5 (a) (b)

Figure 4. (a) A regular obstruction. (b) A skewed obstruction. An arrow u → v denotes edge (u,v) ∈ P, and a dashed arrow u d v denotes edge (u,v) ∈ F.

Each iteration on lines 2–21 takes O(n) time for each edge of Eo, and hence ϕ can be constructed in O(nm¯ ) time. The 2-CNF formula ϕ has at most n(n−1)/2 Boolean variables and O(nm¯ ) clauses. Since a satisfying truth assignment of ϕ can be obtained in time linear to the size of ϕ [1], Algorithm 2 takes O(nm¯ ) time. 

We call a sequence of vertices (v0,v1,v2,v3,v4,v5)a regular obstruction of P + F if (v0,v1), (v2,v3), (v4,v5) ∈ P and (v2,v1), (v4,v3), (v0,v5) ∈ F (Fig. 4(a)). We call (v0,v1,v2,v3,v4,v5)a skewed obstruction of P+F if (v0,v1), (v1,v2), (v4,v5) ∈ P and (v3,v2), (v4,v3), (v0,v5), (v5,v3) ∈ F (Fig. 4(b)).

9 Lemma 13. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. The orientation P + F is acyclic if and only if P + F contains no obstructions. Before proving Lemma 13, we introduce some observations.

Proposition 14. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2 or 2 + 1. Let (v0,v1,v2,v3,v4,v5) be a regular obstruction of P + F. All vertices of the obstruction are distinct. We have (v5,v2), (v5,v3), (v4,v2), (v1,v4), (v1,v5), (v0,v4), (v3,v0), (v3,v1), (v2,v1) ∈ F (Fig. 4(a)).

Proof. We have vi , vi+1 for any i = 0, 1,..., k − 1 (indices are modulo k) since the graphs G and G have no loops. We have vi , vi+2 for any i = 0, 1,..., k − 1 since (vi,vi+1) ∈ P and (vi+2,vi+1) ∈ F if i is even, and (vi+1,vi) ∈ F and (vi+1,vi+2) ∈ P if i is odd. If v0 = v3 then (v2,v3), (v0,v1) ∈ P implies (v2,v1) ∈ P, contradicting (v2,v1) ∈ F. Thus v0 , v3. Similarly, we have v1 , v4 and v2 , v5. Therefore, all vertices are distinct. If (v2,v5) ∈ P then (v2,v5,v0,v1) is a forbidden configuration for 2 + 2, a contradiction. If (v5,v2) ∈ P then (v4,v5), (v2,v3) ∈ P implies (v4,v3) ∈ P, contradicting (v4,v3) ∈ F. Thus v2v5 ∈ E(G). Proposition 8 implies that (v2,v4,v3,v5) is C4 in G. Since (v4,v3) ∈ F, Proposition 11 implies (v5,v2), (v5,v3), (v4,v2) ∈ F. By similar arguments, we have (v1,v4), (v1,v5), (v0,v4) ∈ F and (v3,v0), (v3,v1), (v2,v0) ∈ F. 

Proposition 15. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. Let (v0,v1,v2,v3,v4,v5) be a skewed obstruction of P + F. All vertices of the obstruction are distinct. We have (v0,v2) ∈ P and (v2,v5), (v1,v4), (v1,v5), (v0,v4), (v3,v0), (v3,v1) ∈ F (Fig. 4(b)).

Proof. We have vi , vi+1 for any i = 0, 1,..., k − 1 (indices are modulo k) since the graphs G and G have no loops. We have v0 , v2 from (v0,v1), (v1,v2) ∈ P. We have v1 , v3 from (v1,v2) ∈ P and (v3,v2) ∈ F. We have v2 , v4 from (v3,v2), (v4,v3) ∈ F. We have v3 , v5 from (v4,v3) ∈ F and (v4,v5) ∈ P. We have v4 , v0 from (v4,v5) ∈ P and (v0,v5) ∈ F. We have v5 , v1 from (v0,v5) ∈ F and (v0,v1) ∈ P. If v0 = v3 then (v0,v1), (v1,v2) ∈ P implies (v0,v2) ∈ P, contradicting (v3,v2) ∈ F. Thus v0 , v3. If v1 = v4 then (v0,v1), (v4,v5) ∈ P implies (v0,v5) ∈ P, contradicting (v0,v5) ∈ F. Thus v1 , v4. If v2 = v5 then (v0,v1), (v1,v2) ∈ P implies (v0,v2) ∈ P, contradicting (v0,v5) ∈ F. Thus v2 , v5. Therefore, all vertices are distinct. We have (v0,v2) ∈ P from (v0,v1), (v1,v2) ∈ P. If(v2,v5) ∈ P then (v0,v2) ∈ P implies (v0,v5) ∈ P, contradicting (v0,v5) ∈ F. If(v5,v2) ∈ P then (v4,v5,v2,v3) is a forbidden configuration for 3 + 1, a contradiction. Thus v2v5 ∈ E(G). Proposition 9 implies that the vertices v0,v1,v2,v5 induce K1,3 in G. Since (v0,v5) ∈ F, Proposition 12 implies (v2,v5), (v1,v5) ∈ F. If (v1,v4) ∈ P then (v0,v1), (v4,v5) ∈ P implies (v0,v5) ∈ P, contradicting (v0,v5) ∈ F. If(v4,v1) ∈ P then (v4,v1,v2,v3) is a forbidden configuration for 3 + 1, a contradiction. Thus v1v4 ∈ E(G). Proposition 8 implies that (v0,v4,v1,v5) is C4 in G. Since (v0,v5) ∈ F, Proposition 11 implies (v0,v4), (v1,v5), (v1,v4) ∈ F. If (v0,v3) ∈ P then (v0,v3,v4,v5) is a forbidden configuration for 2 + 2, a contradiction. If (v3,v0) ∈ P then (v0,v2) ∈ P implies (v3,v2) ∈ P, contradicting (v3,v2) ∈ F. Thus v0v3 ∈ E(G). Proposition 9 implies that the vertices v0,v1,v2,v3 induce K1,3 in G. Since (v3,v2) ∈ F, Proposition 12 implies (v3,v0), (v3,v1) ∈ F. 

A sequence of vertices (a0, b0, a1, b1,..., ak−1, bk−1) with k ≥ 2 is an alternating cycle of length 2k if (ai, bi) ∈ P and (bi, ai+1) ∈ F for any i = 0, 1,..., k − 1 (indices are modulo k). See Fig. 5 for example.

Proposition 16. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 1. The orientation P + F contains no alternating cycles of length 4.

Proof. Suppose that P + F contains an alternating cycle (a0, b0, a1, b1) of length 4 (Fig. 5(a)). Proposition 8 implies that (a0, a1, b1, b0) is C4, and hence a0a1 ∈ Eo. If(a0, a1) ∈ F then (a1, b1, a0) is a forbidden configuration for 2 + 1,a contradiction. If (a1, a0) ∈ F then (a0, b0, a1) is a forbidden configuration for 2 + 1, a contradiction. 

Now, we prove Lemma 13.

Proof of Lemma 13. We have from Propositions 14 and 15 that if P + F contains an obstruction, then P + F contains a cycle. Now, we suppose that P + F contains a cycle but no obstructions. Claim 8. IfP + F contains an alternating cycle of length 6, then P + F contains a regular obstruction. 10 a1 a2 b2 b0 a1

b0 b1 b1 a3

a1 b3 a0 a2

a0 b1 b a0 b2 0 (a) (b) (c)

Figure 5. (a) An alternatingcycleof length4. (b)An alternatingcycle of length 6. (c) An alternating cycle of length greater than 6. Arrows and dashed arrows denote the same type of edges as in Fig. 4. Dashed lines denote edges of G.

Proof of Claim 8. Let (a0, b0, a1, b1, a2, b3) be an alternating cycle of length 6 with (ai, bi) ∈ P and (bi, ai+1) ∈ F for any i = 0, 1, 2 (indices are modulo 3). See Fig. 5(b). We first claim that the vertices are distinct. We have ai , bi and bi , ai+1 for any i = 0, 1, 2 (indices are modulo 3) since the graphs G and G have no loops. We have ai , ai+1 for any i = 0, 1, 2 since (ai, bi) ∈ P and (bi, ai+1) ∈ F. We also have bi , bi+1 for any i = 0, 1, 2 since (bi, ai+1) ∈ F and (ai+1, bi+1) ∈ P. If a0 = b1 then (a1, b1), (a0, b0) ∈ P implies (a1, b0) ∈ P, contradicting (b0, a1) ∈ F. Thus a0 , b1. Similarly, we have a1 , b2 and a2 , b0. Therefore, all vertices are distinct. If (a1, b2) ∈ P then (a1, b2, a0, b0) is an alternating cycle of length 4, contradicting Proposition 16. If (b2, a1) ∈ P then (a2, b2), (a1, b1) ∈ P implies (a2, b1) ∈ P, contradicting (b1, a2) ∈ F. Thus a1b2 ∈ E(G). Proposition 8 implies that (a1, a2, b1, b2) is C4 in G. Since (b1, a2) ∈ F, Proposition 11 implies (a1, b2) ∈ F. By similar arguments, we have (a0, b1), (a2, b0) ∈ F. Now, (a0, b0, a2, b2, a1, b1) is a regular obstruction.  Claim 9. IfP + F contains an alternating cycle of length greater than 6, thenP + F contains an alternating cycle of length 6. Proof of Claim 9. Suppose that P + F contains no alternating cycles of length 6. We show that P + F contains no alternating cycles of length greater than 6. Suppose to the contrary that P + F contains an alternating cycle (a0, b0, a1, b1,..., ak−1, bk−1) of length 2k with k ≥ 4 (Fig. 5(c)). Assume without loss of generality that the length of the cycle is minimal. If a0 = b2 then (a2, b2), (a0, b0) ∈ P implies (a2, b0) ∈ P, and hence(a2, b0, a1, b1) is an alternating cycle of length 4, contradicting Proposition 16. If (a0, b2) ∈ P then (a0, b2, a3, b3,..., ak−1, bk−1) is an alternating cycle of length 2(k −2), contradicting the minimality of the length of the cycle. If (b2, a0) ∈ P then (a2, b2), (a0, b0) ∈ P implies (a2, b0) ∈ P, and hence (a2, b0, a1, b1) is an alternating cycle of length 4, contradicting Proposition 16. Therefore, a0b2 ∈ E(G). If b0 = a2 then (a0, b0), (a2, b2) ∈ P implies (a0, b2) ∈ P, contradicting a0b2 ∈ E(G). If (a2, b0) ∈ P then (a2, b0, a1, b1) is an alternating cycle of length 4, contradicting Proposition16. If (b0, a2) ∈ P then (a0, b0), (a2, b2) ∈ P implies (a0, b2) ∈ P, contradicting a0b2 ∈ E(G). Therefore, b0a2 ∈ E(G). Now, Proposition 8 implies that (a0, a2, b0, b2) is C4. If(a0, b2), (b0, a2) ∈ F then (a0, b0, a2, b2, a3, b3,..., ak−1, bk−1) is an alternating cycle of length 2(k − 1), a contradiction. If (b2, a0), (a2, b0) ∈ F then (a0, b0, a1, b1, a2, b2) is an alternating cycle of length 6, a contradiction. Thus P + F contains no alternating cycles of length greater than 6.  Therefore, we can assume that P + F contains no alternating cycles. We now introduce some definitions. We call an edge (x,y) ∈ F type-1 critical if there is 3 + 1 consisting of four vertices x, y, z, w with (y, z), (z,w) ∈ P and (x,y), (x, z), (x,w) ∈ F (Fig. 6(a)). We call an edge (x,y) ∈ F type-2 critical if there is 2 + 2 consisting of four vertices x, y, z, w with (w, x), (y, z) ∈ P and (x,y), (x, z), (w,y), (w, z) ∈ F (Fig. 6(b)). We call an edge (x,y) ∈ F type-3 critical if there is 3 + 1 consisting of four vertices x, y, z, w with (z,w), (w, x) ∈ P and (x,y), (w,y), (z,y) ∈ F (Fig. 6(c)). For any edge (u,v) ∈ F, there is a directed path from u to v consisting of a critical edge and edges in P. For example, in Fig. 6(a), there is a path (x,y,w) for (x,w) ∈ F. Recall that P + F contains a cycle. Therefore, P + F contains a cycle consisting of critical edges and edges in P. 11 x y x y x y

w z w z w z

(a) (b) (c)

Figure 6. (a) A type-1 critical edge (x,y). (b) A type-2 critical edge (x,y). (c) A type-3 critical edge (x,y). Arrows and dashed arrows denote the same type of edges as in Fig. 5.

Let C be a shortest cycle consisting of critical edges and edges in P. If there are three vertices u,v,w consecutive on C with (u,v), (v,w) ∈ P, then (u,w) ∈ P. Hence we have a shorter cycle consisting of critical edges and edges in P, contradicting the minimality of length of C. Thus there are no three vertices u,v,w consecutive on C with (u,v), (v,w) ∈ P. Recall that P + F contains no alternating cycles. Therefore, there are three vertices u,v,w consecutive on C with (u,v), (v,w) ∈ F. If(u,w) ∈ P or (w, u) ∈ P, then we have a shorter cycle consisting of critical edges and edges in P,a contradiction. Thus uw ∈ E(G). If(u,w) ∈ F and (u,w) is a critical edge, then we have a shorter cycle consisting of critical edges and edges in P, a contradiction. Thus we have the following. Claim 10. If (u,w) ∈ F then (u,w) is not a critical edge. We distinguish nine cases (Fig. 7). Case 1-1: (u,v) is type-1 critical and (v,w) is type-1 critical; Case 1-2: (u,v) is type-1 critical and (v,w) is type-2 critical; Case 1-3: (u,v) is type-1 critical and (v,w) is type-3 critical; Case 2-1: (u,v) is type-2 critical and (v,w) is type-1 critical; Case 2-2: (u,v) is type-2 critical and (v,w) is type-2 critical; Case 2-3: (u,v) is type-2 critical and (v,w) is type-3 critical; Case 3-1: (u,v) is type-3 critical and (v,w) is type-1 critical; Case 3-2: (u,v) is type-3 critical and (v,w) is type-2 critical; Case 3-3: (u,v) is type-3 critical and (v,w) is type-3 critical. Claim 11. In Cases 2-1, 2-2, and 3-2, the orientation P + F contains a regular obstruction. In Cases 1-1, 3-1, and 3-3, the orientation P + F contains a skewed obstruction. Proof of Claim 11. We prove the claim for each case. Case 1-1 (Fig. 7(a)). Since (u,v) is type-1 critical, there are two other vertices a, b with (v, b), (b, a) ∈ P and (u, a) ∈ F. Note that (v, b), (b, a) ∈ P implies (v, a) ∈ P. We have a , w from (v, a) ∈ P and (v,w) ∈ F. We also have b , w from (v, b) ∈ P and (v,w) ∈ F. Therefore, the five vertices u,v,w, a, b are distinct. Since (v,w) is type-1 critical, there are two other vertices c, d with (w, d), (d, c) ∈ P and (v, c) ∈ F. Note that (w, d), (d, c) ∈ P implies (w, c) ∈ P. We have c , u from (v, c), (u,v) ∈ F. We also have c , b from (v, c) ∈ F and (v, b) ∈ P. Moreover, we have c , a from (v, c) ∈ F and (v, a) ∈ P. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). If d = b then (v, b), (d, c) ∈ P implies (v, c) ∈ P, contradicting (v, c) ∈ F. Thus d , b. Similarly, if d = a then (v, a), (d, c) ∈ P implies (v, c) ∈ P, contradicting (v, c) ∈ F. Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (c, u) ∈ P then (w, c) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(u, c) ∈ P then (u, c,v, a) is a forbidden configuration for 2 + 2, a contradiction. Thus uc ∈ E(G). Proposition 9 implies that the vertices w, d, c, u induce K1,3 in G. If(u,w) ∈ F then (u,w) is type-1 critical, contradicting Claim 10. Thus (w, u) ∈ F, and then (v, b, a, u,w, c)is a skewed obstruction. Case 2-1 (Fig. 7(d)). Since (u,v) is type-2 critical, there are two other vertices a, b with (a, u), (v, b) ∈ P and (a, b) ∈ F. We have a , w from (a, u) ∈ P and uw ∈ E(G). We also have b , w from (v, b) ∈ P and (v,w) ∈ F. Therefore, the five vertices u,v,w, a, b are distinct. Since (v,w) is type-1 critical, there are two other vertices c, d with (w, d), (d, c) ∈ P and (v, c) ∈ F. Note that (w, d), (d, c) ∈ P implies (w, c) ∈ P. We have c , u from (v, c), (u,v) ∈ F. We also have c , b from (v, c) ∈ F and (v, b) ∈ P. If c = a then (w, c), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus c , a. Therefore, the 12 u w u w u w

v v v a d a d a d

b c b c b c (a) Case 1-1 (b) Case 1-2 (c) Case 1-3 u w u w u w

v v v a d a d a d

b c b c b c (d) Case 2-1 (e) Case 2-2 (f) Case 2-3 u w u w u w

v v v a d a d a d

b c b c b c (g) Case 3-1 (h) Case 3-2 (i) Case 3-3

Figure 7. Illustrating the proof of Claims 11 and 12. Arrows, dashed arrows, and dashed lines denote the same type of edges as in Fig. 5. six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). If d = b then (v, b), (d, c) ∈ P implies (v, c) ∈ P, contradicting (v, c) ∈ F. Thus d , b. If d = a then (w, d), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (c, a) ∈ P then (w, c), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(a, c) ∈ P then (a, c,v, b)is a forbidden configuration for 2 + 2, a contradiction. Thus ac ∈ E(G). Proposition 8 implies that (a,w, u, c) is C4 in G. If (u,w) ∈ F then (u,w) is type-2 critical, contradicting Claim 10. Thus (w, u) ∈ F, and then (a, u,w, c,v, b) is a regular obstruction. Case 2-2 (Fig. 7(e)). As in Case 2-1, there are two vertices a, b with (a, u), (v, b) ∈ P and (a, b) ∈ F, and the five vertices u,v,w, a, b are distinct. Since (v,w) is type-2 critical, there are two other vertices c, d with (c,v), (w, d) ∈ P and (c, d) ∈ F. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v), (v, b) ∈ P. Thus we have (c, b) ∈ P from (c,v), (v, b) ∈ P. We have c , a from (c, b) ∈ P and (a, b) ∈ F. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). We also have d , b from (c, d) ∈ F and (c, b) ∈ P. If d = a then (w, d), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (d, a) ∈ P then (w, d), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(a, d) ∈ P then (a, d, c, b)is a forbidden configuration for 2 + 2, a contradiction. Thus ad ∈ E(G). Proposition 8 implies that (a,w, u, d) is C4 in G. If (u,w) ∈ F then (u,w) is type-2 critical, contradicting Claim 10. Thus (w, u) ∈ F, andthen (a, u,w, d, c, b)is a regular obstruction. Case 3-1 (Fig. 7(g)). Since (u,v) is type-3 critical, there are two other vertices a, b with (b, a), (a, u) ∈ P and (b,v) ∈ F. Note that (b, a), (a, u) ∈ P implies (b, u) ∈ P. We have a , w from (a, u) ∈ P and uw ∈ E(G). We also have b , w from (b,v), (v,w) ∈ F. Therefore, the five vertices u,v,w, a, b are distinct. Since (v,w) is type-1 critical, there are two other vertices c, d with (w, d), (d, c) ∈ P and (v, c) ∈ F. We have c , u from (v, c), (u,v) ∈ F. We also have c , b from (v, c), (b,v) ∈ F. If c = a then (w, d), (d, c), (a, u) ∈ P implies 13 (w, u) ∈ P, contradicting uw ∈ E(G). Thus c , a. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). If d = b then (w, d), (b, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , b. Similarly, if d = a then (w, d), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (d, b) ∈ P then (w, d), (b, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(b, d) ∈ P then (b, d, c,v)is a forbidden configuration for 3 + 1, a contradiction. Thus bd ∈ E(G). Proposition 8 implies that (b,w, u, d) is C4 in G. If (u,w) ∈ F then (u,w) is type-2 critical, contradicting Claim 10. Thus (w, u) ∈ F, and then (w, d, c,v, b, u) is a skewed obstruction. Case 3-2 (Fig. 7(h)). As in Case 3-1, there are two vertices a, b with (b, a), (a, u) ∈ P and (b,v) ∈ F, and the five vertices u,v,w, a, b are distinct. Note that (b, a), (a, u) ∈ P implies (b, u) ∈ P. Since (v,w) is type-2 critical, there are two other vertices c, d with (c,v), (w, d) ∈ P and (c, d) ∈ F. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v) ∈ P and (b,v) ∈ F. If c = a then (b, a), (c,v) ∈ P implies (b,v) ∈ P, contradicting (b,v) ∈ F. Thus c , a. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). If d = b then (w, d), (b, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , b. Similarly, if d = a then (w, d), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (d, b) ∈ P then (w, d), (b, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(b, d) ∈ P then (b, d, c,v)is a forbidden configuration for 2 + 2, a contradiction. Thus bd ∈ E(G). Proposition 8 implies that (b,w, u, d) is C4 in G. If (u,w) ∈ F then (u,w) is type-2 critical, contradicting Claim 10. Thus (w, u) ∈ F, and then (b, u,w, d, c,v)is a regular obstruction. Case 3-3 (Fig. 7(i)). As in Case 3-1, there are two vertices a, b with (b, a), (a, u) ∈ P and (b,v) ∈ F, and the five vertices u,v,w, a, b are distinct. Since (v,w) is type-3 critical, there are two other vertices c, d with (d, c), (c,v) ∈ P and (d,w) ∈ F. Note that (d, c), (c,v) ∈ P implies (d,v) ∈ P. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v) ∈ P and (b,v) ∈ F. If c = a then (b, a), (c,v) ∈ P implies (b,v) ∈ P, contradicting (b,v) ∈ F. Thus c , a. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (d,v) ∈ P and (u,v) ∈ F. We also have d , b from (d,v) ∈ P and (b,v) ∈ F. If d = a then (b, a), (d,v) ∈ P implies (b,v) ∈ P, contradicting (b,v) ∈ F. Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (w, b) ∈ P then (b, a), (a, u) ∈ P implies (w, u) ∈ P, contradicting uw ∈ E(G). If(b,w) ∈ P then (b,w, d,v)is a forbidden configuration for 2 + 2, a contradiction. Thus bw ∈ E(G). Proposition 9 implies that the vertices b, a, u,w induce K1,3 in G. If(u,w) ∈ F then (u,w) is type-3 critical, contradicting Claim 10. Thus (w, u) ∈ F, and then (b, a, u,w, d,v) is a skewed obstruction. 

Claim 12. In Cases 1-2, 1-3, and 2-3, there is a sequence of vertices (u, x,y,w) such that – (u, x), (y,w) ∈ F and (x,y) ∈ P; – (u, x) is a critical edge with the same type of (u,v); – (y,w) is a critical edge with the same type of (v,w).

Proof of Claim 12. We prove the claim for each case. Case 1-2 (Fig. 7(b)). As in Case 1-1, there are two vertices a, b with (v, b), (b, a) ∈ P and (u, a) ∈ F, and the five vertices u,v,w, a, b are distinct. Since (v,w) is type-2 critical, there are two other vertices c, d with (c,v), (w, d) ∈ P and (c, d) ∈ F. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v), (v, b) ∈ P. Thus we have (c, b) ∈ P from (c,v), (v, b) ∈ P. We have c , a from (c, b), (b, a) ∈ P. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (w, d) ∈ P and uw ∈ E(G). We also have d , b from (c, d) ∈ F and (c, b) ∈ P. If d = a then (c, b), (b, a) ∈ P implies (c, a) ∈ P, contradicting (c, d) ∈ F. Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (u, c) ∈ P then (c,v) ∈ P implies (u,v) ∈ P, contradicting (u,v) ∈ F. Suppose (c, u) ∈ P. Proposition 8 implies that (c,w, u, d) is C4 in G. We have (u,w) ∈ F from (c, d) ∈ F, but (u,w) is type-2 critical, contradicting Claim 10. Thus uc ∈ E(G). Then Proposition 9 implies that the vertices c, b, a, u induce K1,3 in G. We have (u, c) ∈ F from (u, a) ∈ F, and(u, c) is type-1 critical. Therefore, (u, c,v,w) is a desired sequence. Case 1-3 (Fig. 7(c)). As in Case 1-1, there are two vertices a, b with (v, b), (b, a) ∈ P and (u, a) ∈ F, and the five vertices u,v,w, a, b are distinct. Since (v,w) is type-3 critical, there are two other vertices c, d with (d, c), (c,v) ∈ P and (d,w) ∈ F. Note that (d, c), (c,v) ∈ P implies (d,v) ∈ P. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v), (v, b) ∈ P. Thus we have (c, b) ∈ P from (c,v), (v, b) ∈ P. We have c , a from (c, b), (b, a) ∈ P. 14 Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (d,v) ∈ P and (u,v) ∈ F. We also have d , b from (d, c), (c, b) ∈ P. Moreover, we have d , a from (d, c), (c, b), (b, a) ∈ P. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If(u, c) ∈ P then (c,v) ∈ P implies (u,v) ∈ P, contradicting (u,v) ∈ F. Suppose(c, u) ∈ P. Proposition 9 implies that the vertices d, c, u,w induce K1,3 in G. We have (u,w) ∈ F from (d,w) ∈ F, but (u,w) is type-3 critical, contradicting Claim 10. Thus uc ∈ E(G). Then Proposition 9 implies that the vertices c, b, a, u induce K1,3 in G. We have (u, c) ∈ F from (u, a) ∈ F,and (u, c) is type-1 critical. Therefore, (u, c,v,w) is a desired sequence. Case 2-3 (Fig. 7(f)). As in Case 2-1, there are two vertices a, b with (a, u), (v, b) ∈ P and (a, b) ∈ F, and the five vertices u,v,w, a, b are distinct. Since (v,w) is type-3 critical, there are two other vertices c, d with (d, c), (c,v) ∈ P and (d,w) ∈ F. Note that (d, c), (c,v) ∈ P implies (d,v) ∈ P. We have c , u from (c,v) ∈ P and (u,v) ∈ F. We also have c , b from (c,v), (v, b) ∈ P. Thus we have (c, b) ∈ P from (c,v), (v, b) ∈ P. We have c , a from (c, b) ∈ P and (a, b) ∈ F. Therefore, the six vertices u,v,w, a, b, c are distinct. We have d , u from (d,v) ∈ P and (u,v) ∈ F. We also have d , b from (d, c), (c, b) ∈ P. If d = a then (d, c), (c, b) ∈ P implies (d, b) ∈ P, contradicting (a, b) ∈ F. Thus d , a. Therefore, the seven vertices u,v,w, a, b, c, d are distinct. If (u, c) ∈ P then (c,v) ∈ P implies (u,v) ∈ P, contradicting (u,v) ∈ F. Suppose (c, u) ∈ P. We have from Proposition 9 that the vertices d, c, u,w induce K1,3 in G. We have (u,w) ∈ F from (d,w) ∈ F, but (u,w) is type-3 critical, contradicting Claim 10. Thus uc ∈ E(G). Then Proposition 8 implies that (a, c, u, b) is C4 in G. We have (u, c) ∈ F from (a, b) ∈ F,and (u, c) is type-2 critical. Therefore, (u, c,v,w) is a desired sequence. 

By Claim 11, we can assume that any two critical edges consecutive on C is in Cases 1-2, 1-3, and 2-3. However, we can obtain an alternating cycle from C by repeated applications of Claim 12, a contradiction. Thus the lemma holds. 

Lemma 17. Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 ′ ′ 2 + 1. We can compute in O(mm¯ ) time an orientation F of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, and P + F′ contains no obstructions.

Proof. Let (v0,v1,v2,v3,v4,v5) be a regular obstruction. We call the edge (v0,v1) ∈ P the base of the obstruction and the edges (v4,v3), (v5,v3), (v4,v2), (v5,v2) ∈ F its fronts. Similarly, let (v0,v1,v2,v3,v4,v5) be a skewed obstruction. We call the edge (v0,v1) ∈ P the base of the obstruction and the edges (v4,v3), (v5,v3) ∈ F its fronts. We can observe the following from Propositions 14 and 15 (Fig. 4). Claim 13. If (u,v) ∈ P is the base of an obstruction and (x,y) ∈ F is its front, then (u, x), (v, x), (y, u), (y, v) ∈ F.

Let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. Then, let (u,v) be an edgein P. We define that

A(u,v) = {(x,y) ∈ F : there is a regular obstruction such that (u,v) is its base and (x,y) is its front}, −1 = A(u,v) {(y, x):(x,y) ∈ A(u,v)}, and ′ = + −1 F (F − A(u,v)) A(u,v). ′ In other words, F is an orientation of Eo obtained from F by reversing the direction of all edges in A(u,v). Claim 14. The orientation P + F′ contains no forbidden configurations for 2 + 2. + ′ + −1 Proof of Claim 14. Suppose that P F contains a forbidden configuration (x,y, z,w) for 2 2. If(z,y), (x,w) ∈ A(u,v) then (y, z), (w, x) ∈ F, that is, (x,y, z,w) is an alternating cycle of length 4 in P + F, contradicting Proposition 16. −1 −1 −1 < −1 Thus either (z,y) ∈ A(u,v) or (x,w) ∈ A(u,v). Assume without loss of generality (z,y) ∈ A(u,v) and (x,w) A(u,v). Then (y, z) ∈ A(u,v) ⊆ F and (x,w) ∈ F but (x,w) < A(u,v). Since (y, z) ∈ A(u,v), there is a regular obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v)is its baseand (y, z) is its front. Suppose (y, z) = (v4,v3) (Fig. 8(a)). We have (v2,w) ∈ P from (v2,v3), (v3,w) ∈ P. We also have (x,v5) ∈ P from (x,v4), (v4,v5) ∈ P. Then (u,v,v2,w, x,v5) is a regular obstruction, and hence (x,w) ∈ A(u,v), a contradiction. Suppose (y, z) = (v5,v3). We have (v2,w) ∈ P from (v2,v3), (v3,w) ∈ P. Then (u,v,v2,w, x,v5) is a regular obstruction, and hence (x,w) ∈ A(u,v), a contradiction. Suppose (y, z) = (v4,v2). We have (x,v5) ∈ P from (x,v4), (v4,v5) ∈ P. Then (u,v,v2,w, x,v5) is a regular obstruction, and hence (x,w) ∈ A(u,v), a contradiction. Suppose (y, z) = (v5,v3). Then (u,v,v2,w, x,v5) is a regular obstruction, and hence (x,w) ∈ A(u,v), a contradiction.  15 v2 v2 v2

v3 w v3 x v3 x v v v

u u u v4 x v4 y v4 y

v5 v5 v5 (a) (b) (c) v2 v2 v2

v3 y v3 y v3 v v v x

u u u v4 z v4 z v4

v5 v5 v5 (d) (e) (f) v2 v2 v2

v3 v3 v3 v v v x y y

u u u v4 v4 v4

v5 v5 v5 (g) (h) (i)

Figure 8. Illustrating the proof of Claims 14–16. Arrows and dashed arrows denote the same type of edges as in Fig. 5.

Claim 15. The orientation P + F′ contains no forbidden configurations for 3 + 1. Proof of Claim 15. Suppose that P+F′ contains a forbidden configuration (x,y, z,w) for 3 + 1. Notethat(x,y), (y, z) ∈ −1 + P implies (x, z) ∈ P. If(w, z), (x,w) ∈ A(u,v) then (z,w), (w, x) ∈ F, that is, (x, z,w) is a forbidden configuration for 2 1 + −1 −1 in P F, a contradiction. Thus either (w, z) ∈ A(u,v) or (x,w) ∈ A(u,v). −1 < −1 < We first suppose (w, z) ∈ A(u,v) and (x,w) A(u,v). We have (z,w) ∈ A(u,v) ⊆ F and (x,w) ∈ F but (x,w) A(u,v). Since (z,w) ∈ A(u,v), there is a regular obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (z,w) is its front. Suppose (z,w) = (v4,v3) (Fig. 8(b)). We have (x,v5) ∈ P from (x,y), (y,v4), (v4,v5) ∈ P. Then (u,v,v2,v3, x,v5) is a regular obstruction, and hence (x,v3) ∈ A(u,v), a contradiction. Suppose (z,w) = (v5,v3). We have (x,v5) ∈ P from (x,y), (y,v5) ∈ P. Then(u,v,v2,v3, x,v5) is a regular obstruction, and hence (x,v3) ∈ A(u,v), a contradiction. Suppose (z,w) = (v4,v2)(Fig.8(c)). We have(x,v5) ∈ P from (x,y), (y,v4), (v4,v5) ∈ P. We also have (v5,v3), (v3, u) ∈ F from Proposition 14. If (u, x) ∈ P then (x,v5) ∈ P implies (u,v5) ∈ P, contradicting (u,v5) ∈ F. If(x, u) ∈ P then (x, u,v,v2) is a forbidden configuration for 3 + 1 in P + F, a contradiction. Thus ux ∈ E(G). Proposition 9 implies that the vertices x,y,v5, u induce K1,3 in G. Then we have (u, x) ∈ F from (u,v5) ∈ F. If(x,v3) ∈ P then (x,v3, u) is a forbidden configuration for 2 + 1 in P + F, a contradiction. If (v3, x) ∈ P then (v2,v3) ∈ P implies (v2, x) ∈ P, contradicting (x,v2) ∈ F. Thus v3x ∈ E(G). Proposition 9 implies that the vertices x,y,v5,v3 induce K1,3 in G, and 16 we have (x,v3) ∈ F from (v5,v3) ∈ F. Then (u,v,v2,v3, x,v5) is a regular obstruction, and hence (x,v2) ∈ A(u,v), a contradiction. By similar arguments, we have a contradiction when we suppose (z,w) = (v5,v2). −1 < −1 < We next suppose (x,w) ∈ A(u,v) and (w, z) A(u,v). We have (w, x) ∈ A(u,v) ⊆ F and (w, z) ∈ F but (w, z) A(u,v). Since (w, x) ∈ A(u,v), there is a regular obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (w, x) is its front. Suppose (w, x) = (v4,v3) (Fig. 8(d)). We have (v2, z) ∈ P from (v2,v3), (v3,y), (y, z) ∈ P. Then (u,v,v2, z,v4,v5) is a regular obstruction, and hence (v4, z) ∈ A(u,v), a contradiction. Suppose (w, x) = (v4,v2). We have (v2, z) ∈ P from (v2,y), (y, z) ∈ P. Then(u,v,v2, z,v4,v5) is a regular obstruction, and hence (v4, z) ∈ A(u,v), a contradiction. Suppose (w, x) = (v5,v3)(Fig.8(e)). We have(v2, z) ∈ P from (v2,v3), (v3,y), (y, z) ∈ P. We also have (v,v4), (v4,v2) ∈ F from Proposition 14. If (z,v) ∈ P then (v2, z) ∈ P implies (v2,v) ∈ P, contradicting (v2,v) ∈ F. If(v, z) ∈ P then (u,v, z,v5) is a forbidden configuration for 3 + 1 in P + F, a contradiction. Thus vz ∈ E(G). Proposition 9 implies that the vertices v2,y, z,v induce K1,3 in G. Then we have (z,v) ∈ F from (v2,v) ∈ F. If(v4, z) ∈ P then (v4, z,v) is a forbid- den configuration for 2 + 1 in P + F, a contradiction. If (z,v4) ∈ P then (v4,v5) ∈ P implies (z,v5) ∈ P, contradicting (v5, z) ∈ F. Thus v4z ∈ E(G). Proposition 9 implies that the vertices v2,y, z,v4 induce K1,3 in G, andwehave(v4, z) ∈ F from (v4,v2) ∈ F. Then (u,v,v2, z,v4,v5) is a regular obstruction, and hence (v5, z) ∈ A(u,v), a contradiction. By similar arguments, we have a contradiction when we suppose (z,w) = (v5,v2).  Claim 16. The orientation P + F′ contains no forbidden configurations for 2 + 1. + ′ + −1 Proof of Claim 16. Suppose that P F contains a forbidden configuration (x,y, z) for 2 1. If(y, z), (z, x) ∈ A(u,v) −1 −1 then we have from Claim 13 that (y, z) ∈ A(u,v) implies (u, z) ∈ F and (z, x) ∈ A(u,v) implies (z, u) ∈ F, a contradiction. −1 −1 Thus either (y, z) ∈ A(u,v) or (z, x) ∈ A(u,v). −1 < −1 < We first suppose (y, z) ∈ A(u,v) and (z, x) A(u,v). We have (z,y) ∈ A(u,v) ⊆ F and (z, x) ∈ F but (z, x) A(u,v). Since (z,y) ∈ A(u,v), there is a regular obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (z,y) is its front. Suppose (z,y) = (v4,v3) (Fig. 8(f)). We have (v3, u), (v,v4) ∈ F from Proposition 14. If (v, x) ∈ P then (u,v), (x,v3) ∈ P implies (u,v3) ∈ P, contradicting (v3, u) ∈ F. If(x,v) ∈ P then (x,v,v4) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus vx ∈ E(G). Proposition 8 implies that (u, x,v,v3) is C4 in G, and we have (x,v) ∈ F from (v3, u) ∈ F. Then (u,v, x,v3,v4,v5) is a regular obstruction, and hence (v4, x) ∈ A(u,v), a contradiction. When we suppose (z,w) = (v4,v2), we have (x,v3) ∈ P from (x,v2), (v2,v3) ∈ P. Thus by similar arguments, we have a contradiction. Suppose (z,y) = (v5,v3) (Fig. 8(g)). We have (v3, u), (v,v5) ∈ F from Proposition 14. If (v, x) ∈ P then (u,v), (x,v3) ∈ P implies (u,v3) ∈ P, contradicting (v3, u) ∈ F. If(x,v) ∈ P then (x,v,v5) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus vx ∈ E(G). Proposition 8 implies that (u, x,v,v3) is C4 in G, and we have (x,v) ∈ F from (v3, u) ∈ F. Then(u,v, x,v3,v4,v5) is a regular obstruction, and hence (v5, x) ∈ A(u,v), a contradiction. When we suppose (z,y) = (v5,v2), we have (x,v3) ∈ P from (x,v2), (v2,v3) ∈ P. Thus by similar arguments, we have a contradiction. −1 < −1 < We next suppose (z, x) ∈ A(u,v) and (y, z) A(u,v). We have (x, z) ∈ A(u,v) ⊆ F and (y, z) ∈ F but (y, z) A(u,v). Since (x, z) ∈ A(u,v), there is a regular obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (x, z) is its front. Suppose (x, z) = (v4,v3) (Fig. 8(h)). We have (v3, u), (v,v4) ∈ F from Proposition 14. If (y, u) ∈ P then (v4,y), (u,v) ∈ P implies (v4,v) ∈ P, contradicting (v,v4) ∈ F. If(u,y) ∈ P then (u,y,v3) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus uy ∈ E(G). Proposition 8 implies that (u,v4,v,y) is C4 in G, and we have (u,y) ∈ F from (v,v4) ∈ F. Then(u,v,v2,v3,v4,y) is a regular obstruction, and hence (y,v2) ∈ A(u,v), a contradiction. When we suppose (x, z) = (v5,v3), we have (v4,y) ∈ P from (v4,v5), (v5,y) ∈ P. Thus by similar arguments, we have a contradiction. Suppose (x, z) = (v4,v2) (Fig. 8(i)). We have (v2, u), (v,v4) ∈ F from Proposition 14. If (y, u) ∈ P then (v4,y), (u,v) ∈ P implies (v4,v) ∈ P, contradicting (v,v4) ∈ F. If(u,y) ∈ P then (u,y,v2) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus uy ∈ E(G). Proposition 8 implies that (u,v4,v,y) is C4 in G, and we have (u,y) ∈ F from (v,v4) ∈ F. Then(u,v,v2,v3,v4,y) is a regular obstruction, and hence (y,v2) ∈ A(u,v), a contradiction. When we suppose (x, z) = (v5,v2), we have (v4,y) ∈ P from (v4,v5), (v5,y) ∈ P. Thus by similar arguments, we have a contradiction. 

−1 + ′ Claim 17. Noedgein A(u,v) is an edge of a regular obstruction of P F . That is, reversing the direction of the edges in A(u,v) generates no new regular obstructions. ′ Proof of Claim 17. Suppose that P + F contains a regular obstruction (v0,v1,v2,v3,v4,v5). Assume without loss of −1 −1 −1 generality (v4,v3) ∈ A(u,v). Suppose (v0,v5) ∈ A(u,v). We have from Claim 13 that (v4,v3) ∈ A(u,v) implies (v4,v) ∈ F and −1 + + (v0,v5) ∈ A(u,v) implies (u,v5) ∈ F. Thus (u,v,v4,v5) is a forbidden configuration for 2 2 in P F, a contradiction. < −1 < −1 Thus (v0,v5) A(u,v). Similarly, we have (v2,v1) A(u,v). 17 v2

v3 v v1

u v0 v4

v5

Figure 9. Illustrating the proof of Claim 17. Arrows, dashed arrows, and dashed lines denote the same type of edges as in Fig. 5.

Now, (v3,v4) ∈ A(u,v) ⊆ F and(v0,v5), (v2,v1) ∈ F but (v0,v5), (v2,v1) < A(u,v). Claim 13 implies (u,v3), (v,v3), (v4, u), (v4,v) ∈ F (Fig. 9). If (v0,v) ∈ P then (v0,v,v4,v5) is a forbidden configuration for 2 + 2 in P + F, a contradiction. If (v,v0) ∈ P then (v0,v1) ∈ P implies (v,v1) ∈ P, but then (v,v1,v2,v3) is a forbidden configuration for 2 + 2 in P + F, a contra- diction. Thus vv0 ∈ E(G). If(v1, u) ∈ P then (v0,v1), (u,v) ∈ P implies (v0,v) ∈ P, contradicting vv0 ∈ E(G). If (u,v1) ∈ P then (u,v1,v2,v3) is a forbidden configuration for 2 + 2 in P + F, a contradiction. Thus uv1 ∈ E(G). Propo- sition 8 implies that (u,v0,v,v1) is C4 in G. If(v,v0), (u,v1) ∈ F then (u,v,v4,v5,v0,v1) is a regular obstruction, and hence (v0,v5) ∈ A(u,v), a contradiction. If (v0,v), (v1, u) ∈ F then (u,v,v0,v1,v2,v3) is a regular obstruction, and hence (v2,v1) ∈ A(u,v), a contradiction. 

The following is trivial from the definition of A(u,v). Claim 18. The orientation P + F′ contains no regular obstructions with base (u,v). ′′ Claims 14–18 ensure that by repeating the procedure for each edge of P, we can obtain an orientation F of Eo such that P+F′′ contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, and P+F′′ contains no regular obstructions. Now, let F be an orientation of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, and P + F contains no regular obstructions. Then, let (u,v) be an edgein P. We define that

B(u,v) = {(x,y) ∈ F : there is a skewed obstruction such that (u,v) is its base and (x,y) is its front}, −1 = B(u,v) {(y, x):(x,y) ∈ B(u,v)}, and ′ = + −1 F (F − B(u,v)) B(u,v). ′ In other words, F is an orientation of Eo obtained from F by reversing the direction of all edges in B(u,v). Claim 19. The orientation P + F′ contains no forbidden configurations for 2 + 2. + ′ + −1 Proof of Claim 19. Suppose that P F contains a forbidden configuration (x,y, z,w) for 2 2. If(z,y), (x,w) ∈ B(u,v) then (y, z), (w, x) ∈ F, that is, (x,y, z,w) is an alternating cycle of length 4 in P + F, contradicting Proposition 16. −1 −1 −1 < −1 Thus either (z,y) ∈ B(u,v) or (x,w) ∈ B(u,v). Assume without loss of generality (z,y) ∈ B(u,v) and (x,w) B(u,v). Then (y, z) ∈ B(u,v) ⊆ F and (x,w) ∈ F but (x,w) < B(u,v). Since (y, z) ∈ B(u,v), there is a skewed obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (y, z) is its front. Suppose (y, z) = (v4,v3) (Fig. 10(a)). We have (x,v5) ∈ P from (x,v4), (v4,v5) ∈ P. We also have (v3,v) ∈ F from Proposition 15. Then (u,v,v3,w, x,v5) is a regular obstruction of P + F, a contradiction. By similar arguments, we have a contradiction when we suppose (y, z) = (v5,v3).  Claim 20. The orientation P + F′ contains no forbidden configurations for 3 + 1. Proof of Claim 20. Suppose that P+F′ contains a forbidden configuration (x,y, z,w) for 3 + 1. Notethat(x,y), (y, z) ∈ −1 + P implies (x, z) ∈ P. If(w, z), (x,w) ∈ B(u,v) then (z,w), (w, x) ∈ F, that is, (x, z,w) is a forbidden configuration for 2 1 + −1 −1 in P F, a contradiction. Thus either (w, z) ∈ B(u,v) or (x,w) ∈ B(u,v). −1 < −1 < We first suppose (w, z) ∈ B(u,v) and (x,w) B(u,v). We have (z,w) ∈ B(u,v) ⊆ F and (x,w) ∈ F but (x,w) B(u,v). Since (z,w) ∈ B(u,v), there is a skewed obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (z,w) is its front. Suppose (z,w) = (v4,v3) (Fig. 10(b)). We have (x,v5) ∈ P from (x,y), (y,v4), (v4,v5) ∈ P. Then (u,v,v2,v3, x,v5)isa 18 v2

v3 w v

u v4 x

v5 (a) v2 v2 v2

v3 x v3 y v3 y v v v

u u u v4 y v4 z v4 z

v5 v5 v5 (b) (c) (d) v2 v2 v2

v3 v3 v3 v v v x x y

u u u v4 v4 v4

v5 v5 v5 (e) (f) (g)

Figure 10. Illustrating the proof of Claims 19–21. Arrows and dashed arrows denote the same type of edges as in Fig. 5.

skewed obstruction, and hence (x,v3) ∈ B(u,v), a contradiction. By similar arguments, we have a contradiction when we suppose (y, z) = (v5,v3). −1 < −1 < We next suppose (x,w) ∈ B(u,v) and (w, z) B(u,v). We have (w, x) ∈ B(u,v) ⊆ F and (w, z) ∈ F but (w, z) B(u,v). Since (w, x) ∈ B(u,v), there is a skewed obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (w, x) is its front. Suppose (w, x) = (v4,v3) (Fig. 10(c)). We have (v3,v) ∈ F from Proposition 15. Then (u,v,v3, z,v4,v5)isa regular obstruction of P + F, a contradiction. Suppose (w, x) = (v5,v3) (Fig. 10(d)). We have (v3,v), (v,v4) ∈ F from Proposition 15. If (z,v) ∈ P then (v3, z) ∈ P implies (v3,v) ∈ P, contradicting (v3,v) ∈ F. If(v, z) ∈ P then (u,v, z,v5) is a forbidden configuration for 3 + 1 in P+ F, a contradiction. Thus vz ∈ E(G). Proposition 8 implies that (v,v3,v2, z) is C4 in G. Then we have (z,v) ∈ F from (v3,v2) ∈ F. If(v4, z) ∈ P then (v4, z,v) is a forbidden configuration for 2 + 1 in P + F, a contradiction. If (z,v4) ∈ P then (v4,v5) ∈ P implies (z,v5) ∈ P, contradicting (v5, z) ∈ F. Thus v4z ∈ E(G). Proposition 9 implies that the vertices v3,y, z,v4 induce K1,3 in G, and we have (v4, z) ∈ F from (v4,v3) ∈ F. Then (u,v,v3, z,v4,v5) is a regular obstruction of P + F, a contradiction. 

Claim 21. The orientation P + F′ contains no forbidden configurations for 2 + 1. 19 + ′ + −1 Proof of Claim 21. Suppose that P F contains a forbidden configuration (x,y, z) for 2 1. If(y, z), (z, x) ∈ B(u,v) −1 −1 then we have from Claim 13 that (y, z) ∈ B(u,v) implies (u, z) ∈ F and (z, x) ∈ B(u,v) implies (z, u) ∈ F, a contradiction. −1 −1 Thus either (y, z) ∈ B(u,v) or (z, x) ∈ B(u,v). −1 < −1 < We first suppose (y, z) ∈ B(u,v) and (z, x) B(u,v). We have (z,y) ∈ B(u,v) ⊆ F and (z, x) ∈ F but (z, x) B(u,v). Since (z,y) ∈ B(u,v), there is a skewed obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (z,y) is its front. Suppose (z,y) = (v4,v3) (Fig. 10(e)). We have (v3, u), (v,v4) ∈ F from Proposition 15. If (v, x) ∈ P then (u,v), (x,v3) ∈ P implies (u,v3) ∈ P, contradicting (v3, u) ∈ F. If(x,v) ∈ P then (x,v,v4) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus vx ∈ E(G). Proposition 8 implies that (u, x,v,v3) is C4 in G, and we have (x,v) ∈ F from (v3, u) ∈ F. Then(u,v, x,v3,v4,v5) is a regular obstruction of P + F, a contradiction. Suppose (z,y) = (v5,v3) (Fig. 10(f)). We have (v3, u), (v,v5) ∈ F from Proposition 15. If (v, x) ∈ P then (u,v), (x,v3) ∈ P implies (u,v3) ∈ P, contradicting (v3, u) ∈ F. If(x,v) ∈ P then (x,v,v5) is a forbidden configu- ration for 2 + 1 in P + F, a contradiction. Thus vx ∈ E(G). Proposition 8 implies that (u, x,v,v3) is C4 in G, and we have (x,v) ∈ F from (v3, u) ∈ F. Then(u,v, x,v3,v4,v5) is a regular obstruction of P + F, a contradiction. −1 < −1 < We next suppose (z, x) ∈ B(u,v) and (y, z) B(u,v). We have (x, z) ∈ B(u,v) ⊆ F and (y, z) ∈ F but (y, z) B(u,v). Since (x, z) ∈ B(u,v), there is a skewed obstruction (u,v,v2,v3,v4,v5) of P + F such that (u,v) is its base and (x, z) is its front. Suppose (x, z) = (v4,v3) (Fig. 10(g)). We have (v3, u), (v,v4) ∈ F from Proposition 15. If (y, u) ∈ P then (v4,y), (u,v) ∈ P implies (v4,v) ∈ P, contradicting (v,v4) ∈ F. If(u,y) ∈ P then (u,y,v3) is a forbidden configuration for 2 + 1 in P + F, a contradiction. Thus uy ∈ E(G). Proposition 8 implies that (u,v4,v,y) is C4 in G, and we have (u,y) ∈ F from (v,v4) ∈ F. Then (u,v,v2,v3,v4,y) is a skewed obstruction, and hence (y,v3) ∈ B(u,v), a contradiction. When we suppose (x, z) = (v5,v3), we have (v4,y) ∈ P from (v4,v5), (v5,y) ∈ P. Thus by similar arguments, we have a contradiction.  Claim 22. The orientation P + F′ contains no regular obstructions. Proof of Claim 22. As in the proof of Claim 17, if P + F′ contains a regular obstruction, then P + F also contains a regular obstruction, a contradiction. 

′ Claim 23. IfP + F contains no skewed obstructions with base (v0,v1), then P + F contains no skewed obstructions with base (v0,v1). ′ Proof of Claim 23. Suppose that P + F contains a skewed obstruction (v0,v2,v2,v3,v4,v5) with base (v0,v1) whereas P + F does not contain this obstruction. −1 −1 Suppose (v0,v5) ∈ B(u,v). From Claim 13, we have (u,v5), (v,v5), (v0, u), (v0,v) ∈ F. If(v4,v3) ∈ B(u,v) then from Claim 13, we have (v4,v) ∈ F, and hence (u,v,v4,v5) is a forbidden configuration for 2 + 2 in P + F, a contradiction. −1 −1 If (v5,v3) ∈ B(u,v) then from Claim 13, we have (v5, u), (v5,v) ∈ F, contradicting (u,v5), (v,v5) ∈ F. If(v3,v2) ∈ B(u,v) then from Claim 13, we have (u,v2) ∈ F, and hence (u,v,v0,v2) is a forbidden configuration for 2 + 2 in P + F, a < −1 contradiction. Therefore, (v4,v3), (v5,v3), (v3,v2) B(u,v). Now, (v5,v0) ∈ B(u,v) ⊆ F and (v4,v3), (v5,v3), (v3,v2) ∈ F but (v4,v3), (v5,v3), (v3,v2) < B(u,v). From Claim 13, we have (u,v5), (v,v5), (v0, u), (v0,v) ∈ F (Fig. 11(a)). If (v4,v1) ∈ P then (v4,v1,v2,v3) is a forbidden configuration for 3 + 1 in P + F, a contradiction. If (v1,v4) ∈ P then (v0,v1), (v4,v5) ∈ P implies (v0,v5) ∈ P, contradicting (v5,v0) ∈ F. Thus v4v1 ∈ E(G). Proposition 8 implies that (v4,v0,v5,v1) is C4 in G, andwe have (v4,v1) ∈ F from (v5,v0) ∈ F. Then (u,v,v0,v1,v4,v5) is a regular obstruction of P + F, a contradiction. −1 −1 Suppose (v3,v2) ∈ B(u,v). From Claim 13, we have (u,v2), (v,v2), (v3, u), (v3,v) ∈ F. If(v4,v3) ∈ B(u,v) or (v5,v3) ∈ −1 −1 B(u,v), then from Claim 13, we have (u,v3), (v,v3) ∈ F, contradicting (v3, u), (v3,v) ∈ F. If(v0,v5) ∈ B(u,v) then from Claim 13, we have (v0,v) ∈ F, and thus (u,v,v0,v2) is a forbidden configuration for 2 + 2 in P + F, a contradiction. < −1 Therefore, (v4,v3), (v5,v3), (v0,v5) B(u,v). Now, (v2,v3) ∈ B(u,v) ⊆ F and (v4,v3), (v5,v3), (v0,v5) ∈ F but (v4,v3), (v5,v3), (v0,v5) < B(u,v). Since (v2,v3) ∈ B(u,v), there is a skewed obstruction (u,v, u2, u3, u4, u5) of P + F such that (u,v) is its base and (v2,v3) is its front. Suppose (v2,v3) = (u4, u3) (Fig. 11(b)). We have (v0, u5) ∈ P from (v0,v1), (v1, u4), (u4, u5) ∈ P. If(u,v5) ∈ P then (u,v5,v0, u5) is a forbidden configuration for 2 + 2 in P+F, a contradiction. If (v4,v) ∈ P then (v4,v, u2, u3) is a forbidden configuration for 3 + 1 in P + F, a contradiction. If (v5, u) ∈ P then (v4,v5), (u,v) ∈ P implies (v4,v) ∈ P, a contradiction. If (v,v4) ∈ P then (u,v), (v4,v5) ∈ P implies (u,v5) ∈ P, a contradiction. Thus uv5,vv4 ∈ E(G). Proposition 8 implies that (u,v4,v,v5) is C4 in G. If(u,v5), (v,v4) ∈ F then (u,v, u2, u3,v4,v5) is a skewed obstruction, and hence (v4, u3) ∈ B(u,v), a contradiction. If (v5, u), (v4,v) ∈ F then (u,v,v4,v5,v0, u5) is a regular obstruction of P + F, a contradiction. When 20 v4

v5 v v3

u v2 v0

v1 (a) u2 v4 u2 v4

u3 u3 v v5 v v5

u v0 u v0 u4 u4

u5 v1 u5 v1 (b) (c) u2 u3 u2 u3

v4 v4 v v0 v v0

u v1 u v1 u4 u4

u5 v2 u5 v2 (d) (e)

Figure 11. Illustrating the proof of Claim 23. Arrows, dashed arrows, and dashed lines denote the same type of edges as in Fig. 5.

we suppose (v2,v3) = (u5, u3) (Fig. 11(c)), we have (v0, u5) ∈ P from (v0,v1), (v1, u5) ∈ P. Thus by similar arguments, we have a contradiction. −1 −1 Suppose (v5,v3) ∈ B(u,v). From Claim 13, we have (u,v3), (v,v3), (v5, u), (v5,v) ∈ F. If(v3,v2) ∈ B(u,v) then from −1 Claim 13, we have (v3, u), (v3,v) ∈ F, contradicting (u,v3), (v,v3) ∈ F. If(v0,v5) ∈ B(u,v) then from Claim 13, we have < −1 (u,v5), (v,v5) ∈ F, contradicting (v5, u), (v5,v) ∈ F. Therefore, (v3,v2), (v0,v5) B(u,v). Now, (v3,v5) ∈ B(u,v) ⊆ F and (v3,v2), (v0,v5) ∈ F but (v3,v2), (v0,v5) < B(u,v). Note that it does not matter whether −1 < −1 + (v4,v3) ∈ B(u,v) or (v4,v3) B(u,v). Since (v3,v5) ∈ B(u,v), there is a skewed obstruction (u,v, u2, u3, u4, u5) of P F such that (u,v) is its base and (v3,v5) is its front. Suppose (v3,v5) = (u4, u3) (Fig. 11(d)). If (u,v1) ∈ P then (v1,v2) ∈ P implies (u,v2) ∈ P. Thus (u,v2, u4, u5) is a forbidden configuration for 2 + 2 in P + F, a contradiction. If (v0,v) ∈ P then (v0,v, u2, u3) is a forbidden configuration for 3 + 1 in P + F, a contradiction. If (v1, u) ∈ P then (v0,v1), (u,v) ∈ P implies (v0,v) ∈ P, a contradiction. If (v,v0) ∈ P then (u,v), (v0,v1) ∈ P implies (u,v1) ∈ P, a contradiction. Thus uv1,vv0 ∈ E(G). Proposition 8 implies that (u,v0,v,v1) is C4 in G. If(u,v1), (v,v0) ∈ F then (u,v, u2, u3,v0,v1) is a skewed obstruction, and hence (v0, u3) ∈ B(u,v), a contradiction. If (v1, u), (v0,v) ∈ F then (u,v,v0,v2, u4, u5) is a regular obstruction of P + F, a contradiction. 21 Algorithm 3: Algorithm for Lemma 17

Input: An orientation F of Eo such that P + F contains no forbidden configurations. ′ ′ Output: An orientation F of Eo such that P + F contains no forbidden configurations nor no obstructions.

1 foreach (u,v) ∈ P do /* remove regular obstructions */ 2 A(u,v) ←∅; 3 foreach pair (v4,v3), (v5,v2) ∈ F do 4 if (v2,v3), (v4,v5) ∈ P and (v2,v), (u,v5) ∈ F then 5 A(u,v) ← A(u,v) + {(v4,v3), (v5,v3), (v4,v2), (v5,v2)}; 6 end 7 end + −1 8 F ← (F − A(u,v)) A(u,v); 9 end 10 foreach (u,v) ∈ P do /* remove skewed obstructions */ 11 B(u,v) ←∅; 12 foreach pair (v4,v3), (v5,v2) ∈ F do 13 if (v,v2), (v4,v5) ∈ P and (v3,v2), (v5,v3), (u,v5) ∈ F then 14 B(u,v) ← B(u,v) + {(v4,v3), (v5,v3)}; 15 end 16 end + −1 17 F ← (F − B(u,v)) B(u,v); 18 end 19 return F;

Suppose (v3,v5) = (u5, u3) (Fig. 11(e)). If (u,v1) ∈ P then (u,v1,v2, u5) is a forbidden configuration for 3 + 1 in P + F, a contradiction. If (v0,v) ∈ P then (v0,v, u2, u3) is a forbidden configuration for 3 + 1 in P + F, a contradiction. If (v1, u) ∈ P then (v0,v1), (u,v) ∈ P implies (v0,v) ∈ P, a contradiction. If (v,v0) ∈ P then (u,v), (v0,v1) ∈ P implies (u,v1) ∈ P, a contradiction. Thus uv1,vv0 ∈ E(G). Proposition 8 implies that (u,v0,v,v1) is C4 in G. If(u,v1), (v,v0) ∈ F then (u,v, u2, u3,v0,v1) is a skewed obstruction, and hence (v0, u3) ∈ B(u,v), a contradiction. If (v1, u), (v0,v) ∈ F then (v0,v1,v2, u5, u,v) is a skewed obstruction with base (v0,v1), contradicting the assumption that P+F contains no skewed obstructions with base (v0,v1). −1 < −1 Suppose (v4,v3) ∈ B(u,v). If(v5,v3) B(u,v) then (v5,v3), (v3,v4) ∈ F, that is, (v4,v5,v3) is a forbidden configuration + + −1  for 2 1 in P F, a contradiction. Thus we have (v5,v3) ∈ B(u,v), a contradiction.

The following is trivial from the definition of B(u,v). Claim 24. The orientation P + F′ contains no skewed obstructions with base (u,v). ′′ Claims 19–24 ensure that by repeating the procedure for each edge of P, we can obtain an orientation F of Eo such that P + F′′ contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, and P + F′′ contains no obstructions. Therefore, we can compute the orientation by Algorithm 3. 2 Each iteration on lines 3–7 takes O(1) time for each pair of edges of F. Hence A(u,v) can be constructed in O(¯m ) 2 2 time and |A(u,v)| = O(¯m ). Therefore, we can remove all regular obstructions in O(mm¯ ) time (lines 1–9). Similarly, we can remove all skewed obstructions in O(mm¯ 2) time (lines 10–18). Hence Algorithm 3 takes O(mm¯ 2) time.  Now from the lemmas above, we have the main theorem and the following characterization.

Theorem 18. A partial order P on a set V is a linear-semiorder if and only if there is an orientation F of Eo (or, equivalently, an orientation F of the incomparability graphof P)suchthat P + F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1. Proof. Let G be the incomparability graph of P. If P is a linear-semiorder, then Proposition 6 implies that thereis an orientation F of G such that P + F is acyclic and contains no forbidden configurations for 2 + 2 or 3 + 1. Since P + F is acyclic, it contains no forbidden configurations for 2 + 1. 22 Suppose there is an orientation F of Eo such that P + F contains no forbidden configurations for 2 + 2, 3 + 1, or ′ ′ 2 + 1. From Lemma 17, we have another orientation F of Eo such that P+ F contains no forbidden configurations for 2 + 2, 3 + 1, or 2 + 1, and P + F′ contains no obstructions. Since P + F′ contains no obstructions, Lemma 13 implies that P + F′ is acyclic. By Lemma 7, P is a linear-semiorder.  Proof of Theorem 5. The first claim can be obtained from Theorem 18 and Lemma 10. The second claim can be obtained from Lemmas 17, 13, 10 and 7. 

5. Comparability invariance A property of partial orders is called a comparability invariant if either all orders with the same comparability graph have that property or none has that property. It is known that being a linear-interval order is a comparability invariant [6]. In this section, we show the following. Theorem 19. Being a linear-semiorder is a comparability invariant. From Theorems 19 and 5, we have the following. Corollary 20. Comparability graphs of linear-semiorders can be recognized in O(nm¯ ) time, where n and m¯ are the number of vertices and non-edges of the given graph, respectively. Incomparability graphs of linear-semiorders can be recognized in O(nm) time, where m is the number of edges of the given graph. Proof. We can recognize comparability graphs of linear-semiorders by the following algorithm. Let G be the given graph. First, obtain a transitive orientation P of G. If G does not have a transitive orientation, G is not a comparability graph. Then, test whether P is a linear-semiorder by Algorithms 1–3. Theorem 19 ensures that every transitive orientation of G is a linear-semiorder if G is the comparability graph of a linear-semiorder. Thus the algorithm is correct. Both steps can be done in O(nm¯ ) time as shown in Proposition 1 and Theorem 5. Thus the algorithm takes O(nm¯ ) time. Since the complement of a graph can be obtained in O(n2) time, incomparability graphs of linear-semiorders can be recognized in O(nm) time.  To prove Theorem 19, we use the proof technique developed in [10]. Let P be a partial order on a set V. A non- empty subset A ⊆ V is autonomous in P if for any element v ∈ V − A, whenever v ≺ a, v k a, or v ≻ a holds in P for some element a ∈ A, then the same holds for all elements a ∈ A. Let P′ be a partial order with the same comparability graph as P. The order P′ is said to be obtained from P by a reversal if there is an autonomous set A of P such that – if not both of u and v are in A, then u ≺ v in P′ if and only if u ≺ v in P, and – if both of u and v are in A, then u ≺ v in P′ if and only if u ≻ v in P. We denote by P | A the order obtained from P by reversing A. The following theorem provides a simple scheme to show the comparability invariance. Theorem 21 ( [12]). Two orders P and P′ have the same comparability graph if and only if there is a finite sequence ′ of orders P0, P1,..., Pk such that P0 = P, Pk = P ,and Pi is obtained from Pi−1 by a reversal for each i = 1, 2,..., k. Therefore, to prove Theorem 19, it suffices to show the following. Lemma 22. If an order P on a set V is a linear-semiorder and a subset A ⊆ V is autonomous in P, then P | A isa linear-semiorder. Proof of Theorem 19. Let P and P′ be two orders with the same comparability graph. It suffices to show that P is a linear-semiorder if and only if P′ is a linear-semiorder. From Theorem 21, there is a finite sequence of orders ′ P = P0, P1,..., Pk = P such that Pi is obtained from Pi−1 by a reversal for each i = 1, 2,..., k. Suppose that P = P0 ′ is a linear-semiorder. From Lemma 22, P1 is also a linear-semiorder. Continuing in this way, we have that Pk = P is a linear-semiorder. A symmetric argument would show that the converse also holds. 

In the rest of this section, we prove Lemma 22. Recall that L1 and L2 are two horizontal lines in the xy-plane with L1 above L2. As a representation of a linear-semiorder, we use a set of triangles between L1 and L2 as follows. Let P be a linear-semiorder on a set V, and let L and S be a linear order and a semiorder on V, respectively, with L ∩ S = P. Let {p(v): v ∈ V} be a set of points on L1 such that p(u) < p(v) if and only if u ≺ v in L for any two elements u,v ∈ V. Note that all the points are distinct. Let {I(v): v ∈ V} be a unit interval representation of S on L2. 23 We assume that no two intervals share a common endpoint. Let I(v) = [l(v), r(v)] for each element v ∈ V. Since each interval has unit length, l(v) + 1 = r(v). Let T(v) be the triangle spanned by p(v) and I(v). A triangle T(u) lies completely to the left of T(v), and we write T(u) ≪ T(v), if p(u) < p(v) on L1 and I(u) ≪ I(v) on L2. We have that u ≺ v in P if and only if T(u) ≪ T(v) for any two elements u,v ∈ V; hence we call the set {T(v): v ∈ V} a triangle representation of P. Now, we fix a pair of a linear-semiorder P and an autonomous set A of P. We also fix a triangle representation {T(v): v ∈ V} of P. An element a ∈ A is isolated in A if a k a′ in P for any element a′ ∈ A − {a}. Let A∗ be the subset of A obtained by removing all isolated elements of A. We can observe the following, and then we assume without loss of generality A∗ , ∅. Lemma 23. The set A∗ is autonomousin P, and P | A∗ = P | A. ∗ We define that l1 = minv∈A∗ p(v) and r1 = maxv∈A∗ p(v), similarly, l2 = minv∈A∗ l(v) and r2 = maxv∈A∗ r(v). Let C(A ) be the trapezoid spanned by the interval [l1, r1] on L1 and the interval [l2, r2] on L2, while l1 is the upper-left corner of ∗ ∗ ∗ C(A ) and r1 is the upper-right corner of C(A ), similarly, l2 is the lower-left corner of C(A ) and r2 is the lower-right corner of C(A∗). Note that C(A∗) can be viewed as the convex region spanned by the triangles T(v) with v ∈ A∗. In 1 1 ∗ 1 = 1 = 2 2 addition, let al and ar denote the elements of A with p(al ) l1 and p(ar ) r1, respectively. Similarly, let al and ar ∗ 2 = 2 = denote the elements of A with l(al ) l2 and r(ar ) r2, respectively. Let B be the set of elements v ∈ V with T(v) ⊆ C(A∗). Obviously, B ⊇ A∗. The convex region C(B) spanned by the triangles T(v) with v ∈ B is equal to C(A∗). ∗ Lemma 24. Let v ∈ V − B. IfT(v) ∩ C(A ) , ∅ then T(v) intersects with every triangle spanned by a point p ∈ [l1, r1] on L1 and a unit-length interval I ⊆ [l2, r2] on L2. ∗ Proof. Since v < B, we have T(v) * C(A ), and hence p(v) < [l1, r1] or I(v) * [l2, r2]. ∗ , 2 , 2 Suppose p(v) < l1. Since T(v) ∩ C(A ) ∅, we have l2 < r(v). Thus T(v) ∩ T(al ) ∅, and hence v k al in ∗ 2 2 2 P. Since A is autonomous, v k ar in P, and hence T(v) ∩ T(ar ) , ∅. Thus l(ar ) < r(v). Therefore, p(v) < l1 and 2 = l(ar ) r2 − 1 < r(v), and the claim holds. A similar argument would show that the claim holds when r1 < p(v). 2 , ∗ , Suppose l(v) < l2. If l2 < r(v) then T(v) ∩ T(al ) ∅. If r(v) < l2 then T(v) ∩ C(A ) ∅ implies l1 < p(v), and hence 1 , ∗ ∗ 1 T(v) ∩ T(al ) ∅. Thus in both cases, v k a in P for some element a ∈ A . Since A is autonomous, v k ar in P. Since 1 ′ ∗ ′ 1 ′ ar is not isolated, there is an element a ∈ A with T(a ) ≪ T(ar ). Since l(v) < l2 ≤ l(a ) and each interval has unit ′ 1 1 length, r(v) < r(a ), and hence I(v) ≪ I(ar ). It follows p(ar ) < p(v). Therefore, r1 < p(v) and l(v) < l2, and the claim holds. A similar argument would show that the claim holds when r2 < r(v).  From Lemma 24, we have the following. Lemma 25. For any element v ∈ V − B, one of the following holds: – T(v) lies completely to the left of C(A∗). – T(v) intersects with every triangle contained in C(A∗). – T(v) lies completely to the right of C(A∗). We also have the following from Lemma 25 Lemma 26. The set B is autonomous in P. Proof. Let v ∈ V − B. Suppose that v k b in P for some element b ∈ B. Then T(v) ∩ T(b) , ∅ implies T(v) ∩ C(A∗) , ∅, and hence T(v) ∩ T(b) , ∅ for all elements b ∈ B. Thus v k b in P for all elements b ∈ B. If v ≺ b in P for some element b ∈ B, then T(v) lies completely to the left of C(A∗), and hence v ≺ b in P for all elements b ∈ B. If v ≻ b in P for some element b ∈ B, then T(v) lies completely to the right of C(A∗), and hence v ≻ b in P for all elements b ∈ B. 

′ Let P1 = P | B. We define {T (v): v ∈ V} as the set of triangles obtained from {T(v): v ∈ V} by flipping the representation of B relative to C(B), that is, T ′(v) = T(v) for any element v ∈ V − B whereas for each element v ∈ B, ′ the triangle T (v) is the triangle spanned by the point l1 + r1 − p(v) on L1 and the interval [l2 + r2 − r(v), l2 + r2 − l(v)] ′ ′ on L2. Note that the convex region C (B) spanned by the triangles T (v) with v ∈ B is equal to C(B). ′ Lemma 27. The order P1 is a linear-semiorder with a representation {T (v): v ∈ V}. 24 Proof. Let P′ be the partial order on V defined by {T ′(v): v ∈ V}, and let u and v be two elements of V. If neither u nor v is in B, then their relation in P′ remains the same as in P. If either u or v is in B, then Lemma 25 ensures that their relation in P′ remains the same as in P. If both u and v are in B, then T ′(u) ≪ T ′(v) ⇐⇒ T(u) ≫ T(v); hence ′ ′ u ≺ v in P if and only if u ≻ v in P. Thus P = P1. 

∗ ∗ ∗ Let A1 = B − A . If A1 = ∅ then B = A , and hence P | A = P | A = P | B = P1 is a linear-semiorder. Thus we assume without loss of generality A1 , ∅.

∗ Lemma 28. All elements of A1 are incomparable to all elements of A in P.

′ ′ ∗ ∗ 1 Proof. Suppose there is an element a ∈ A1 with a ≺ a in P for some element a ∈ A . Since A is autonomous, a ≺ al 2 ∗ , ′ and a ≺ al in P, contradicting T(a) ∩ C(A ) ∅. Similarly, there are no elements a ∈ A1 with a ≺ a in P for some element a′ ∈ A∗. 

Lemma 29. The set A1 is autonomous in P1, and P1 | A1 = P | A.

Proof. Let v ∈ V − A1. If v ∈ V − B then, since B is autonomous in P1, whenever v ≺ a, v k a, or v ≻ a holds in P1 ∗ for some element a ∈ A1 ⊆ B, the same holds for all elements a ∈ A1. If v ∈ B − A1 then v ∈ A , and we have from Lemma 28 that v k a in P1 for all elements a ∈ A1. Thus A1 is autonomous in P1. ∗ ∗ ∗ Lemma 28 implies P | B = (P | A ) | A1. Thus (P | B) | A1 = P | A . Since P1 = P | B and P | A = P | A, we have P1 | A1 = P | A. 

∗ We repeat the process by replacing P and A with P1 and A1, respectively. Let A1 be the subset of A1 obtained by ∗ ∗ = removing all isolated elements of A1. From Lemma 23, the set A1 is autonomous in P1 and P1 | A1 P1 | A1. We ∗ , ′ ∗ ′ assume without loss of generality A1 ∅. We define C (A1) as the convex region spanned by the triangles T (v) with ∗ ′ ′ ∗ v ∈ A1. Let B1 be the set of elements v ∈ V with T (v) ⊆ C (A1). From Lemma 26, the set B1 is autonomous in P1, and = = ∗ let P2 P1 | B1. From Lemma 27, the order P2 is a linear-semiorder. Let A2 B1 − A1, and we assume without loss of generality A2 , ∅. From Lemma 29, the set A2 is autonomous in P2, and P2 | A2 = P1 | A1. ∗ ∗ Let A2 be the subset of A2 obtained by removing all isolated elements of A2. From Lemma 23, the set A2 is ∗ = autonomous in P2, and P2 | A2 P2 | A2. ∗ ∗ Lemma 30. The set A2 is a proper subset of A . ∗ ′ ∗ ′ = = ∗ 1 ′ 1 Proof. Since A1 ⊆ B, we have C (A1) ⊆ C (B) C(B) C(A ). Thus B1 ⊆ B. Suppose al ∈ B1. Then T (al ) ⊆ ′ ∗ 1 ∗ 1 < ∗ = ∗ ∗ ′ ′ 1 ′ C (A1). Since al ∈ A , we have al A1 B − A . Thus there are two elements a, b ∈ A1 with p (a) < p (al ) < p (b), ′ ′ ′ 1 = + 1 = ′ where p (v) is the point of T (v) on L1. However, p (al ) l1 r1 − p(al ) r1, that is, r1 < p (b), contradicting ′ ∗ ∗ 1 < C (A1) ⊆ C(A ). Therefore, al B1. ∗ ∗ ∗ ∗ The set B can be partitioned into three sets A , A1 − A1, and A1. By definition, all elements of A1 − A1 are ∗ incomparable to all other elements of A1. From Lemma 28, all elements of A1 − A1 are incomparable to all elements ∗ ∗ of A . Thus all elements of A1 − A1 are incomparable to all other elements of B. ∗ = ∗ ∗ = ∗ ∗ ∗ We have A2 ⊆ A2 B1 − A1 ⊆ B − A1 A ∪ (A1 − A1). Since all elements of A1 − A1 are incomparable to all ∗ ∗ = ∗ ∗ 1 ∗ 1 < ∗ elements of A2 ⊆ B, we have A2 ∩ (A1 − A1) ∅. Thus A2 ⊆ A . Since al ∈ A but al B1 ⊇ A2, the inclusion is proper. 

Now, we prove Lemma 22.

Proof of Lemma 22. Suppose that the lemma does not hold. Then there is a pair of a linear-semiorder P and an autonomous set A of P such that P | A is not a linear-semiorder. Among such pairs, we choose one with minimal |A|. = = = ∗ ∗ ∗ Lemma 29 implies P | A P1 | A1 P2 | A2 P2 | A2, but Lemma 30 implies |A2| < |A |≤|A|, contradicting the minimality of A. 

6. Miscellaneous We finally show two byproducts of Theorem 2. 25 u v x u v w x u v w x

(a) (b) (c)

u v w x u v w x

(d) (e)

Figure 12. Forbidden patterns in vertex orderings where u ≺ v ≺ w ≺ x. Lines and dashed lines denote edges and non-edges, respectively. Edges that may or may not be present is not drawn.

6.1. Vertex ordering characterization. Let G = (V, E)be a graph. A vertex ordering of G is a linear order on V. A vertex ordering characterization of a graph class C is a characterization of the following type: a graph G is in C if and only if G has a vertex ordering fulfilling some properties. For example, a graph G is the incomparability graph of an order if and only if there is a vertex ordering L of G such that for any three vertices u,v,w of G with u ≺ v ≺ w in L, if uw ∈ E then uv ∈ E or vw ∈ E [16]. Equivalently, a graph is the incomparability graph of an order if and only if it has a vertex ordering that contains no suborderings in Fig. 12(a). Incomparability graphs of linear-interval orders can be characterized so that a graph G is the incomparability graph of a linear-interval order if and only if there is a vertex ordering of G that contains no suborderings in Figs. 12(a)– (c) [25]. Moreover, a vertex ordering of G that contains no suborderings in Figs. 12(a)–(c) can be obtained in O(nm) time [26], where n and m are the number of vertices and edges of G, respectively. For linear-semiorders, the following can be obtained from Theorems 2 and 5. Corollary 31. A graph G is the incomparability graph of a linear-semiorder if and only if there is a vertex ordering of G that contains no suborderings in Figs. 12(a)–(e). A vertex ordering of a graph G that contains no suborderings in Figs. 12(a)–(e) can be computed in O(m2m¯ ) time if G is the incomparability graph of a linear-semiorder. Here, m and m¯ are the number of edges and non-edges of G, respectively.

Proof. Assume there is a linear-semiorder P on a set V such that the incomparability graph of P is G. Then P has a linear extension L fulfilling the 2 + 2 and 3 + 1 rules. Notice that L can be viewed as a vertex ordering of G. Since L is a linear extension of a partial order, it has no suborderings in Fig. 12(a). Since L has no forbidden configurations for 2 + 2, it has no suborderings in Figs. 12(b) and 12(c). Since L has no forbidden configurations for 3 + 1, it has no suborderings in Figs. 12(d) and 12(e). Conversely, assume there is a vertex ordering L of G = (V, E) with no suborderings in Figs. 12(a)–(e). Let P be a on V such that (u,v) ∈ P if and only if uv < E and u ≺ v in L for any two elements u,v ∈ V. Since L has no suborderings in Fig. 12(a), the relation P is transitive, and hence a partial order. Then L can be viewed as a linear extension of P. Since L has no suborderings in Figs. 12(b) and 12(c), it has no forbidden configurations for 2 + 2. Since L has no suborderings in Figs. 12(d) and 12(e), it has no forbidden configurations for 3 + 1. Therefore, Theorem 2 implies that P is a linear-semiorder. Since G is the incomparability graph of P, we have the first claim. Let G be the incomparability graph of a linear-semiorder. We can compute the vertex ordering of G by the following algorithm. First, take a complement G of G. Then, obtain a transitive orientation P of G. Finally, compute a linear extension L of P fulfilling the 2 + 2 and 3 + 1 rules. As mentioned above, L can be viewed as a vertex ordering of G with no suborderings in Figs. 12(a)–(e). Thus the algorithm is correct. The first step can be done in O(n2) time. The second and third steps can be done in O(nm) time and O(m2m¯ ) time, respectively, as shown in Proposition 1 and Theorem 5. Thus the algorithm takes O(m2m¯ ) time.  6.2. Linear-semiorders and interval orders. The class of linear-interval orders contains interval orders and orders of dimension 2 as proper subclasses [8]. The following example shows that the class of interval orders is not a subclass of linear-semiorders.

Example 32. The interval order PI in Fig. 13(a) is not a linear-semiorder. 26 a3 b5 a a a c 1 2 3 b4 2 b1 b2 b3 b4 b5

a2 b3 c2

c1 b2 c1

a1 b1 0 1 2 3 4 5 6 7 8 9 10111213 (a) (b)

Figure 13. (a) An interval order PI that is a minimal forbidden order of linear-semiorders. (b) An interval representation of PI .

Proof. Figure 13(b) shows an interval representation of PI . Suppose that PI is a linear-semiorder. Then Theorem 2 implies that PI has a linear extension L fulfilling the 3 + 1 rule. The order 3 + 1 consisting of b1, b2, b3, a1 requires that a1 ≺ b1 in L if and only if a1 ≺ b3 in L. The order 3 + 1 consisting of a1, a2, a3, b3 requires that a1 ≺ b3 in L if and only if a3 ≺ b3 in L. The order 3 + 1 consisting of b3, b4, b5, a3 requires that a3 ≺ b3 in L if and only if a3 ≺ b5 in L. Thus a1 ≺ b1 in L if and only if a3 ≺ b5 in L. The order 3 + 1 consisting of b1, b2, c2, a1 requires that a1 ≺ b1 in L if and only if a1 ≺ c2 in L. The order 3 + 1 consisting of a1, b4, b5, c2 requires that a1 ≺ c2 in L if and only if b5 ≺ c2 in L. The order 3 + 1 consisting of c1, b4, b5, c2 requires that b5 ≺ c2 in L if and only if c1 ≺ c2 in L. Thus a1 ≺ b1 in L if and only if c1 ≺ c2 in L. Similarly, the order 3 + 1 consisting of c1, b4, b5, a3 requires that a3 ≺ b5 in L if and only if a3 ≺ c1 in L. The order 3 + 1 consisting of b1, b2, a3, c1 requires that a3 ≺ c1 in L if and only if b1 ≺ c1 in L. The order 3 + 1 consisting of b1, b2, c2, c1 requires that b1 ≺ c1 in L if and only if c2 ≺ c1 in L. Thus a3 ≺ b5 in L if and only if c2 ≺ c1 in L, a contradiction. Therefore, PI has no linear extensions fulfilling the 3 + 1 rule, that is, PI is not a linear-semiorder. 

Note that one can check by inspection that every proper induced suborder of PI has a linear extension fulfilling the 3 + 1 rule. Since PI is an interval order, PI and every its induced suborder do not contain 2 + 2 as an induced suborder [11]. Hence every proper induced suborder of PI is a linear-semiorder, that is, PI is a minimal forbidden order of linear-semiorders. Corollary 33. The class of linear-semiorders is not a subclass of interval orders and vice versa; therefore, the class of linear-semiorders is a proper subclass of linear-interval orders. The class of linear-semiorders contains semiorders and orders of dimension 2 as proper subclasses. Proof. Example 32 shows an interval order (hence a linear-interval order) that is not a linear-semiorder. The order 2 + 2 is a linear-semiorder but is not an interval order. From definitions, every semiorder and order of dimension2 is a linear-semiorder. Thus the classes of semiorders and orders of dimension 2 are subclasses of linear-semiorders. Since the linear-semiorder in Fig. 1 is neither a semiorder (since it contains 2 + 2 as an induced suborder) nor an order of dimension 2 [28], the inclusion is proper. 

7. Concluding remarks In this paper, we introduce linear-semiorders and show a characterization and a polynomial-time recognition algo- rithm for this new order class. We also prove that being a linear-semiorder is a comparability invariant, showing that incomparability graphs of linear-semiorders can also be recognized in polynomial time. As byproducts, we show a vertex ordering characterization of incomparability graphs of linear-semiorders and inclusion relationships between the order classes. We finally list some open problems on linear-semiorders. – Our algorithm takes O(nm¯ ) time to recognize linear-semiorders and takes O(mm¯ 2) time to produce a linear extension fulfilling the 2 + 2 and 3 + 1 rules, where n, m,andm ¯ are the number of elements, comparable pairs, and incompara- ble pairs of the given order, respectively. Is there any faster or simpler algorithm for recognizing linear-semiorders? 27 – The class of linear-semiorders is closed under taking induced suborders. Hence the orders can be characterized by forbidden induced suborders. Can we obtain the list of forbidden induced suborders for linear-semiorders? – The isomorphism problem can be solved in linear time for interval graphs [17] and permutation graphs [7], whereas the complexity of the problem remains open for incomparability graphs of linear-interval orders [24,27,29]. For incomparability graphs of linear-semiorders, can we determine the complexity of the isomorphism problem? Acknowledgments. We are grateful to the anonymous referees of the preliminary version of this paper for their time and valuable suggestions. A part of this work was done while the author was in Kanagawa University.

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. [2] K. P. Bogart, J. D. Laison, and S. P. Ryan. Triangle, parallelogram, and trapezoid orders. Order, 27(2):163–175, 2010. [3] K. P. Bogart, R. H. M¨ohring, and S. P. Ryan. Proper and unit trapezoid orders and graphs. Order, 15(4):325–340, 1998. [4] K. P. Bogart and D. B. West. A short proof that ’proper = unit’. Discrete Math., 201(1-3):21–23, 1999. [5] A. Brandst¨adt, V. B. Le, and J. P. Spinrad. Graph Classes: A Survey. SIAM, Philadelphia, PA, USA, 1999. [6] M. R. Cerioli, F. de S. Oliveira, and J. L. Szwarcfiter. Linear-interval dimension and PI orders. Electron. Notes Discrete Math., 30:111–116, 2008. [7] C. J. Colbourn. On testing isomorphism of permutation graphs. Networks, 11(1):13–21, 1981. [8] D. G. Corneil and P. A. Kamula. Extensions of permutation and interval graphs. Congr. Numer., 58:267–275, 1987. [9] I. Dagan, M. C. Golumbic, and R. Y. Pinter. Trapezoid graphs and their coloring. Discrete Appl. Math., 21(1):35–46, 1988. [10] S. Felsner and R. H. M¨ohring. Note: Semi- two is a comparability invariant. Order, 15(4):385–390, 1998. [11] P. C. Fishburn. Intransitive indifference with unequal indifference intervals. J. Math. Psych., 7(1):144–149, 1970. [12] T. Gallai. Transitiv orientierbare graphen. Acta Math. Acad. Sci. Hungar., 18(1):25–66, 1967. [13] M. C. Golumbic. Algorithmic and Perfect Graphs, volume 57 of Ann. Discrete Math. Elsevier, 2 edition, 2004. [14] M. C. Golumbic, D. Rotem, and J. Urrutia. Comparability graphs and intersection graphs. Discrete Math., 43(1):37–46, 1983. [15] M. C. Golumbic and A. N. Trenk. Tolerance Graphs. Cambridge Univ. Press, 2004. [16] D. Kratsch and L. Stewart. Domination on cocomparability graphs. SIAM J. Discrete Math., 6(3):400–417, 1993. [17] G. S. Lueker and K. S. Booth. A linear time algorithm for deciding isomorphism. J. ACM, 26(2):183–195, 1979. [18] R. M. McConnell and J. P. Spinrad. and transitive orientation. Discrete Math., 201(1–3):189–241, 1999. [19] G. B. Mertzios. The recognition of simple-triangle graphs and of linear-interval orders is polynomial. SIAM J. Discrete Math., 29(3):1150– 1185, 2015. [20] G. B. Mertzios and D. G. Corneil. Vertex splitting and the recognition of trapezoid graphs. Discrete Appl. Math., 159(11):1131–1147, 2011. [21] S. P. Ryan. Trapezoid order classification. Order, 15(4):341–354, 1998. [22] D. Scott and P. Suppes. Foundational aspects of theories of measurement. J. Symb. Log., 23(2):113–128, 1958. [23] J. P. Spinrad. Efficient Graph Representations, volume 19 of Fields Institute Monographs. AMS, Providence, RI, USA, 2003. [24] A. Takaoka. Graph Isomorphism Completeness for Trapezoid Graphs. IEICE Trans. Fundamentals, E98–A(8):1838–1840, 2015. [25] A. Takaoka. A vertex ordering characterization of simple-triangle graphs. Discrete Math., 341(12):3281–3287, 2018. [26] A. Takaoka. A recognition algorithm for simple-triangle graphs. Discret. Appl. Math., 282:196–207, 2020. [27] A. Takaoka. Recognizing simple-triangle graphs by restricted 2-chain subgraph cover. Discret. Appl. Math., 279:154–167, 2020. [28] W. T. Trotter. Combinatorics and partially ordered sets: Dimension theory. 1992. [29] R. Uehara. The graph isomorphism problem on geometric graphs. Discrete Math. Theor. Comput. Sci., 16(2):87–96, 2014.

College of Information and Systems, Muroran Institute of Technology, Mizumoto 27-1, Muroran,Hokkaido, 050–8585, Japan Email address: [email protected]

28