We define an on-line (incremental) algorithm that, given a (possibly infinite) pseudo-transitive oriented graph, produces a transitive reorientation. This implies that a theorem of Ghouila-Houri is provable in and hence is computably true.
Let be an undirected graph, so that E is a set of unordered pairs of elements of V. We write to mean that .
An asymmetric and irreflexive relation → is an orientation of if for every we have if and only if or . An orientation → is transitive if for every such that and we have also . Graphs having a transitive orientation are also known as comparability graphs: in fact E is the comparability relation of the strict partial order →.
A characterization of comparability graphs was given by Alain Ghouila-Houri [7,8] (using a different terminology and dealing only with finite graphs) and reproved by Paul Gilmore and Alan Hoffman [9].1
An undirected graph has a transitive orientation if and only if every cycle of odd length has a triangular chord.
Here a cycle is a sequence of vertices such that and for every . (Notice that a vertex is allowed to occur more than once in a cycle.) The cycle has odd length if k is odd. The cycle has a triangular chord if either or for some .
In Fig. 1 the left graph has a cycle of length nine with no triangular chord, while the right one has no cycles of odd length without triangular chords.
The forward direction of Theorem 1.1 is easily proved. The backward direction was proved directly by Gilmore and Hoffman, while the original proof by Ghouila-Houri uses an intermediate step. The latter approach is also taken in several expositions of the theorem ([2, Theorem 16.8], [5, Theorem 1.7], [11, Theorem 11.2.5]) and hinges on the following notion.
An orientation → is pseudo-transitive if for every such that and we have also either or .
Ghouila-Houri proves the backward direction of Theorem 1.1 by first showing that if every cycle of odd length has a triangular chord then there exists a pseudo-transitive orientation, and then that any pseudo-transitive orientation can be further reoriented to obtain a transitive one.
A graph which is not a comparability graph, to the left, and a comparability graph, to the right.
The effectiveness of Theorem 1.1 has already been studied, in particular using the framework of reverse mathematics ([14] is the basic reference in this area), by Jeff Hirst in his PhD thesis [12, Theorem 3.20]. Hirst indeed showed that a compactness argument (disguised as an application of Zorn’s lemma in [9] and of Rado’s theorem in [5,11]) is necessary for countable graphs and hence the theorem is not computably true. The following lemma includes Hirst’s theorem and provides a direct proof for it.
The following are equivalent over the base system:
;
every countable graph such that every cycle of odd length has a triangular chord has a transitive orientation;
every countable graph such that every cycle of odd length has a triangular chord has a pseudo-transitive orientation.
(2) follows from (1) by a straightforward compactness argument, once the result is proved for finite graphs. The latter can be done in , following any of the proofs mentioned above.
The implication from (2) to (3) is trivial.
To check that (3) implies (1) we use [14, Lemma IV.4.4] stating that is equivalent to the statement that if are injective functions such that , then there exists X such that . Fix f and g as above, and define a graph as follows: and E is defined by the following clauses for each n and m:
Every cycle of odd length has a triangular chord because every connected component of is isomorphic to a subgraph of the right graph in Fig. 1. Let → be a pseudo-transitive orientation of E. It is easy to check that the set
contains the range of f and is disjoint from the range of g. □
The proof of Lemma 1.2 yields the following results in the framework of computability theory and of the Weihrauch lattice (see [3] for an introduction to this research program).
There exists a computable graph such that every cycle of odd length has a triangular chord which has no computable pseudo-transitive orientation.
Every computable graph such that every cycle of odd length has a triangular chord has a low transitive orientation.
Consider the multi-valued functions that map every countable graph such that every cycle of odd length has a triangular chord to the set of its transitive (resp. pseudo-transitive) orientations. Each of these two multi-valued functions is Weihrauch equivalent to choice on Cantor space.
Starting with [9] there has been an interest in algorithms providing transitive orientations for finite comparability graphs. For example, the influential textbook [10] devotes a whole chapter to algorithmic aspects of comparability graphs, including complexity issues. However, the first part of Lemma 1.3 shows that there is no algorithm to (pseudo-)transitively orient countable computability graphs. In particular, an algorithm which computes a (pseudo-)transitive orientation of finite comparability graphs cannot work in an incremental way (i.e. extending the previous orientation as new vertices are added to the graph), and thus is not on-line. Here we understand the notion of on-line algorithm as defined in [1], which is a recent survey of the theoretical study of on-line algorithms for computable structures.
Lemmas 1.2, 1.3, and 1.4 provide an analysis of the first step in Ghouila-Houri’s proof of Theorem 1.1. Our main interest is the analysis of the complexity of the second step of this proof, which is best stated using oriented graphs, i.e. directed graphs such that at most one of the edges between two vertices exist. In this paper we abbreviate ‘oriented graph’ as ograph. The notions of pseudo-transitivity and transitivity are readily extended to ographs, and a reorientation of an ograph is an ograph obtained by reversing some of the edges. Then the second step of Ghouila-Houri’s proof is the following result.
Every pseudo-transitive ograph has a transitive reorientation.
This is the main lemma in [7], the lemma on page 329 in [8], Theorem 16.7 in [2], Theorem 1.5 in [5], and Theorem 11.2.2 in [11]. Ghouila-Houri’s proof deals only with finite graphs and uses induction on the number of vertices. The same proof is presented in [2,5,11] and extended to the infinite case by some compactness argument. From this proof it is easy to extract an algorithm to transitively reorient finite pseudo-transitive ographs. However, the induction step requires, in a nutshell, partitioning the set of vertices into two subsets with specific properties, to reorient each of the induced subographs by induction hypothesis, and then to set the reorientation between them. Thus this algorithm is not incremental and does not apply to infinite ographs.
This analysis led us to conjecture that we could obtain results similar to Lemmas 1.2, 1.3 and 1.4 for Theorem 1.5. We were actually wrong and this is the main result of this paper. We state this result in various different ways (the first three items of the theorem correspond to the approaches of Lemmas 1.2, 1.3 and 1.4, respectively).
proves that every countable pseudo-transitive ograph has a transitive reorientation;
every computable pseudo-transitive ograph has a computable transitive reorientation;
the multi-valued function that maps a countable pseudo-transitive ograph to the set of its transitive reorientations is computable;
there exists an on-line (incremental) algorithm to transitively reorient pseudo-transitive ographs;
Player II has a winning strategy for the following game: starting from the empty graph, at stepplayer I plays a pseudo-transitive extensionof the pseudo-transitive ographhe played at step s. Player II replies with a transitive reorientationofsuch thatextendsshe defined at step s. Player II wins if and only if she is always able to play.
We concentrate on proving (4) of the Main Theorem, as this easily implies (1), (2) and (3), while (5) is just a restatement in a different language of (4) for countable ographs.
We now make precise what we mean by an on-line (incremental) algorithm. We assume the input to consist of vertices coming one at a time together with all information about the edges connecting them to previous vertices. (So at step s the size of the input increases of at most s.) When the algorithm sees a new vertex, it must reorient all the edges connecting it to previous vertices while preserving the reorientations already set at previous stages.
We deal explicitly only with countable ographs; however it is easily seen that our algorithm applies to ographs of any cardinality, as long as the set of vertices can be well-ordered.
An upper bound for the complexity of the algorithm we define (when applied to finite pseudo-transitive ographs) is . The problem of orienting comparability graphs can be solved by an algorithm with complexity , where δ is the maximum degree of a vertex ([10, Theorem 5.33]), and further fine-tuning has been subsequently made.
We now describe the organization of the paper. Section 2 contains the preliminary definitions and a presentation of two pseudo-transitive ographs with transitive reorientations which are the main obstacles in designing the algorithm. Sections 3 and 4 analyze in detail these two configurations. In Section 5 we present the on-line algorithm and prove its correctness. We also sketch the ideas needed to obtain the upper bound for the complexity mentioned above.
Preliminaries
In the introduction we have already introduced our terminology and we now give the formal definitions of the central notions.
An ograph is transitive if for each , if , then . is pseudo-transitive if for each , if , then or .
A relation R on V is a reorientation of →, if for each , if then either or and if then either or .
A transitive reorientation of is a reorientation of which is also transitive. In this case we often use ≺ in place of R.
A triple is a Ghouila-Houri triple (GH-triple for short) if is a pseudo-transitive ograph and ≺ a transitive reorientation of →.
Notice that each reorientation R of preserves both →-comparability and →-incomparability. In other words, the undirected graphs associated with and with coincide.
Let be an ograph and .
means that either or ;
is the neighborhood of a;
means that neither nor ;
when we write ‘ by ’ we mean that we know that → is pseudo-transitive and we are deducing because we have either or .
Let be an ograph. If we say that is an extension of if is an ograph such that for every we have if and only if .
An on-line algorithm computing a transitive reorientation of a pseudo-transitive ograph must produce at each step a reorientation which can further be extended, in the sense made precise by the following definition.
A GH-triple is extendible if for every , pseudo-transitive extension of , there exists which extends ≺ and is such that is a GH-triple.
Some simple cases of GH-triples which are not extendible are depicted in Figs 2 and 3.
In Fig. 2 we have the transitive triangle examples: → is transitive on and the transitive reorientation is defined by . Notice that in the left ograph we have , while in the right one we have : in both cases all edges involving the vertex c have the same direction. We can add a vertex x connected to c by an edge going in the same direction and connected with neither a nor b. Then is pseudo-transitive and if is a reorientation of extending ≺ we must have either or : both choices lead to the failure of transitivity of .
In Fig. 3 we have the example: there are two edges and (with no other edges between these four vertices) and the transitive reorientation defined by and . In the left ograph we add a vertex x such that , , and . Then is pseudo-transitive. Suppose were a transitive reorientation of extending ≺: since and , then implies ; since and , then implies . But is not compatible with . The situation in the right ograph is the same as the previous one as far as the first four vertices are concerned, but the new vertex x is now such that , , and . We can argue analogously to show that is a pseudo-transitive ograph with no transitive reorientation extending ≺.
The transitive triangle examples.
The example.
We eventually show that the examples above are the only obstructions to extendibility of a GH-triple. To do this we analyze in detail Examples 2.5 and 2.6 using the following notions.
Let be a GH-triple. If is a pseudo-transitive extension of define
(Here is the neighborhood of x in .)
Under the hypothesis of the previous definition we have that if , and , then . In fact, since there is with . If , then against . Thus .
Similarly, if , , and , then .
The next lemma states some properties of extendible GH-triples.
If we write to mean that for every and .
Letbe an extendible GH-triple. Then for anypseudo-transitive extension ofwe have:
;
.
If condition (1) does not hold for some pseudo-transitive extension , then there exist and such that . This impedes both and for any transitive reorientation of with . (Notice that we found in a copy of one of the transitive triangle examples.)
If condition (2) does not hold for some pseudo-transitive extension , then there exist and such that . Since there exists c such that and . Since , there exists d such that and . If were a transitive reorientation of with then these conditions imply respectively and ; it would follow , contrary to . (Notice that in this case we found in a copy of the example.) □
Avoiding the transitive triangle examples
This section is devoted to a careful study of the first condition of Lemma 2.9. The next lemma shows that this condition captures precisely the lack of the transitive triangle examples. Recall that in that situation is a GH-triple. Moreover, there exist such that and the new vertex x is connected with c, but not with a and b. Notice that this might happen only if a, b, c form a transitive triangle and either or .
Letbe a GH-triple andbe a pseudo-transitive extension of, thenis equivalent to.
Notice that means that there exist a and b such that and . From this observation the equivalence is immediate. □
Lemma 3.1 involves all possible pseudo-transitive extensions of by one vertex. It is convenient to have a characterization of the GH-triples such that for every pseudo-transitive extension, which involves only the GH-triple itself. To this end we introduce two formulas, Φ and Ψ. In order to do this, we define formulas and which do not mention the reorientation ≺. Notice that Lemmas 2.9 and 3.1 imply that the non extendibility of ≺ may be caused by only three vertices. With this in mind, it is not hard to understand the rationale for , , Φ, and Ψ.
Let be a GH-triple. Let assert the existence of such that:
;
;
.
Then Φ is
Symmetrically, let assert the existence of such that:
;
;
.
Then Ψ is
Notice that the only difference between φ and ψ occurs in conditions () and (), where the direction of the edge is reversed. Φ and Ψ further differ in applying to triples such that and respectively.
Let be a GH-triple. Fix . If witness (or ) then they witness (resp. ) as well.
The following duality principle is useful to avoid checking Φ and Ψ separately.
Using Remark 3.3 it follows immediately that satisfies Φ if and only if (i.e. the ograph and the reorientation where all edges are reversed) satisfies Ψ.
We start with some properties concerning basic facts about φ and ψ.
Let be a pseudo-transitive ograph. Suppose that and is witnessed by . Then there exists such that witness for each such that and .
The same holds starting from and , and concluding that witness .
Suppose we are in the first case, i.e. and witness . Let be largest such that , and notice that witness as well.
We claim that for all i such that . The claim is proved by a ‘backward’ induction. We obtain by () and or . Hence by our assumption (unless ). Suppose now that . If , then by . Otherwise, by () and so by . Hence, if we have .
Let now d be such that and . In particular we have . Notice that to check that witness conditions () and () are identical to conditions () and () of , since they concern only the vertices a and b. We are left to prove that condition () is satisfied, namely that . Since and it suffices to show that .
To this end we prove that indeed we have for all i such that , again by a ‘backward’ induction. Since and either or by (), we have by either or . Now, assuming and so that , we must have because by the choice of k. If condition () of implies and hence by . If , then by , since .
If and witness the argument is similar with obvious changes. □
Let be a pseudo-transitive ograph and let . Suppose , and . Then for each .
The proof is by induction on i. The base case holds by assumption, so assume for . If , then because . Thus and by . If the argument is symmetric inverting the arrows. □
We can now show that Φ and Ψ are sufficient for the first condition of Lemma 2.9.
Letbe a GH-triple. If Φ and Ψ are satisfied, then for eachpseudo-transitive extension ofwe have.
Fix . By Lemma 3.1 it suffices to show that for any such that and either or .
If then implies , while implies . If the situation is similar.
If then Φ implies that holds. Let witness . Assume . If , then both and follow immediately by . Otherwise we have , and suppose towards a contradiction that and . Notice that implies . Hence by condition () and Property 3.6 it holds that . In particular we have , and then one of and by follows by ().
If we argue similarly, using Ψ. □
We now prove that Φ and Ψ are necessary conditions for .
Letbe a GH-triple such that one of Φ and Ψ fails. Then there is a pseudo-transitive extensionofsuch thatand henceis not extendible by Lemma
2.9
.
We assume the failure of Φ: if Ψ fails the argument is symmetric.
Let be such that , and . We fix and define an extension of to in stages, as an increasing union . For each stage n, is defined as follows:
extends → by adding the single edge ;
extends by adding edges
Notice that but and and hence but . Therefore to complete the proof it suffices to check the pseudo-transitivity of . We first make a couple of preliminary observations.
For allsuch that there existssatisfying eitherorwe have.
Let us first suppose that holds. By definition of (or by hypothesis when ) it holds that . Hence by . If the argument is similar. □
Ifis such thatandthen.
Let us suppose that and , so that does not hold. The definition of implies that for some v we have either or . Since the only v such that is c and we must have the first possibility with , so that holds. □
In order to show that is pseudo-transitive, we have to consider the following three cases for :
. Then because by definition of ;
. Then Claim 3.8.1 guarantees that . Let n be the least stage such that . If or , then by definition of . Thus we assume that either or . Since n is the minimum stage such that , there exists such that and . Notice that does not hold, otherwise we would have . Analogously, there must be an such that and . For each step , we can repeat this search of witnessing that . After steps we get to and, since does not hold, . This means, by Claim 3.8.2, that . Let j be maximum such that and set and . We claim that witness . To this end we need to check the three clauses in the definition of :
by hypothesis.
Fix : holds by our choice of the sequence of the ’s and we have either or by definition of . Moreover, if , then , by definition of , and , by choice of . If the argument is similar.
or by hypothesis.
. This is similar to the previous case.
□
Summarizing the results obtained in Lemma 3.7 and Lemma 3.8 we obtain:
Letbe a GH-triple. The following are equivalent:
for each pseudo-transitive extensionof, it holds that;
Φ and Ψ are satisfied.
Avoiding the example
This section is devoted to study more carefully the second condition of Lemma 2.9. The next lemma shows that, assuming that , this condition captures precisely the lack of the example. Recall that in that example is a GH-triple and there exist such that , , , , , and . Then, a new vertex x is connected with a and b but not with c and d, or vice versa. Notice that this is possible only if either and , or and .
Letbe a GH-triple anda pseudo-transitive extension of. We use Λ to denote the following property ofand ≺:Then:
if Λ holds then;
ifandthen Λ holds.
Assume , i.e. there exist and such that . Since there is with . Since there is with . If , then but this is impossible since and . Since we are assuming we have .
We claim that also holds. Since , but , then either or . The argument for the two cases is similar, so let us assume that . This implies and because and . Hence if , then by . Since and , it must be but this contradicts . If , then by . Since and , it must be which contradicts . We have thus shown that as claimed.
Now a, b, c and d witness the failure of Λ.
Assume that witness the failure of Λ. Then , and . If holds then and , showing that fails. □
Notice that the first four conjuncts of the antecedent of the implication appearing in Λ imply that a, b, c and d form a because and follow from these. In fact, if , then and imply that , but then contrary to the assumption. A similar argument shows that .
We now define two formulas Θ and Σ characterizing the reorientations such that the condition Λ of Lemma 4.1 is satisfied whenever . As for Φ and Ψ, the main feature of Θ and Σ is that they mention only and ≺. In order to define Θ and Σ it is necessary to define and (which do not mention ≺).
Let be a GH-triple. Let assert the existence of such that:
;
;
;
.
Then Θ is
Symmetrically, let assert the existence of such that:
;
;
;
.
Then Σ is
Suppose is the pseudo-transitive graph whose only edges are , and . Then and hold with and . Thus a such as the one obtained restricting → to can satisfy θ and σ simply because one of its edges belongs to a non transitive triangle. See the first paragraph of the proof of lemma 5.12 below for more on this.
Let be a GH-triple. Suppose witness for some . Clearly, if there is an such that , then witness as well. Thus we can assume that for every with we have whenever . Under this assumption it actually holds that holds for every with . In fact, by and if , then by .
Before proving the usefulness of Θ and Σ, we would like to comment on their mutual relationship and on the difference between the connection between Θ and Σ and the connection between Φ and Ψ. Let be a GH-triple and suppose satisfy the antecedent of Θ and Σ (which is the same). Consider a pseudo-transitive extension such that and . The two extensions correspond respectively to the left and right ograph of Fig. 2. As explained at the beginning of this section, if either x is incomparable with both c and d or if y is incomparable with both a and b, then is not extendible. We emphasize that under these hypotheses we could have both x and y witnessing the non extendibility of . To compare this situation with the one Φ and Ψ take care of, suppose and add x and y such that and . Since and cannot occur simultaneously, only one of x and y can witness (if , resp. , fails) the non extendibility of .
Despite the previous considerations the next lemma shows that x witnesses the non extendibility of if and only if y does.
Letbe a pseudo-transitive ograph and supposeare such that,,and. Thenholds if and only ifdoes.
Therefore, ifis a GH-triple then Θ holds if and only if Σ does.
Since the antecedents of Σ and Θ coincide and imply the hypothesis of the first statement, it is clear that the second statement follows from the first.
For the forward direction of the first statement, let witness . By Remark 4.5 we can assume that whenever . We claim that witness . In fact, conditions () and () of are exactly conditions () and () of . Condition () of is now and follows easily from our assumption on the ’s and from condition () of . We are left with showing condition () of , i.e. . Suppose on the contrary that . Since , by Property 3.6 it follows that . In particular, and so because by () of . But then by , contrary to the assumptions.
The proof of the backward direction is analogous. □
Thanks to the previous lemma it suffices to concentrate on Θ.
The following duality principle is analogous to Remark 3.4. It is not needed elsewhere and we include it here for completeness without proof.
Notice that the GH-triple satisfies Θ if and only if the GH-triple satisfies Θ.
Letbe a GH-triple. Letbe such that,,, andand assume thatholds. Then for eachpseudo-transitive extension ofifholds we have, and ifholds we have.
Let be a pseudo-transitive extension of with . Notice that, since , either or . In the first case and guarantee that , so we concentrate on the other case.
Suppose that and let witness . Towards a contradiction, assume . Notice that by (we use condition ()). Hence by condition () and Property 3.6 it holds that , so that in particular . It cannot hold that , otherwise by contrary to (). Hence holds. Moreover, by condition () and so implies .
A similar argument shows that implies . The only change is due to the fact that when then we use , which holds by Lemma 4.6. □
We can now show that Θ is sufficient for the second condition of Lemma 2.9.
Letbe a GH-triple satisfying Θ. For eachpseudo-transitive extension ofwe have.
By Lemma 4.1.1 it suffices to prove condition Λ. Fix such that , , , and and assume that . We need to prove that either or .
Since and there are four possible situations. If and , but , then and follows by . If and the argument is similar. If instead and notice that Θ implies or : then Lemma 4.8 yields the conclusion. The last possibility is and , where we use the second part of Lemma 4.8 (in this case a, b, c, d play roles which are opposite to those of the Lemma). □
We now prove that Θ is necessary for if Φ and Ψ hold.
Letbe a GH-triple such that Φ and Ψ hold and Θ fails. Then there is a pseudo-transitive extensionofsuch thatand henceis not extendible by Lemma
2.9
.
Let be such that , , , , , and . We fix and define an extension of to in stages, as an increasing union . For each stage n, is defined as follows:
extends → by adding the edges e ;
extends by adding edges
Notice that and are incompatible, since if or then we have neither nor .
If we assume that is pseudo-transitive we can complete the proof as follows. Since Φ and Ψ hold, by Lemma 3.7 we have . On the other hand, by definition of , but and (because and hence we never set or ) and condition Λ fails. Thus, by Lemma 4.1.2, .
Therefore to complete the proof it suffices to check the pseudo-transitivity of . We first make a few preliminary observations.
Ifis such thatthen eitheror. Similarly, ifis such thatthen eitheror.
Let n be least such that . If then v is either a or b, which satisfy the conclusion. If then or is required by definition. When dealing with u, the case cannot hold. □
Let us assume that forwe have eitheror. Then ifandwe have alsoand, and similarly ifandwe have alsoand.
Assume and . If , then or by Claim 4.10.1. If , then by , contrary to the assumption. So , while cannot hold because . Thus we have and . If the argument is similar.
The second statement is proved analogously. □
Let us suppose that , and , so that does not hold. The definition of implies that for some v we have either or . Since the only v’s such that are a and b, and and , we must have the second possibility with v either a or b. □
In order to prove that is pseudo-transitive, there are some cases to consider.
. By Claim 4.10.1 either or and also or . If either or , then follows by or of →.
We now concentrate on the case and , the other being similar. Notice that implies that and do not hold. Moreover, we can assume that and both fail, else we are in one of the previous cases. Hence and . If n is the minimum stage such that (notice that cannot happen), there exists such that or . Analogously, there must be an such that or . Iterating this procedure, we get to . Set also . Similarly, let k be least such that (in this case is possible) and set . If , with a procedure similar to the one used before, we find such that witnesses that for each .
Notice that a backward induction using Claim 4.10.2 easily entails both and . Notice also that for each either or holds. In fact, if , then by definition and so by choice of . If the argument is similar. Arguing as in the previous lines it is easy to show that for each either or holds as well.
Let be least such that . We claim that satisfy the first three conditions of :
by Claim 4.10.3 because implies by , which contradicts the above observation;
: this is immediate by the minimality of i and the observation in the previous paragraph;
by choice of i;
Since fails, condition () must fail, i.e. we have .
Since we can apply Property 3.6 to obtain that for every with . Recalling that , we obtained : then because .
We show that for every . Arguing as in the proof of () above, we have so that by . Thus, since , we can apply Property 3.6 again to obtain the desired conclusion. Recalling that we have obtained .
then or by Claim 4.10.1. By , either or and u satisfies one of the conditions in the definition of . Thus .
is similar to the previous item.
This shows that is pseudo-transitive and hence that is not extendible. □
Summarizing, we obtained a characterization of the conditions of Lemma 2.9.
Letbe a GH-triple. The following are equivalent:
for each pseudo-transitive extensionofwe have bothand;
Φ, Ψ and Θ are satisfied.
The implication (1) ⇒ (2) follows from Lemmas 3.8 and 4.10. The implication (2) ⇒ (1) follows from Lemmas 3.7 and 4.9. □
Thanks to Theorem 4.11 we can now reformulate Lemma 2.9 in a way that does not refer to all possible pseudo-transitive extensions of but mentions only structural properties of and ≺.
Letbe an extendible GH-triple. Then Φ, Ψ and Θ are satisfied.
It follows from Lemma 5.13 below that the reverse implication holds as well, namely that Φ, Ψ and Θ are also sufficient conditions of the extendibility of a GH-triple.
The smart extension algorithm
In this section we define an on-line algorithm to transitively reorient a countable pseudo-transitive ograph. Before defining the algorithm we give some preliminary definitions.
Let be a GH-triple. If is a pseudo-transitive extension of →, we define inductively the following subsets of :
Let , and . Let also .
If we say that a sequence of elements of V is a ∗-sequence if for every and for every .
If then and are both included in . Moreover for every (because if and then ).
Notice that if then there exists a ∗-sequence ρ such that .
For the remainder of the section we use as a shorthand for either or . is used similarly and always denotes an element of . We now prove some properties of and its subsets.
Let be a GH-triple. Let be a pseudo-transitive extension of →.
Fix and . If ρ is a ∗-sequence such that then we have either or .
and .
If is a ∗-sequence for , and witness for some , then there exists such that witness , for each k and j. Moreover, . The same statement holds with ψ in place of φ.
(1) is obvious by pseudo-transitivity of .
To prove (2) we fix and prove by induction on i that for every i. For the base of the induction, follows from (Remark 5.2), and . For the induction step let and choose such that . By induction hypothesis and hence, since (again by Remark 5.2), we have . This shows . Analogously we prove .
To prove (3) fix , , f, satisfying the hypothesis. Let be the length of for . We write in place of . Since and , (1) implies that for each .
Applying Property 3.5 to we obtain that there exists such that witness . For the sake of convenience assume , so that witness as well.
Fix . We claim that . The proof is by double induction.2
Since we are dealing with formulas where all quantifiers are bounded, this can be done within .
Suppose for each . We prove by induction on i that . For the base case, by since and by () of . For the induction step suppose . If , then by (1) (that applies because ). Then by . Hence by . If , the argument is analogous.
Let and . We check that the three conditions of are satisfied. Condition () holds trivially since it coincides with () of . To check that () holds suppose . Then by (1) and thus by () of . By (1) again it holds that holds as well. An analogous argument shows that if , then . These establish that () of holds. Condition () is checked in a similar way. □
Notice that Property 5.3.2 implies whenever . To see that this holds in general we need to strengthen the hypothesis on the reorientation of .
Letbe a GH-triple such that Ψ, Φ and Θ are satisfied. Letbe a pseudo-transitive extension of →. Thenand hence.
Let . We first claim that for every , which is obviously necessary for . Since , there are four possibilities.
If or , then by we have .
Otherwise, or . Suppose the former holds. For choose a ∗-sequence such that . Recall that, by definition of ∗-sequence, for each and for each .
Since , Property 5.3.1 implies that . Since , there exists f such that and . Analogously, there exists e such that and . Given that and , then and . Moreover, since by Theorem 4.11, it holds or . Suppose the latter, the other case being similar using e in place of f. We have by , and thus since and . Since , then . Summarizing, we have just shown that and . Since we are assuming Φ holds, there are witnessing . Applying Property 5.3.3 we obtain that there exists an such that witness for each and . In particular is satisfied and so either or holds. In both cases, by , as we wanted to show.
If instead the argument is similar, reversing all arrows and using Ψ.
We have thus established our claim that for every . Now we prove by induction on i that for every i. For the base of the induction, for every because , and . For the induction step let and choose such that . By induction hypothesis and hence, since , we have . □
These relations between subsets of explain the choices for the reorientation of made in the following definition.
Let be a GH-triple satisfying Φ, Ψ and Θ and such that . Let be a pseudo-transitive extension of →.
We define , the smart extension of ≺ to, as the binary relation that extends ≺ to by establishing the relationship between x and each recursively as follows:
if let and ;
if then
if let ,
if let ;
if then
if there exists such that let ,
if there exists such that let ,
otherwise let if and if .
Notice that depends on the order < on , is always a reorientation of , and extends ≺.
For a visual understanding of see Fig. 4. Here we denote by , resp. , the subset of consisting of the vertices which are below, resp. above, x. Moreover the picture shows that and : we leave to the reader to prove these relations, since we do not need them. The picture may suggest that has width two, but this is not the case because there may be nontrivial antichains within some and/or .
A smart extension.
The hypothesis that satisfies Φ, Ψ and Θ makes sure that Conditions (2a) and (2b) of Definition 5.5 are mutually exclusive, by Lemma 5.4. Some of the clauses of Definition 5.5 are necessary for to be a transitive reorientation of . Condition (1) is obviously necessary for to be a reorientation. The choice made by Condition (2a) is explained by an inductive argument: is required because , and if then the members of (each incomparable with some element of ) cannot lie above x. The same argument applies to and justifies Condition (2b). Conditions (3a) and (3b) are clearly necessary for transitivity. Condition (3c) is applied when the relationship between x and is not decided by the previous conditions and in this case simply preserves the direction of .
From a complexity point of view, defining the sets and requires more resources than setting the relation between x and according to Definition 5.5. The sets and are computed in at most steps, since one needs to consider each and for each such v to go through each . The remaining members of and can be found by a depth-first search algorithm applied to the non-adjacency graph (the complexity of depth-first search algorithm is , see [4, Section 22.3]). To this end notice that for each there exists a sequence3
Such sequences may not be +-sequences, because it may be the case that , for some due to the incomparability chain caused by some other element of .
, for some , such that and , for each . Then each . The same obviously applies also to .
Therefore an upper bound for the complexity of the smart extension is .
Let be a pseudo-transitive ograph with V an initial interval of . The relation ≺ is the smart reorientation of → if it at each step s the reorientation is obtained as the smart extension of .
Notice that the smart reorientation of is the reversal of the smart reorientation of .
Theorem 5.14 proves that the smart reorientation algorithm is correct. To obtain this result we prove some properties of smart reorientations. In particular we introduce the notion of ‘lazy reorientation’ in Definition 5.9. The intuitive idea behind it is the following one: an edge is reversed only when this is really needed to obtain a transitive reorientation, because and the edges and are not reversed.
Let be a GH-triple with . Let be a pseudo-transitive extension of →. Let be the smart extension of ≺.
If because we applied condition (3a) with witness b then . Moreover we can choose b so that .
Similarly, if because we applied condition (3b) with witness b then and we can assume .
Let and b with be such that . Since then . But by Property 5.3.2 and hence . Let b be least (as a natural number) such that . If , then we used condition (3a) when dealing with b and so there exists such that , contrary to the minimality of b. Hence, .
The proof of the second statement is analogous. □
Let be a pseudo-transitive ograph. The reorientation ≺ of → is a lazy reorientation if it satisfies the following property: for each such that and there exists such that (i.e. is a non transitive triangle), , and .
is a lazy triple if is a pseudo-transitive ograph and the reorientation ≺ of → is a lazy reorientation.
Notice that a lazy triple is not necessarily a GH-triple, because we are not requiring ≺ to be transitive.
is a lazy triple if only if is a lazy triple, where is the reverse ograph of .
Let be a pseudo-transitive ograph with and let ≺ be the smart reorientation of . Assume that ≺ is transitive, so that is a GH-triple. Then ≺ is lazy, i.e. is a lazy triple.
The proof of the laziness condition for every is by induction on the lexicographic order of the pair of natural numbers . Suppose and and assume that for each and such that , and either or and there exists such that , , and .
By remark 5.7 we can assume without loss of generality that . According to Definition 5.5 either or .
If let i be such that . We first show that is impossible. If with let ρ be a +-sequence of length at least 2 such that . By Property 5.3.1 we have . Since , there exists such that and . Then and . Since there exists , , . Thus . As we can apply the induction hypothesis and there exists c such that and . We have by , and hence because . But now by , and hence since . Using again we have , a contradiction with as .
Thus and . In particular there exists , , and so . As we can apply the induction hypothesis and there exists such that and . We have by , and hence because . Hence , (because ≺ is transitive and ), and , as required.
If we applied condition (3b) of Definition 5.5 to set . Hence, by Property 5.8 there exists c such that , and . We can assume that c is least (as a natural number) with these properties. If we have our conclusion. We now rule out the possibility that . If this was the case, by induction hypothesis (as ) there exists such that and . By transitivity of ≺ we have and . If then violates the minimality of c. If then by induction hypothesis (as and ) there exists such that and . But then , (by transitivity of ≺) and contradict the minimality of c. □
Letbe a GH-triple which is also a lazy triple and such that. Then Φ, Ψ and Θ are satisfied.
Thanks to laziness checking that Θ holds is straightforward. In fact, suppose , , and for some . Since but , there exists an such that . It is immediate to check that witnesses .4
Notice that laziness implies a strong form of Θ, in fact the sequence witnessing the formulas have always length one.
To check that Φ holds let be such that and . Since , and ≺ is lazy, there exists such that , and . By transitivity of ≺ it follows that and thus , since ≺ is a reorientation. If , it is immediate to check that witnesses .
Otherwise and, since , by laziness there exists such that , and . Notice that even if and it must be because by construction. By transitivity we get that and so either or . If the former holds then , witness .
We have now to analyze the case when . Since by laziness there exists such that , and . By transitivity it holds that . If , it is easy to check that , , witness . Otherwise and we can apply laziness again to obtain .
This procedure provides a <-decreasing sequence such that when i is even, and when i is odd. The sequence stops with such that . We claim that witness . In fact () is guaranteed by . Moreover, for each either or by assumption. If the former is the case then , while if the latter holds by construction. These two facts guarantee that () is satisfied as well. The vertex satisfies condition () by construction.
It is now easy to check that Ψ is satisfied as well applying the duality principle of Remark 3.4. Consider the graph and the transitive reorientation ≻. Remark 5.10 guarantees that ≻ is lazy as well. Hence, Φ holds by what we have just shown. Then, by Remark 3.4, Ψ holds in and ≺. □
Letbe a GH-triple such that. Assume Φ, Ψ and Θ are satisfied. Letbe a pseudo-transitive extension of. Then the smart extensiontois transitive.
To check that ≺ is transitive, we have to consider the following cases, where :
. Obviously and, if then while if then . We consider four possibilities:
: if or , then by pseudo-transitivity. So we are left to check that . Suppose . Then, according to the definition of , if , then entails , while if , then entails .
Otherwise, or . Suppose the latter holds, the former being similar. Since , but by assumption, there is, by Property 5.8, such that , and . Notice that by . We claim that . Suppose . If , then, since , then by definition, contrary to the assumption. Otherwise, ; then, since , then , contrary to the assumption. Thus it must be and so because ≺ is transitive by hypothesis.
. Since we have and thus . If , Property 5.3.2 or Lemma 5.4 imply , and thus .
If instead then by Property 5.3.2. If then implies . If then would imply ; hence holds also in this case.
. The argument is similar to the previous case.
□
The following theorem proves that Definition 5.5 provides an algorithm to transitively reorient pseudo-transitive graphs.
Letbe a pseudo-transitive ograph with V an initial interval ofand let ≺ be the smart reorientation of. Then ≺ is transitive.
For each , let be the restriction of ≺ to . Notice that is the smart reorientation of the restriction of → to . To prove that ≺ is transitive it is enough to check that is transitive for each s. We do so by induction on s. For the base case there is nothing to check. Suppose is transitive. Then by Property 5.11 is lazy. Moreover, by Lemma 5.12 Φ, Ψ and Θ are satisfied. Hence, by Lemma 5.13 the smart extension is transitive. □
Footnotes
Acknowledgements
We thank Nicola Gigante and Paul Shafer for useful discussions about the topic of the paper.
Both author’s research was partially supported by the departmental PRID funding “HiWei – The higher levels of the Weihrauch hierarchy”.
References
1.
N.Bazhenov, R.Downey, I.Kalimullin and A.Melnikov, Foundations of online structure theory, The Bulletin of Symbolic Logic25(2) (2019), 141–181. doi:10.1017/bsl.2019.20.
2.
C.Berge, Graphs and Hypergraphs, 2nd edn, North-Holland, Amsterdam, 1976.
3.
V.Brattka, G.Gherardi and A.Pauly, Weihrauch complexity in computable analysis, in: Handbook of Computability and Complexity in Analysis, V.Brattka and P.Hertling, eds, Springer, New York, 2021, In press.
4.
T.H.Cormen, C.E.Leiserson, R.L.Rivest and C.Stein, Introduction to Algorithms, 3rd edn, MIT Press, Massachusetts, 2009.
5.
P.C.Fishburn, Interval Orders and Interval Graphs, Wiley, New York, 1985.
6.
T.Gallai, Transitiv orientierbare Graphen, Acta Mathematica. Academiae Scientiarum Hungaricae18 (1967), 25–66, English translation in [13]. doi:10.1007/BF02020961.
7.
A.Ghouila-Houri, Caractérisation des graphes non orientés dont on peut orienter les arětes de manière à obtenir le graphe d’une relation d’ordre, Les Comptes Rendus de l’Académie des Sciences254 (1962), 1370–1371.
8.
A.Ghouila-Houri, Flots et tensions dans un graphe, Ann. Sci. École Norm. Sup. (3)81 (1964), 267–339. doi:10.24033/asens.1132.
9.
P.C.Gilmore and A.J.Hoffman, A characterization of comparability graphs and of interval graphs, Canadian Journal of Mathematics16 (1964), 539–548. doi:10.4153/CJM-1964-055-5.
10.
M.C.Golumbic, Algorithmic Graph Theory and Perfect Graphs, 2nd edn, Elsevier, 2004.
11.
E.Harzheim, Ordered Sets, Springer, New York, 2005.
12.
J.L.Hirst, Combinatorics in subsystems of second order arithmetic, PhD thesis, The Pennsylvania State University, 1987.
13.
F.Maffray and M.Preissmann, A translation of T. Gallai’s paper: “Transitiv orientierbare Graphen”, in: Perfect Graphs, J.L.Ramírez-Alfonsín and B.A.Reed, eds, Wiley, New York, 2001, pp. 25–66.
14.
S.G.Simpson, Subsystems of Second Order Arithmetic, 2nd edn, Cambridge University Press, Cambridge, 2009.