We say that a parameter p of directed graphs has the interval property if for every graph G and orientations of G, p can take every value between its minimum and maximum values. Let λ be the length of the longest directed path. A question asked by C. Lin in [1] is equivalent to the question of whether λ has the interval property. In this note, we answer this question in the affirmative. We also show that the diameter of directed graphs does not have the interval property.
Let G be an undirected graph. An orientation of G is a directed graph D obtained by assigning a direction to every edge in G . A classical result of Gallai, Roy and Vitaver states that in any orientation of a graph G , the number of vertices in the longest directed path is at least the chromatic number of G . Lin [
p min ( G ) = min { p ( D ) : D isanorientationof G }
and
p max ( G ) = max { p ( D ) : D isanorientationof G }
We say the parameter p has the interval property if for every graph G and every k such that p m i n ( G ) ≤ k ≤ p m a x ( G ) , there is an orientation D of G such that p ( D ) = k . For a graph G , λ ( G ) is the length of the longest path in G . Note that λ ( G ) = (the number of vertices in the longest path in G ) − 1. Similarly, λ ( D ) is the length of the longest directed path in a directed graph D . Lin’s question can be phrased as whether λ has the interval property. In Section 2, we answer Lin’s question in the affirmative by describing a method to construct an orientation D of any given graph G with λ ( D ) = k where k is an integer between χ ( G ) − 1 and λ ( G ) . In Section 3, we show that the diameter of directed graphs does not have the interval property. We construct an infinite family of graphs and prove that it is not possible to orient these graphs so that their diameters take all the values between the minimum and the maximum diameters.
Theorem 1 (Gallai [
Theorem 1 provides a lower bound of λ ( D ) for all orientations D of G , and λ ( G ) is a trivial upper bound of λ ( D ) . The question of whether the parameter λ has the interval property is the same as the question of whether λ ( D ) can take every value in the interval [ χ ( G ) − 1, λ ( G ) ] . This is a question raised in [
Theorem 2 For a graph G with χ ( G ) = t and λ ( G ) = l and an integer k such that t − 1 ≤ k ≤ l , there always exists an orientation D of G such that λ ( D ) = k .
Proof. Suppose that P = v 1 v 2 ⋯ v l + 1 is a path of l + 1 vertices in G . Let C be a t -coloring of G such that the color classes are V 1 , V 2 , ⋯ , V t . We may permute the colors so that v 1 ∈ V t . We define a ( t + m − 1 ) -coloring of G recursively for m = 1 , 2 , ⋯ , l . In the m -th coloring, the color classes will be labeled V 1 m , V 2 m , ⋯ , V t + m − 1 m . For m = 1 and i = 1 , 2 , ⋯ , t we let V i 1 = V i . For
m = 2 , 3 , ⋯ , l , we define V i m = V i m − 1 \ { v m } for i = 1 , 2 , ⋯ , t + m − 2 and
V t + m − 1 m = { v m } . What this means is that in the m -th step, we take the vertex v m in the path P and color it with a new color while keeping the colors of all the other vertices unchanged. This is a proper coloring of G . Let D m be the orientation of G induced by this ( t + m − 1 ) -coloring. That is, in D m , the edge u v is directed from u to v if u ∈ V i m , v ∈ V j m and i < j .
It is easy to see that λ ( D 1 ) ≤ t − 1 and according to Theorem 1,
λ ( D 1 ) ≥ t − 1 . Thus we have λ ( D 1 ) = t − 1 . On the other hand, P is a directed path in D l . Therefore λ ( D l ) = l . The key idea of the proof of the theorem is the following observation: When the orientation changes from D i to D i + 1 , the length of the longest directed path will increase by at most one.
Claim: λ ( D m ) ≤ λ ( D m − 1 ) + 1 for all m = 2 , ⋯ , l .
Let Q be a longest directed path in D m . We prove this claim in two cases.
Case 1: Q does not contain the vertex v m . Since all the edges that are not incident with v m are directed the same way in D m as in D m − 1 , Q is also a directed path in D m − 1 . We have λ ( D m ) ≤ λ ( D m − 1 ) .
Case 2: Q contains the vertex v m . Since all the edges that are incident to v m are directed towards v m in D m , v m must be the last vertex in Q . Therefore Q \ { v m } is a directed path in D m − 1 . We have λ ( D m − 1 ) ≥ λ ( D m ) − 1 . This completes the proof of the claim.
To prove the main theorem by contradiction, we assume that there is a value k between t and l such that for all i , λ ( D i ) ≠ k . Let
i ∗ = max { i : λ ( D i ) < k } .
Since λ ( D 1 ) = t and λ ( D l ) = l , such i ∗ exists and is strictly less than l . We have λ ( D i * ) < k and λ ( D i ∗ + 1 ) > k , therefore λ ( D i ∗ + 1 ) > λ ( D i ∗ ) + 1. This contradicts to the claim.
An efficient algorithm can easily be derived to find the orientation in Theorem 2 when a longest path and a t -coloring of G is given, even though finding a longest path is a well known NP-complete problem ( [
The distance between two vertices u , v in a graph G , denoted dist ( u , v ) , is the length of a shortest path between u and v . The diameter of G is the largest distance over all the pairs of vertices in G , denoted diam ( G ) . That is,
diam ( G ) = max { dist ( u , v ) : u , v ∈ V ( G ) } .
Similarly, in a directed graph D , dist ( u , v ) is the length of a shortest directed path from u to v and
diam ( D ) = max { d i s t ( u , v ) : u , v ∈ V ( D ) } .
Distances and diameters of oriented graphs and their applications have been studied extensively (see e.g. [
Theorem 3 Let G be a 2-connected graph. The largest diameter of all strongly connected orientations of G is λ ( G ) .
We define an infinite family of graphs G 3 k for k = 3 , 4 , ⋯
Definition 4 Let the vertex set of G 3 k be { v 1 , v 2 , ⋯ , v 3 k } , and the edges be: ( v i , v i + 1 ) : i = 1 , 2 , ⋯ , 3 k − 1 ; and ( v 3 k , v 1 ) , ( v 1 , v k + 1 ) , ( v k + 1 , v 2 k + 1 ) , ( v 2 k + 1 , v 1 ) . (See
It is easy to see that λ ( G 3 k ) = 3 k − 1 and diam ( G 3 k ) ≤ k + 1.
Lemma 5 There is an orientation D 3 k of G 3 k such that
diam ( D 3 k ) = 2 k − 1 .
Proof. Let D 3 k be the orientation of G 3 k obtained by using the pairs in Definition 4 as ordered pairs. (See
Case 1. u = v 1 . Let v = v j . If j ∈ [ 2, k ] , there is a u v -path of length at most k − 1 : v 1 v 2 ⋯ v j . If j ∈ [ k + 1,2 k ] , there is a u v -path of length at most k : v 1 v k + 1 ⋯ v j . If j ∈ [ 2 k + 1,3 k ] , there is a u v -path of length at most k + 1 :
v 1 v k + 1 v 2 k + 1 ⋯ v j .
Case 2. u = v i and i ∈ [ 2, k ] . Let v = v j . We consider the following four subcases.
Case 2.1 j ∈ [ i , k ] . v i v i + 1 ⋯ v j is a u v -path of length at most k − i ≤ k − 2 .
Case 2.2 j ∈ [ k + 1,2 k ] . v i v i + 1 ⋯ v k v k + 1 ⋯ v j is a u v path of length at most 2 k − 4 since this path at at most k − 2 edges from v i to v k + 1 and at most k − 2 edges from v k + 1 to v j .
Case 2.3 j ∈ [ 2 k + 1,3 k ] . v i v i + 1 ⋯ v k v k + 1 v 2 k + 1 ⋯ v j is a u v path of length at most 2 k − 1 since this path has at at most k − 1 edges from v i to v k + 1 , one edge from v k + 1 to v 2 k + 1 and at most k − 1 edges from v k + 1 to v j .
Case 2.4 j ∈ [ 1 , i − 1 ] . v i v i + 1 ⋯ v k v k + 1 v 2 k + 1 v 1 ⋯ v j is a u v path of length at most k + 1 since this path has at most k − i edges from v i to v k + 1 , one edge from v k + 1 to v 2 k + 1 , one edge from v 2 k + 1 to v 1 , and at most i − 1 edges from v 1 to v j .
Combining all these cases, we see that dist ( u , v ) ≤ 2 k − 1 for all vertices u , v in G 3 k and dist ( v 2 , v 3 k ) = 2 k − 1. Therefore diam ( D 3 k ) = 2 k − 1 .
Lemma 6 There are at most 2 6 different orientations of G 3 k with finite diameters.
Proof. The vertices v 2 , v 3 , ⋯ , v k all have degree two. For the orientation to be strongly connected, the path v 1 v 2 ⋯ v k + 1 must be a directed path, either from v 1 to v k + 1 or from v k + 1 to v 1 . Similarly, the paths v k + 1 v k + 2 ⋯ v 2 k + 1 and
v 2 k + 1 v 2 k + 2 ⋯ v 1 have to be directed paths too. There are two possible directions for each of these three paths and two possible directions for each of the edges ( v 1 , v k + 1 ) , ( v k + 1 , v 2 k + 1 ) , and ( v 2 k + 1 , v 1 ) . Therefore, there are at most 2 6 orientations that are strongly connected thus with finite diameters.
By symmetry, many of the 2 6 = 64 orientations have the same diameter. The number of distinct values of the diameters of orientations of G 3 k is much less than 64. Using Gutin’s theorem ( [
Theorem 7 Let k be an integer greater than 64. It is not possible to orient the graph G 3 k such that the diameter of the orientations take all the values between the smallest diameter and the largest diameter.
Corollary 8 The diameter of oriented graphs does not have the interval property.
The author wish to thank two anonymous referees for their helpful comments.
Zhou, B. (2017) Length of the Longest Path and Diameter in Orientations of Graphs. Open Journal of Discrete Mathematics, 7, 65-70. https://doi.org/10.4236/ojdm.2017.72007