Sunteți pe pagina 1din 16

57

Chapter 1: Trees and Distance

Section 1.2: Distance and Diameter

58

1.2.2. PROPOSITION. The distance function in a graph G satisfies


a) d(u , v) 0, with equality if and only if u = v.
b) d(u , v) = d(v, u).
c) d(u , v) + d(v , w) d(u , w).

Proof: The first two follow from the definition, the third from the existence of a u , w-path in the union of a u , v-path and a v , w-path.

1.2. DISTANCE AND DIAMETER


In communication networks, minimizing distances between processors can minimize errors and delays. This leads to problems of finding
short routes in a specified graph, constructing graphs with short routes
subject to constraints on size or maximum degree, etc.

1.2.3. PROPOSITION. Graphs exist with radius r and diameter d if


and only if r d 2r.

Proof: Since d maximizes and r minimizes the eccentricity, r d.


The inequality d 2r follows from the triangle inequality; for arbitrary x , y V(G) and a vertex v in the center of G, we have d(x , y)
d(x , v) + d(v, y) 2(v) = 2r. Below we construct a graph with radius r
and diameter d.

1.2.1. DEFINITION. The distance d(u , v) from vertex u to vertex v in


a [di]graph G is the minimum length of a u , v-path, if one exists;
otherwise d(u , v) = . The eccentricity of a vertex v is G(v) =
max xV(G) d(v, x). The diameter and radius of a graph are the maximum and minimum of its vertex eccentricities. The center is the
set of vertices of minimum eccentricity.

1.2.4. PROPOSITION. (HararyNorman [1953]) If G is a connected


graph, then the center of G lies in a single block.

The definitions extend to weighted [di]graphs, where the length of


a path is the sum of the weights on its edges. In a disconnected graph,
the diameter, the radius, and the eccentricity of every vertex are infinite.
The word diameter evokes the geometric notion of the greatest distance
between two elements of a set. In the graph below, we have labeled each
vertex with its eccentricity; the center of the graph is a single vertex,
and the graph has radius 2 and diameter 4.

Proof: Let x1 and x2 be vertices in the center. If they are not in the same
block, then they lie on no cycle, and there is a cut-vertex v on every x1 , x2path. Let G 1 and G 2 be the components of G v containing x1 and x2 ,
respectively.
Let r be the radius of G. Since (v) r, we have d(v , w) r for some
vertex w. Choose i {1 , 2} such that w
/ V(G i). Every path from x i that
leaves G i uses v, so d(x i , w) > d(v , w) r, which contradicts (x i) = r.

4
4

x1

4
2

2r d r

x2

1.2.5. COROLL ARY. (Jordan [1869]) The center of a tree consists of


one vertex or two adjacent vertices.
Proof: The blocks of a tree are its edges.

ELEMENTARY PROPERTIES
Distance in a graph has the properties of a metric.

The exercises explore other measures of centrality and also relations


between diameter and other parameters.

59

Chapter 1: Trees and Distance

Section 1.2: Distance and Diameter

SEARCH TREES
In a graph with nonnegative edge weights (such as road distances),
we may want to know the distance from a fixed vertex u (our home) to
all other vertices. Dijkstras Algorithm (discovered by Dijkstra [1959]
and by WhitingHillier [1960]) solves this problem by growing a tree of
shortest paths. The approach rests on this fact: if P is a shortest u , zpath and P contains v, then the u , v-portion of P is a shortest u , v-path.
This suggests finding routes from u to each other vertex z in increasing
order of d(u , z). We maintain a current tentative distance from u to each
vertex z. We confirm the smallest tentative distance as a correct distance
and use this to update the remaining tentative distances.
1.2.6. ALGORITHM. (Dijkstras Algorithm; distance from a vertex.)
Input: A weighted graph (or digraph) and starting vertex u. The weight
of edge xy is w(xy); let w(xy) = if xy is not an edge.
Idea: Maintain the set S of vertices to which the shortest route from u
is known, enlarging S to include all vertices. To do this, maintain also
a tentative distance t(z) from u to each z
/ S; this is the length of the
shortest u , z-path yet found.
Initialization: Set S = {u}, d(u , u) = 0, and t(z) = w(uz) for z 6= u.
Iteration: Select the vertex v outside S such that t(v) = min z/S t(z). Add
v to S. Explore edges from v to update tentative distances: for each edge
vz with z
/ S, update t(z) to min{t(z) , d(u , v) + w(vz)}.
The iteration continues until S = V(G) or until t(z) = for every
z
/ S. In the latter case, no vertex is selectable; the remaining vertices
are unreachable from u and have infinite distance from u.
1.2.7. Example. Application of Dijkstras Algorithm. In the weighted
graph below, shortest paths from u are found to the other vertices in the
order a , b , c , d , e, with distances 1,3,5,6,8, respectively. To reconstruct
the paths, we need only know the final edge of each shortest path, because
the earlier portion of a shortest u , z-path that reaches z along vz is a
shortest u , v-path. The algorithm maintains this information by recording the identity of the selected vertex whenever the tentative distance
to z is updated. When z is selected, the vertex that was recorded when
t(z) was last updated is the predecessor of z on the u , z-path of length
d(u , z). In this example, the final edges on the paths to a , b , c , d , e generated by the algorithm are ua , ub , ac , ad , de, respectively, and these are
the edges of the spanning tree generated from u.

1
u

60

4
b

2
6

Dijkstras Algorithm works also for digraphs, generating a branching from u (an out-tree rooted at u) if every vertex is reachable from u.
The same proof works for both graphs and digraphs. We use induction but
must prove a stronger statement (loading the induction hypothesis) to
facilitate the induction step.
1.2.8. THEOREM. Dijkstras Algorithm computes d(u , z) for z V(G).

Proof: By induction on | S| , we prove the stronger statement that at each


step, 1) the distance from u that has been confirmed for each v S is
d(u , v), and 2) each finite t(z) for z
/ S is the least length of a u , z-path
reaching z directly from S. The basis step follows from the initialization:
k = 1, S = {u}, d(u , u) = 0, and there is a path of finite length reaching
z from S if and only if uz is an edge, in which case t(z) = w(uz).
For the induction step, suppose that when | S| = k, the various claims
about S are true. Let v be a vertex among z
/ S such that the tentative
distance t(z) is smallest. We first argue that d(u , v) = t(v). A shortest
u , v-path must exit S before reaching v. The induction hypothesis states
that the length of the shortest path going directly to v from S is t(v). The
induction hypothesis and choice of v also guarantee that a path visiting
any vertex outside S and later reaching v has length at least t(v).
Hence d(u , v) = t(v). Before we update, the shortest u , z-path reaching z directly from S has length t(z) ( if no such path has been found).
When we add v to S, we must also consider paths reaching z from v.
Since we have now computed d(u , v), the shortest such path has length
d(u , v) + w(vz), and we compare this with the previous value of t(z) to
update t(z).
We have verified that each claim being proved in the induction step
holds for the new set S {v} of size k + 1.

t(v) t(z)

61

Chapter 1: Trees and Distance

The algorithm maintains the condition d(u , x) t(z) for all x S and
z
/ S; hence it selects vertices in nondecreasing order of distance from u.
By marking the edges explored, we explore edges only once, and the
running time of the algorithm is proportional to | V(G)| + | E(G)|. For unweighted graphs, if one seeks the distance only between a single specific
pair x , y of vertices, time may be saved by running the algorithm simultaneously from both vertices and stopping as soon as some vertex has a
known shortest distance from each; this vertex will be a middle vertex on
a shortest x , y-path. For weighted graphs, a more complicated stopping
criterion is needed for this short-cut (Exercise 19).
The special case when G is unweighted is Breadth-First Search,
and the algorithm and proof (Exercise 20) have simpler descriptions.
1.2.9. ALGORITHM. Breadth-First Search (BFS).
Input: An unweighted graph (or digraph) and a start vertex u.
Idea: Maintain a set R of vertices that have been reached but not
searched and a set S of vertices that have been searched. The set R is
maintained as a First-In First-Out list (queue) so that the first vertices
found are the first vertices explored.
Initialization: R = {u}, S = , d(u , u) = 0.
Iteration: While R 6= , we search from the first vertex v of R. The
neighbors of v not in R or S are added to the back of R and assigned distance d(u , v) + 1; then v is removed from the front of R and put in S.
The largest distance from a vertex u to any other vertex is the eccentricity (u). Hence we can compute diam G by running Breadth-First
Search from each vertex. Other search strategies have other applications. In Depth-First Search (DFS), we explore always from the most
recently discovered vertex that has unexplored edges (this is also called
backtracking). In contrast, BFS explores from the oldest vertex, so the
difference between DFS and BFS is that in DFS the set R is maintained
as a Last-In First-Out stack rather than as a queue.
1.2.10. Example. Depth-First Search. In the graph below, one depth-first
search from u finds the vertices in the order u , a , b , c , d , e , f, g. For both
BFS and DFS, the vertex order depends on the order of exploring edges
from a searched vertex.
e

Section 1.2: Distance and Diameter

62

A breath-first or depth-first search from u generates a tree rooted at


u; when we discover a new vertex v, we include the edge used to reach
v. This grows a tree that becomes a spanning tree of the component containing u. The usefulness of depth-first search stems from a fundamental
property of the resulting spanning tree.
1.2.11. LEMMA . If T is a spanning tree of a connected graph G grown
by a depth-first search from u, then every edge of G not in T consists
of two vertices v , w such that v lies on the u , w-path in T .
Proof: Let vw be an edge of G, with v encountered before w in the depthfirst search. Because vw is an edge, we cannot finish v before w is added
to T . Hence w appears somewhere in the subtree formed before finishing
v, and the path from w to u contains v.
Finding a spanning tree of maximum diameter in a graph includes
determining whether it has a Hamiltonian path (a spanning path), which
is NP-hard. Finding a spanning tree of minimum diameter is not hard.
1.2.12.* THEOREM. A spanning tree of minimum diameter can be
found by conducting a breadth-first search from each vertex and using the resulting tree of smallest depth.
Proof: Let T of diameter d be a spanning tree of G with minimum diameter. Let P be a longest path in T ; P has length d. If d = 2r is even, let
u be a middle vertex on P. The distance from u to any vertex along paths
within T is at most r, else such a shortest path can be combined with half
of T to create a longer path in T . Hence d G(u , x) r for all x V(G),
and a breadth-first search tree T from u is a tree rooted at u with depth
at most r. Every path in T approaches u for some number of steps and
then moves away from u for some number of steps; it cannot change direction more than once. Hence every path in T has length at most 2r,
and T does as well as T . (The case with d odd is left to Exercise 21).
This theorem does not extend to weighted graphs; in the weighted
case, it may not be possible to find the spanning tree of minimum diameter by running Dijkstras Algorithm from any vertex (Exercise 21). Also,
finding a subtree with the minimum sum of distances between vertices is
NP-complete (Johnson et al [1978]).

63

Chapter 1: Trees and Distance

GRAPHS WITH GIVEN DIAMETER


In constructing communication networks, we seek graphs of small
diameter without too many edges. We can achieve diameter 2 with only
|V(G)| 1 edges by using a star. However, physical constraints may limit
the maximum degree. Among graphs with maximum degree k, minimizing diameter for fixed number of vertices is equivalent to maximizing the
number of vertices for fixed diameter, roughly speaking. We first present
an easy bound on | V(G)|.
1.2.13. PROPOSITION. (Moore bound) Graphs with maximum ded
1
vertices.
gree k and diameter d have at most 1 + k (kk1)
2

Proof: Grow a breadth-first search tree from vertex v. With maximum


degree k, there are at most k(k 1)i1 vertices at distance i, as shown on
the left below. Since all vertices are reached within distance d, there are
d
d
1
at most k i=1 (k 1)i1 other vertices. The geometric sum equals (kk1)
2 .
v

1.2.14. REMARK. If d(v) < k for some vertex v, then searching from v
sharpens the bound by the factor (k 1)/k. Thus a graph near the bound
must be k-regular. Achieving the bound requires edges among the leaves
of the tree to reduce the distance to d for all vertex pairs. The Petersen
graph does this when d = 2 and k = 3, as shown above.
Equality in the bound forbids duplication in the search from a vertex
and hence requires girth at least 2d + 1. This is best possible; a graph
with diameter d that is not a tree has girth at most 2d + 1 (Exercise 9).
A Moore graph is a graph achieving equality in the bound of Proposition 1.2.13. There is some disagreement about what should be used as
the definition, because these structures are forced by a seemingly innocuous condition that they satisfy. We have observed that a Moore graph
with diameter d has girth 2d + 1; in fact, this is sufficient.
1.2.15. LEMMA . Graphs with diameter d and girth 2d + 1 are regular.
Proof: Let G be such a graph, with vertices x and y being distance d
apart. For any u N(x), a u , y-path of length at most d cannot pass

Section 1.2: Distance and Diameter

64

through x. Furthermore, for u , u N(x), any u , y-path and u , y-path


of length d cannot have a common internal vertex, since with x the portions of these paths up to a common vertex would contain a cycle of length
less than 2d + 1. In particular, paths of length d from N(x) to y arrive
via distinct neighbors of y. Hence d(y) d(x), and similarly d(x) d(y).
We conclude that vertices separated by distance d have the same degree. Since G has girth 2d + 1, it has a cycle C of length 2d + 1. The
distance from a vertex of C to the nearly-opposite vertices is d, since otherwise G has a shorter cycle. We conclude that adjacent vertices on C
have the same degree, and hence all vertices on C have the same degree.
For a vertex z outside C, let l be the distance from z to C. Following
a shortest path from z to C and continuing d l steps along C reaches a
vertex w. The distance from z to w must be d, since otherwise a shortest
z , w-path combines with this path to contain a cycle shorter than C. Now
every vertex not in C has the same degree as the vertices of C.
1.2.16. Example. Moore graphs. A graph with diameter d and girth
2d + 1 is k-regular for some k. For k-regular graphs (with k 3), it is easy
to show that any two of the properties diameter d, girth 2d + 1 , and
d
1
1 + k (kk1)
vertices imply the third (Exercise 48). Damerell [1973] and
2
BannaiIto [1973] independently proved that no Moore graph exists with
diameter at least 3. Hoffman and Singleton [1960] proved that Moore
graphs with diameter 2 exist only for k = 3, k = 7, and possibly k = 57
(the proof is algebraic; see Chapter 10). For k = 3, we have the Petersen
graph. It remains unknown whether a 57-regular Moore graph exists.
For k = 7, the 50-vertex HoffmanSingleton graph is the union of
10C5 with a 5-regular bipartite graph: letting P0 , . . . , P4 and Q0 , . . . , Q4
be copies of Z5 , we place the usual 5-cycle on each copy of Z5 and join the element i from P j to the element l from Qk if and only if 2l i + 2 jk (mod 5).
FanSchwenk [1993] proved that this is the only Moore graph with k = 7.

0
1 4 P 1 4
1 4 P 1
j
4
0

2
3
2
3
2
3
2
3
2
3 2
4
3 1
0
0
0
0
0

4
4 Q 1 4 Q 1 4
1 4
1 4 Q 1
1
0
k
4
2
3
3 2
3 2
3 2
3 2
3 2
4 P 1 4
0

The Petersen graph consists of two copies P and Q of Z5 , with i in


P joined to l in Q if and only if 2l i (mod 5). For the subgraph of

65

Chapter 1: Trees and Distance

the HoffmanSingleton graph induced by V(P j Qk), the quantity 2 jk is


fixed, say at c. Now the adjacency criterion 2l i + c (mod 5) for edges
joining P j and Qk describes the Petersen graph under a cyclic relabeling of one 5-cycle. Thus each set V(P j Qk) induces a subgraph of the
HoffmanSingleton graph isomorphic to the Petersen graph.
When n is sufficiently small in terms of k and d, extra edges at the
leaves are not needed, because the tree grown halfway is big enough.
In this case n 1 edges still suffice. When d is odd, only one of the components obtained by deleting the root can be grown to depth d/2 .

Section 1.2: Distance and Diameter

1.2.20. THEOREM. (ErdosRenyi [1962]). For 2n32 k n 5,


the smallest n-vertex diameter-2 graph with maximum degree k has
2n 4 edges.

Proof: Let S be a 3-set of vertices with high degree. Each vertex outside
S has two neighbors in S, so any two have a common neighbor. Two edges
within S complete a graph H , and | E(H)| = 2(n 3) + 2 = 2n 4. With
degree-sum 2(n 3) + 4 in S, the construction requires 2n 2 3k.

1)/2
(k 1)i + i=01)/2(k 1)i , then
1.2.17. PROPOSITION. If n i=0
some n-vertex tree has diameter d and maximum degree k.
(d

(d

Proof: Two vertices in the same main subtree reach the root in at most
(d 1)/2 steps. The farthest pairs are leaves not in the same main subtree; the distance is (d 1)/2 + (d 1)/2 + 1.

For larger n, extra edges are needed to form the short paths. Erdos
and Renyi provided a counting argument for a lower bound.
1.2.18. PROPOSITION. (ErdosRenyi [1962]). Graphs of order n, maxd
imum degree k, and diameter d have at least (n2)/ i=1 (k 1)i1 edges.

Proof: Let G have n vertices, m edges, diameter d, and maximum degree


k. Joining each of the n(n 1) ordered pairs of vertices, G has a path
of length at most d. Each ordered edge starts at most (k 1)i1 ordered
d
paths of length i. Thus n(n 1) 2m i=1 (k 1)i1 .

1.2.19. Example. Small graphs with maximum degree k and diameter 2.


k = n 1: The star with n 1 edges suffices.
k = n 2: Let x be a vertex of degree n 2, and let y be the vertex outside N[x]. Paths of length at most 2 from y to N(x) cannot use x;
therefore G x is connected, adding n 2 more edges. Hence 2n 4 edges
are needed, and it suffices to let G x be a star with center y.
k {n 3 , n 4}: Surprisingly, 2n 5 edges suffice; see Exercise 44.
The range (2n 2)/3 k n 5 is covered in the next theorem.

66

To prove optimality, consider such a graph G with m edges, where


m 2n 5. Let x be a vertex of minimum degree. We have d(x) 3
from m < 2n and d(x) 2 from diam G = 2 and k < n 1. Since
every vertex outside N[x] has a neighbor in N(x), also v N(x) d(v)
(n d(x) 1) + d(x) = n 1.
Case 1: (d(x) = 3). With degree at least 3 for each vertex outside
N(x), the degree-sum formula yields
2n 5 m =

1
2

d(v) 12 [n 1 + 3(n 3)] = 2n 5.

Since equality holds, v N(x) d(v) = n 1, and each vertex y outside N[x]
has degree 3, with one neighbor in N(x). Similarly, nonneighbors of any
degree-3 vertex (such as y) have degree 3, so the nonneighbors of y in N(x)
have degree 3 and its neighbor has degree n 7. Thus all vertices have
degree 3 except one with degree n 7. Since each 3-vertex has a neighbor
with degree n 7, we have n 7 n 1, which is impossible.

x A B C

A B
B A

Case 2: (d(x) = 2). Let N(x) = {a , b}, with A = N(a) and B = N(b).
Since (x) = 2, we have V(G) {a , b} A B. Paths of length 2 from B
A to A B cannot visit {a , b}, so the subgraph G induced by (A B) C is
connected, where C is the set of vertices in A B with neighbors in A B.

67

Chapter 1: Trees and Distance

There are n 2 + | A B| edges incident to {a , b} (not counting a possible edge joining them). Together with a spanning tree in G , this yields
2n 5 m n 2 + | A B| + | A B| + | C| 1 = 2n 5 + | C|.

Equality yields C = , and G is a tree. For each v A B, together C =


and d(v, b) = 2 require v to have a neighbor in B A. Symmetrically,
each v B A has a neighbor in A B.
Since d(a) n 5, we have | B A| 3, and similarly | A B| 3.
Let v be a leaf of G ; by symmetry, assume v A B, with neighbor z
in B A. Paths of length 2 from v to B A {z} require B A N[z].
Hence B A induces a star with center z. The same argument at another
leaf of G yields a cycle unless G is a star with center z and leaf set A B.
This contradicts | B A| 3, so Case 2 also cannot occur.
For smaller k, the optimal values below are achieved using several
vertices of high degree and several groups of low-degree vertices with
identical neighborhoods (see Bollobas
[1978, p174] and Exercise 44). The
lower bounds follow from very detailed case analysis. Note that 3n k 6
5n 4k 10 4n 2k 11 when n/2 < k < (2n 2)/3.

1.2.21.* THEOREM. (ErdosRenyiSos [1966]). The fewest edges in an


n-vertex graph with diameter 2 and maximum degree k is

3n k 6
if 3n53 k < 2n32

5n 4k 10 if 5n93 k < 3n53 .

n+1
5n3

4n 2k 11 if 2 k < 9

How small can k be? The Moore bound requires n 1 + k 2 for diameter 2. Although equality can be attained only when k is 2,3,7, or possibly

57, there do exist graphs with diameter 2 and maximum degree near n.

1.2.22. Example. Diameter 2 with degree as small as 2 n. Given n =


m2 , let G m = K m K m . That is, V(G m) = {(i , j): 1 i , j m}, with two
vertices adjacent when they agree in either coordinate. Each vertex has
degree 2m 2, and non-adjacent vertices (i , j) and (k , l) have (i , l) and
(k , j) as common neighbors. The graph is not as sparse as
the counting

bound allows, since G m is regular of degree 2 n 2, not n 1.

Section 1.2: Distance and Diameter

68

Reducing the degree to n 1 requires more care. When n = q2 + q +


1, where q is a power of a prime, there is a nearly-regular
graph of diam
eter 2 with maximum degree q + 1, which equals n 1 (some vertices
have degree q). This graph, built using a finite projective plane, solves
another problem in Chapter 5, and we postpone it until then.
1.2.23.* REMARK. Extensions and variations. As k decreases in Theorem 1.2.21, the minimum number of edges
increases. It remains linear

in n when k = (n + 1)/2, but when k = n 1 each vertex must have degree at least k 1, so asymptotically at least 12 n3/2 edges are needed. Bollobas
[1971] extended the path-counting argument of Proposition 1.2.18
and the projective plane construction
to solve the problem asymptotically
for all k in the remaining range n 1 k n/2 (Exercise 46).
Moving on to diameter 3, ErdosRenyiSos [1966] found the smallest
such n-vertex graphs with maximum degree k when (2n)2/3< k < n 1,
and Bollobas
solved it at the other end of the range, k < 2 n. For other
extremal results about diameter, see Bollobas
[1978, p178212].
One can also restrict the graphs considered to triangle-free graphs,
[1994]
again seeking diameter 2 and maximum degree k. FurediSeress

(1 +
used projective
planes
to
construct
such
graphs
with
k
as
small
as


o(1))(2/ 3) n, near the lower bound of n 1. They also constructed
examples for k (n 2)/2 that are optimal when n is sufficiently large
(see Exercise 45). They have somewhat more edges than can be achieved
when triangles are allowed, but still linear in n. ErdosHolzman [1994]
found the asymptotic minimum number of edges
when 2n/5 + o(n) < k <
n/2 o(n). For contructions with k as small as 2 n, see HansonSeyffarth
[1984] and HansonStrayer [1990].

ORIENTED DIAMETER
Robbins Theorem [1939] states that a graph has a strongly connected orientation if and only if it has no cut-edge. Orientations arise
when making city streets one-way or when building a communication network with links that function in only one direction. The natural objective
is to obtain not just a strong orientation, but also one having a short u , vpath for every ordered pair (u , v) of vertices.
1.2.24. DEFINITION. The diameter of a digraph is the maximum of
d(x , y) over ordered vertex pairs (x , y). The oriented diameter of a
graph G is the smallest diameter among strong orientations of G.

69

Chapter 1: Trees and Distance

To have a strong orientation, a graph must have no cut-edge. We


strengthen Robbins Theorem by proving an upper bound on the oriented
diameter as a function of diam G when there is no cut-edge. The oriented
diameter must be at least diam G, and graphs where equality holds are
tight. McCanna [1988] proved that hypercubes with dimension at least
four are tight (Exercise 52). K o nigKrummeLazard [1998] determined
precisely which discrete tori (Cn Cm) are tight: if n m, then Cn Cm is
tight except when 1) n , m are both odd, 2) n = 3 and m is even, 3) n = 4
and m is odd, or 4) n = 5 and m is divisible by 4 (see Exercise 51).
Computing the oriented diameter of a graph is NP-hard (Chvatal

Thomassen [1978]), so we study extremal problems. Let f(d) be the


largest oriented diameter of a graph with diameter d. ChvatalThomassen

[1978] proved that 12 d2 + d f(d) 2d2 + 2d.


1.2.25. Example. Large oriented diameter. With H0 = K 1 , construct a
rooted graph Hr recursively from two copies of Hr1 by adding paths of
lengths 2 and 2r 1 joining their roots. The root of Hr is the new common
neighbor of the old roots. Let G r consist of two copies of Hr with their
roots merged; G 3 appears below.
Chvatal
and Thomassen observed that G r has no cut-edge, that its

root has eccentricity r, and that in every strong orientation of G r the distance is r 2 + r from the root to some other vertex. Furthermore, diam G r =
2r, and the diameter of the orientation is 2r 2 + 2r, which equals 12 d2 + d,
where d = diam G r . The construction must be modified to obtain a lower
bound on f(d) when d is odd (Exercise 54).







The proof of f(d) 2d2 + 2d follows from a technical result on oriented eccentricity implying that if G has radius r, then G has an orientation with diameter at most 2r 2 + 2r. Since r d, the diameter of the
orientation is at most 2d2 + 2d.
[1978]) If a graph G has no
1.2.26. THEOREM. (ChvatalThomassen

cut-edge, and G (u) r for some vertex u, then G has an orientation


H such that d H (u , v) r 2 + r and d H (v , u) r 2 + r for all v V(G).

Proof: Fix u and r. Every edge incident to u belongs to a cycle, since G


has no cut-edge. For v N(u), let k(v) be the length of the shortest cycle
through uv. Since (u) r, we have k(v) 2r + 1.

Section 1.2: Distance and Diameter

70

For S N(u), an orientation A of a subgraph of G is admissible for


S if A is the union of directed cycles {Cv : v S} such that Cv contains uv
or vu and has length k(v). For any w V(A), we have d A(u , w) 2r and
d A(w , u) 2r, since each cycle used has length at most 2r + 1.
We will construct a digraph admissible for NG(u). The theorem then
follows easily by induction on r. For r = 1, we have r 2 + r = 2r and N(u) =
V(G) {u}, and using A as a subgraph of H suffices (see also Exercise 53).
For r > 1, let A be admissible for NG(u). Form a new graph G by contracting A into a single vertex u . The graph G has no cut-edge. Since
A contains N(u), we have d G (u , v) r 1 when v V(G ) {u}. By the
induction hypothesis, G has an orientation H such that for v V(G ),
both d H (u , v) and d H (v , u) are at most (r 1)2 + (r 1). We can view
H as an orientation of a subgraph of G E(A). Combining this with A
yields paths of the desired lengths in G, since d A(u , w) and d A(w , u) are
at most 2r for every w V(A), and (r 1)2 + (r 1) + 2r = r 2 + r.
To construct a digraph admissible for NG(u), we show that any digraph A admissible for a set S NG(u) can be augmented to be admissible for a larger set if there exists w NG(u) S. Let C be a cycle
of length k(w) in G that contains uw; index the vertices so that C =
[u , w , w2 , . . . , wk(w)1 ].
If C u contains no vertex of A, then orient C consistently and add
it to A. Otherwise, let i be the least index such that wi V(A). Let P =
u , w , . . . , wi and Q = wi , . . . , wk(w)1 , u. We have wi Cv for some
v S; let R = u , v , . . . , vj and R+ = vj , . . . , vk(v)1 , u. We will add P
to A, oriented backward or forward and combined with R or R+ to form
Cw , depending on whether uv E(C).
wi v j

P
w

Cv R+

v
u

Q R v2

vk(v)1

wi v j

P
w

v2

R Cv R+
v
vk(v)1

Case 1: uv E(C); that is, wk(w)1 = v. Complete Cw by following R


and then P ; the length of Cw is j + i. If j + i > k(w), then Q is shorter
than R , but then Q R+ contains a cycle through v shorter than Cv .
Case 2: uv
/ E(C). Complete Cw by following P and then R+ ; the
length of Cw is i + k(v) j . If i + k(v) j > k(w), then Q is shorter than
R+ , but then Q R contains cycle through v shorter than Cv .

71

Chapter 1: Trees and Distance

For d = 2, Theorem 1.2.26 yields 4 f(d) 12, but in fact f(2) = 6.


Improving the upper bound requires a closer look at the structure of G.
When every edge lies in a triangle, the following theorem applies.
1.2.27. THEOREM. For k 3, let h(k) = (k 2)2(k1)/2 + 2. Every graph
G has an orientation H such that for all k, every edge in a k-cycle in
G lies in a cycle of length at most h(k) in H.
Proof: Since every cycle is contained in one block, we may assume that
G is 2-connected. We construct the desired orientation of G by orienting
successively larger subgraphs. Start with H2 being the spanning subgraph of G with no edges. For i 3, let Hi be a maximal oriented subgraph of G such that Hi1 Hi and every edge of Hi lies in a cycle of
length at most i in Hi . When i is large enough, Hi is an orientation of G.
Let C be a cycle of length k in G, with uv E(C). It suffices to show
that if Hr contains neither uv nor vu, then r < h(k). Index the vertices as
u1 , . . . , uk along C so that u1 = u and uk = v. For 3 i r, let x i be the
number of indices j (less than k) such that uj +1 uj E(Hi) E(Hi1).
q
First we prove a lower bound on i=3(i 2)x i , for 3 q r. Let Hq
be the digraph obtained from Hq by adding vu and all uj uj +1 such that
u j +1 u j
/ E(Hq). If uj +1 uj E(Hq), then j is counted by some x i with 3
i q. Now uj +1 uj lies in a cycle of length at most i in Hq , so d Hq (uj , uj +1)
q
i 1. Hence in Hq all k i=3 x i added edges lie in a single cycle of length
q
q
at most k i=3 x i + i=3(i 1)x i . Since they are not in Hq , we obtain

(i 2)x i > q k.
q

()

i=3

For t N, let pt = (k 2)2 t1 + 2, and let p0 = 2. For fixed r, we


p
prove by induction on t that i=t 3 x i t when pt r. Since p0 = 2, the
claim holds for t = 0, so consider t > 0. By the induction hypothesis,
p
p
failure requires t 1 i=t31 x i i=t 3 x i t 1, which yields x i = 0
pt1
p
for pt1 < i pt . Also, since i=3 x i = t 1 and i=s31 x i s 1 for
pt1
0 s < t 1, we have i= ps1 +1 x i t s. Now a computation contradicts
() for q = pt :

(i 2)x i = (i 2)x i = (i 2)x i (ps p0) x i


pt

i=3

pt1

t1

i=3

s=1 i= ps1 +1

(ps ps1)
t1

pt1

s =1

i= ps1 +1

ps

xi

s =1

s =1

i= ps1 +1

(ps ps1)(t s)
t1

s =1

= ps (t 1)p0 = pt k.
t1

t1

ps

Section 1.2: Distance and Diameter

72

Hence i=t 3 x i t. By the same reasoning, i=t 3 yi t, where yi is


the number of indices j such that uj uj +1 belongs to Hi but not to Hi1 . If
r
r
r h(k) = p(k+1)/2 , then i=3 x i + i=3 yi 2(k + 1)/2 k, which is
impossible since x i + yi k 1.
p

1.2.28. COROLL ARY. If G is a graph in which every edge belongs to


a cycle of length at most k, then G has an orientation H such that
d H (u , v) (h(k) 1)d G(u , v) for u , v V(G).

Proof: Let H be the orientation obtained in Theorem 1.2.27. A u , v-path


P in G can be transformed into a u , v-walk in H by replacing each edge
of P with a directed path in H of length at most h(k) 1. The resulting
walk in H contains a u , v-path in H.
With Corollary 1.2.28, the computation of f(2) becomes fairly easy.
1.2.29. Example. Form G from K 4 by replacing each edge incident to
one vertex w with a path of length d. Note that G has diameter d. We
show that every strong orientation of G has diameter at least 3d.
Since D is strong, each path in G joining vertices of degree 3 is a path
in D. Reversing all edges does not change the diameter, so we may assume
that w has outdegree 1, with a path of length d to the lower-left vertex x.
Now x may have outdegree 1 or 2, and in the first case we may choose its
outneighbor to be the lower-right vertex y. In the first case yz is forced
by avoiding a source at z; in the second we choose z y by symmetry. In
each case, the path from the vertex 0 to the vertex 3d is the shortest (the
only!) path from its origin to its terminus; it is a spanning path.
z

3d

3d

y
0

Note that d = 2 and d = 3 are the only cases where the construction
in Example 1.2.29 improves the lower bound 12 d2 + d. Plesn k [1985]
showed that this construction has the fewest vertices among graphs with

73

Chapter 1: Trees and Distance

diameter 2 and oriented diameter 6. The Petersen graph also has diameter 2 and oriented diameter 6 (Exercise 55).
[1978]) f(2) = 6.
1.2.30. THEOREM. (ChvatalThomassen

Proof: Example 1.2.29 provides the lower bound. Corollary 1.2.28 shows
that a graph with diameter 2 and no cut-edge has oriented diameter at
most 6 if every edge lies in a triangle. This leaves the case where a 2edge-connected graph G of diameter 2 has an edge uv in no triangle.
In this case, we construct an orientation D so that every vertex has
a short path to u and a short path from v. If such paths have length at
most 2, then d D(x , y) 5 for all x , y V(D). In some cases the paths
have length 3, and we then need to find a shorter x , y-path directly.
Let Nu = N(u) {v} and Nv = N(v) {u}. Since uv is in no triangle,
Nu Nv = . Let C = V(G) (N(u) N(v)). Since G has diameter 2,
every vertex of C has a neighbor in Nu and another in Nv . Let A = {w
Nu : N(w) 6 N[u]} and B = {w Nv : N(w) 6 N[u]}. Let A = Nu A and
B = Nv B.
Most of D is specified as follows. Orient u v and orient all of
[A , B] from B to A. Orient all edges joining consecutive sets in the list
{v} , B , C, A , {u} from the first set to the second. Orient [A , A] toward
A and [B , B ] away from B. We will discuss the other edges incident to
A and B later. The orientation of edges within A, B, or C is irrelevant.
A
A

Section 1.2: Distance and Diameter

74

in A or y has one in B, then the bound of 7 reduces to 6. Otherwise, the


only place for a common neighbor of x and y is C, and then d D(x , y) = 2.
Since vertices from A and B have no common neighbor, they cannot both exist. By symmetry under reversal, we may assume that B = .
With the table above, the proof is complete when we orient the edges induced by A {u} so that d D(w , u) 2 and d D(u , w) 2 whenever w A .
In each component of G[A], choose a spanning tree, and view it as
an X , Y-bigraph (for an isolated vertex of G[A], put it in X). Orient all
edges of the tree from X to Y , all edges from Y to u, and all edges from u
to X . This creates all the needed paths of length at most 2 in D.
The construction of Example 1.2.29 yields f(3) 9, and the upper
bound of Theorem 1.2.26 yields f(3) 24. KwokLiuWest [2009] proved
f(3) 11. The idea is as in Theorem 1.2.30; Corollary 1.2.28 gives (better than) the desired bound when every edge lies in a triangle, and the
structure of the graph is explored when there is an edge uv lying in no
triangle. Since G now has diameter 3, there are more sets needed in the
diagram, and the orientation and analysis are more intricate.
There is hope for improving the upper bound in general. Chvatal

Thomassen [1978] observed that the bound h(k) = (k 2)2(k1)/2 + 2 in


Theorem 1.2.27 is sharp for k = 3 and k = 4, but it may be possible to
improve it for larger k. Such an improvement could greatly simplify the
work needed to improve the upper bound on f(d).

Nu

AVERAGE DISTANCE

u
C
v

Nv

Every vertex of B has a successor in A C, every vertex of A has a


predecessor in B C, and every vertex of C has a predecessor in B and a
succesor in A. This yields upper bounds on distances as follows.
for w in

d D(w , u)
d D(v , w)

1
3

3
1

2
2

We now have an x , y-path of length at most 6 in D whenever x , y


V(G) (A B), except maybe when x B and y A. If x has a neighbor

The diameter is the maximum distance between vertices; we may also


consider the average or sum of the distances. This is appropriate when
the requests for message transmissions are randomly distributed among
the vertex pairs and want to minimize the average time. We write the
sum as D(G), and the average distance D(G) is D(G)/(n2). The distancesum is also called the Wiener index, particularly for trees (Exercise 59).
Comparing average and maximum yields D(G)/diam G 1, with
equality for complete graphs.
The ratio can be arbitrarily
small; a com
plete graph of order n n with a pendant path of length n has diameter

1 + n, but the clique is so large that the average distance is 2 + o(1).


Questions about diameter have analogues for average distance. Consider vulnerability. In a connected graph G we can always find a vertex v
such that diam (G v) is finite; any leaf of a spanning tree will do. How
(G v)
small can we make diam
or D(Gv) by choosing v wisely?
diam G
D(G)

75

Chapter 1: Trees and Distance

Section 1.2: Distance and Diameter

76

1.2.31. Example. Diameter and distance vulnerability. The cycle Cn has


diameter n/2 . Deleting any vertex yields the path Pn1 with diameter
n 2. Hence min diam (G v)/diam G may be almost as large as 2.
What are D(Cn) and D(Pn1)? When n is odd and 1 k (n 1)/2,
there are exactly n pairs of vertices in Cn whose separation distance is k.
Hence D(Cn) = (n + 1)/4. The value is slightly higher when n is even due
to the n/2 pairs at distance n/2.
Many ways to sum the distances yield D(Pn1) = (n3), so D(Pn1) =
(n3)/( n2 1) = n/3. A direct argument for D(Pn1) observes that picking
a random vertex pair is equivalent to making a random arrangement of
two black balls and n 3 white balls, with the distance being 1 plus the
number of white balls between the black balls. Each white ball has probability 1/3 of locating between the black balls, so linearity of expectation
yields D(Pn1) = 1 + 13 (n 3) = n/3.
Comparing Cn and Pn1 thus shows that min D(G v)/D(G) may be
almost as large as 4/3. Edge-deletions yield the same asymptotic ratios.
The 4/3 Conjecture of Winkler [1986] states that every graph has a vertex whose deletion multiplies the average distance by at most 4/3. It is
mostly proved. BienstockGyori [1988] showed that every connected nvertex graph G has a vertex v such that D(G v)/D(G) 4/3 + O(n1/5). If
also (G) 2, then D(G e)/D(G) 4/3 for some edge e. Kouider [1991]
proved the 4/3 Conjecture for 4-connected graphs.

several steps that are useful in their own right. Recall that S is a connected dominating set in G if G[S] is connected and S contains a neighbor of every vertex outside S.

One can study bounds on D(G) in terms of many other parameters.


BekkaiKouider [2010] does this using girth and lists references for
bounds on D(G) in terms of minimum degree, number of edges, eigenvalues, etc. Here we consider bounds in terms of the independence number.
In a shortest path joining most-distant vertices, the vertices having
even distance from one end form an independent set. Hence diam G
2(G) 1, achieved by paths. We expect a smaller bound for D(G).
The bound D(G) (G) was conjectured by the computer program
Graffiti, developed by Fajtlowicz to conjecture from experimental data
about graphs. FajtlowiczWaller [1986] proved the weaker bound D(G) <
(G) + 1. Chung [1988] then proved D(G) (G), with equality only for
complete graphs. Graffiti made the stronger conjecture around 1992 that
D(G) is at most half the maximum number of vertices in an induced bipartite subgraph. Hansen-Hertz-K ilani-Marcotte-Schindl [2009] proved
a stronger version of this conjecture: D(G) b(G)/2, where b(G) is the
maximum number of vertices in an induced subgraph that is a forest.
(Note: Later conjecture-making programs for graphs include Graffiti.pc
by Delavina
and AutoGraphiX by Caporossi and Hansen.)
We begin with the FajtlowiczWaller result. We break the proof into

Proof: Because the merged vertex is a cut-vertex of Hi ,


D(Hi) = D(G) + D(F) + (| V(G)| 1)s F (y) + (| V(F)| 1)s G(x i).

1.2.32. LEMMA . Every connected graph G has a connected dominating


set of size at most 2(G) 1.

Proof: Every maximal independent set in a graph is a dominating set.


We build a maximal independent set M in G such that M S, where
|S| 2 | M | 1 and G[S] is connected. The resulting set S is connected,
contains a dominating set, and has size at most 2(G) 1.
Pick a vertex v and initialize M = S = {v}. Subsequently, if M is not
yet a maximal independent set, then some u
/ M has no neighbor in M.
Find a shortest path from u to M. Let z be its last vertex before reaching
M , and let y be the vertex before z; note that y has no neighbor in M.
Add y to M and {y , z} to S (z may or may not already be in S).
Since z already had a neighbor in S and y is adjacent to z, still G[S]
is connected, and M remains a dominating subset of it. Since | M | increases by 1 and | S| by at most 2, all needed properties are maintained.
1.2.33. LEMMA . For a graph G, let s G(x) = vV(G) d(x , v). Consider
x1 , x 2 V(G), and let F be a graph with a vertex y. Form Hi from
G F by merging y and x i . If s G(x1) s G(x2), then D(H1) D(H2).

1.2.34. LEMMA . Among the vertices of a path in a tree G, the sum


vV(G) d(x , v) is maximized when x is an endpoint of the path.

Proof: Let e = vi vi+1 be an edge of the path v0 , . . . , vk in G. Let ai , bi be


the orders of the components containing vi and vi+1 in G e. We obtain
s(vi+1) s(vi) = ai bi . Since a0 ak and b0 bk , the change
s(vi+1) s(vi) steadily increases. Thus s(vi) is convex in i and attains its
maximum at v0 or vk .
The desired inequality D(G) (G) + 1 will follow from a bound on
average distance in trees.
1.2.35. THEOREM. If a tree T has j non-leaf vertices, then D(T) < j +2 3 .
Proof: Fix j , and let n = | V(T)|. We transform T into a special tree T n
without reducing the average distance or the number of non-leaves. It
then suffices to prove that D(T n) < j +2 3 .

77

Chapter 1: Trees and Distance

Let P be a longest path of non-leaves in T . If an internal vertex x of


P has a neighbor outside P , then split x into x and y, letting x inherit
the edges of P incident to x, and letting y inherit the rest. By Lemmas
1.2.331.2.34, merging y with an endpoint of P forms a new tree T with
larger average distance than T and the same number of leaves. Thus any
n-vertex tree with j non-leaves having largest average distance consists
of a path plus leaves at its endpoints. Having restricted to such trees, the
average distance is highest when half the leaves are at each end.
That is, the unique tree T n with largest average distance among
trees with n vertices and j non-leaf vertices consists of P j plus (n j)/2
leaves attached at one end and (n j)/2 leaves attached at the other
end. Since an n-vertex tree has at most n 2 non-leaves, to facilitate
computation we also define T n to be a path when n { j , j + 1}.
To complete the proof, we prove by induction on n that D(T n) <
j +3 n
(
). When n = j , we have D(T j ) = D(P j ) = ( j +3 1 ) < j +2 3 (2j ), as desired
2 2
(see Example 1.2.31). Similarly, D(T j +1) = D(P j +1) = ( j +3 2) < j +2 3 ( j +2 1 ).
For n j , we bound D(T n+2) by bounding D(T n+2) D(T n) and invoking the induction hypothesis for D(T n). If D(T n+2) D(T n) < j +2 3 (2n + 1),
then D(T n+2) < j +2 3 (n2) + j +2 3 (2n + 1) = j +2 3 (n+2 2). Since T n+2 arises from
T n by adding one leaf at each end, we need only sum the distances for the
new vertices. The three contributions are from nearby leaves, distant
leaves, and the j vertices of the path, yielding
D(T n+2) D(T n) = (n j)2 + (n j + 1)(j + 1) + 2(

= (n j)(j + 3) + (j + 1) + j(j + 1)
2n + 1
= n(j + 3) j + 1 < (j + 3)
.

j +1
)
2

1.2.36. COROLL ARY. (FajtlowiczWaller [1986]) D(G) < (G) + 1.

Proof: If T is a spanning tree of G, then D(G) D(T). Hence it suffices


to show that D(T) < (G)+1 for some spanning tree T . By Lemma 1.2.32,
a smallest connected dominating set S of G has size at most 2(G) 1.
Extend a spanning tree of G[S] to a spanning tree T of G by adding each
remaining vertex as a leaf; having chosen S smallest, every vertex of S
3
is a non-leaf in T . By Theorem 1.2.35, D(T) < |S|+
(G) + 1.
2
The proof of D b(G) by Hansen et al. [2009] is analogous, iteratively transforming the graph without decreasing the average distance
or changing b(G), the maximum number of vertices in an induced forest.
When b(G) > 4, the graph is transformed into a double kite, which is

Section 1.2: Distance and Diameter

78

the union of two disjoint complete graphs and a path that has one endpoint (and no other vertex) in each of them. It is easy to compute D(G)
on double kites. They also conjectured the yet stronger result that in the
upper bound one need only consider forests whose components are paths.
Finally, we present Chung s proof. It uses a completely different inductive approach, deleting a vertex with small average distance to the
other vertices. The case analysis is surprisingly difficult.
1.2.37.* THEOREM. (Chung [1988]) If G is an n-vertex connected graph,
then D(G) (G), with equality only for K n .

Proof: We use induction on n. The claim holds for n = 2. Suppose that


n > 2. We may assume that G 6= K n .
Counting all distances twice yields 2D(G) = uV(G)(n 1)f(u),
where f(u) = n1 1 v6=u d(u , v) is the average distance from u to other vertices. Since D(G) = D(G)/(n2) = 1n f(u), we may choose w with f(w)
D(G).
Let a = D(G) f(w), and let Dw(G) = D(G) (n 1)f(w) be the
sum of distances in G not involving w. The average contribution (using
distances in G) is Dw(G) = Dw(G)/(n2 1). Since
(2n)D(G) = D(G) = Dw(G) + (n 1)f(w) = Dw(G) + (n 1)(D(G) a) ,

we conclude that D(G) = Dw(G) 2a/(n 2).


Case 1: G = G w is connected. We apply the induction hypothesis
to G to obtain (G ) D(G ). Deleting w cannot create a shorter u , vpath or a larger stable set. Because the average distance involving w is
at most the average distance overall, Dw(G) D(G). These observations
yield
(G) (G ) D(G ) Dw(G) D(G).
If G 6= K n , then (G) 2. We obtain (G) > D(G) because equality requires (G ) = D(G ), which by the induction hypothesis requires G =
K n1 and (G ) = 1 < (G).
Case 2: f(w) D(G) 1, and G is disconnected. Let G have k components G 1 , . . . , G k , with orders n1 , . . . , nk . We will form a connected
graph G by adding edges to G , but the constructions for k = 2 and k
3 are different. By applying the induction hypothesis to G , it suffices to
construct G so that (G) (G ) + k 1 and that D(G) < D(G ) + k 1.
Let Wi = NG(w) V(G i), and let Ui = {x V(G i): d G(x , w) = 2}. If
w Wi , then w w yields f(w) f(w) + 1 D(G), and hence by Case
1 we may assume that G w is disconnected. This implies that each Ui

79

Chapter 1: Trees and Distance

is nonempty. Form G by adding edges for each i 6= j to make Wi Wj


and Wi Uj and, in the case k 3 only, Ui Uj .
Let S be a maximum stable set in G . If k = 2, then S {w} is a
stable set in G unless S has a neighbor of w, in which case a neighbor
of w from the other component of G can be added. If k = 3, then S has
vertices from Wi Ui for at most one value of i, and a vertex from Wj for
each j 6= i can be added to enlarge S in G. In each case, we have (G)
(G ) + k 1.
v
u

k=2
G

k3

The construction of
provides shortcuts for paths connecting vertices from different components of G . Distance between vertices of the
same component is unchanged. We have d G(u , v) d G (u , v) + min{3 , k}
when u , v belong to different components of G . With = min{3 , k}, we
have Dw(G) D(G ) + i< j ni nj . The summation is maximized when
ni = (n 1)/k for all i (Exercise 15), where it equals
Our formula for D(G) and our hypothesis that a 1 now yield
k1 (n1)2
k
2 .

D(G) = Dw(G) 2 na 2 D(G ) + kn12 [ nk 1 k2 1 ].

We further compute nk 1 k2 1 = nk2 + k2 k2 1 < nk2 . Whether


= 2 (which requires k = 2) or = 3 (which requires k 3), this fraction
is at most n 2. We conclude that D(G) < D(G ) + k 1, as desired.
Henceforth we may assume that f(v) > D(G) 1 for every v V(G).
Case 3: diam G 2 D(G) 1. Let s = D(G) , and let u be a vertex
of maximum eccentricity, with (u) 2s1. Let Vi = {x V(G): d(u , x) =
i}. If | i j | > 1, then there are no edges between Vi and Vj . Hence a maximum stable set I0 among vertices with even distance from u consists of a
maximum stable set from each V2k . Similarly define I1 to be a maximum
stable set among vertices with odd distance from u. Each Vi contributes
to I0 or I1 , so | I0 | + | I1 | 1 + (u) (with equality only when each Vi is a
clique), and (G) (1 + (u))/2 . If (u) 2s, then (G) s + 1 > D(G).
Hence we may assume that (u) = 2s 1, that (G) = s = D(G) , and
that each Vi is a clique. Let ni = | Vi |.
We complete this case by showing that these restrictions require
D(G) < s. First we modify G without decreasing D(G). Since each Vi
is a clique, the distance between x Vi and y Vj is always j i or

Section 1.2: Distance and Diameter

80

j i + 1, for i < j . Furthermore, for each y Vj there is at least one


x Vi where the lower value holds. Hence the contribution to D(G) from
each pair of cliques is maximized when there is a vertex x i Vi such that
N(y) Vi = {x i} for all y Vi+1 , as illustrated below. Let Vk = Vk {xk }.
If nk > 1 for some 2 k < 2s 1, consider v Vk . If we move v to Vk+1 ,
k
2s1
then the distance sum gains 2 + i=0 ni i=k+1 ni . If we move v to
2s

1
k

1
Vk1 , then the gain is i=k ni i=0 ni . At least one of these is positive;
if we make the change in a direction that gains, then continuing to push
the vertex in the same direction will gain even more. Hence we may assume that ni = 1 for 2 i < 2s 1 and i = 0. Further shifts show that
D(G) is maximized when | V1 | = | V2s1 |. We now obtain an upper bound
by assuming two cliques of size (n 1)/2 at distance 2s 2. This yields
D(G) < s 1/2.
u

2s 1

Case 4: diam (G) 2 D(G) 2 and f(v) > D(G) 1 for all v V(G).
Again let s = D(G) . Among all w with f(w) D(G), choose one with
minimum eccentricity t, and among these choose one for which the number of vertices at maximum distance is smallest. We have t f(w) >
D(G) 1. Since s , t are both integers, this implies t s. If Case 1 does
not apply, then w is a cut-vertex. Let F be a component of G w containing
a vertex u at distance t from w, and let H be the union of the remaining
components. For any x V(H), we have d(w , x) (diam G) t s 2.
Let Vi = {x V(F): d(w , x) = i}. Let Si and S be maximum stable
sets in G[Vi ] and H w, respectively. Let I0 = j S2 j , and let I1 = S
(j S2 j +1). Both I0 and I1 are stable sets. We claim that | I0 | + | I1 | 2s +
1, which implies that (G) s + 1 > D(G). From a shortest w , u-path,
choose the vertex z such that d(z , u) = s 1; we consider two subcases.
Subcase 4a. (z) > s. Suppose that z Vr , where t = r + s 1. Treating Vt+1 as a clique of size 0, let a , b be the least nonnegative integers such
that Vr+ a and Vrb are cliques. Let v be a vertex at distance s + 1 from
z. We have v V(F), since v V(H) yields d(u , v) = d(u , z) + d(z , v) =
2s > diam G. Let q = d(w , v), so v Vq . For each y Vj with j r + a,
we have d(z , y) 1 + d(z , u) s; hence q < r + a. If q < r b, then
d(u , v) d(u , z) + d(z , v) 1 2s 1 > diam G; hence r b q < r + a.
Using a z , v-path through Vrb yields s + 1 = d(z , v) b + 1 + (b + a 1);
this improves to s + 1 2b + a 1 if r b = 0. Now we use | Sj | 2 for

81

Chapter 1: Trees and Distance

r b < j < r + a, | Sj | 1 for r + a j t = r + s 1, and | S| 1. If


r b = 0, this yields

| I0 | + | I1 | 2(a + b 1) + (s a) + 1 = s + 2b + a 1 2s + 1 .

If r b > 0, then we only know that 2b + a 1 s, but we add | S0 | = 1


to again obtain | I0 | + | I1 | 2s + 1.
H

rb

r+a

Subcase 4b. (z) s. Since f(z) (z), we have f(z) s D(G).


Hence the minimality of f(w) implies (z) = s = t. Let U = {u
V(G): d(u , z) = s}. Since s = t, we have z w, and hence every vertex of
U has distance s 1 or s from w. If d(u , w) = s for all u U , then there
are fewer vertices at maximum distance from z than from w; this contradicts the choice of w. Hence we may choose v U with d(v, w) = s 1.
Now each Vi for 1 i s 1 contains a stable 2-set, consisting of a vertex on a shortest w , v-path and a vertex on a shortest w , u-path. Together
with w and a vertex of S, we again obtain | I0 | + | I1 | 2s + 1.

v
w u
z

DIAMETER OF SPECIAL CL ASSES


As models of communication networks for distributed processing, researchers have sought vertex-transitive graphs or digraphs with fixed
degree to achieve small diameter. Vertex-transitivity allows the same
routing or processing algorithm to be used at each node. Hypercubes are
vertex-transitive and have diameter logarithmic in the number of vertices, but the degree is also logarithmic.
Circulant graphs and digraphs have been most studied with this objective. Let V(G) = Zn , and specify edge lengths s1 , . . . , sk . The resulting graph G(n; s1 , . . . , sk) has edges (i , i + s j) for all i Zn and j [k].
These are called Distributed Loop Networks in the survey Bermond
ComellasHsu [1995]. The values {si} are called steps.
Let d(n; s1 , . . . , sk) = diam (G(n; s1 , . . . , sk)) (viewed as a graph or digraph), and let d(n; s1 , . . . , sk) = D(G(n; s1 , . . . , sk)). Also let dk(n) and
dk (n) minimize these quantities over all n-vertex loop networks with k

Section 1.2: Distance and Diameter

82

steps. For k = 2, WongCoppersmith [1974]


obtained reasonably good di
graphs by using s1 = 1 and s2 about n; this produces diameter about

2 n and mean distance about n (Exercises 6263). Usually we assume


s1 = 1, although that is not always optimal. By exhaustive search,
AlegreValero [1987] found that the smallest n such that d2(n) is not
achieved with s1 = 1 is 450 (directed case); d2(450) = d(450; 2 , 185).
(WongCoppersmith
[1974]) In the directed case,
1.2.38. THEOREM.

d2(n) 3n 2 and d2(n) 95 ( 3n 1).

This lower bound is achievable for infinitely many n (Exercise 62).


D 1
From the Moore bound n 1 + i=0 k(k 1)i on the number of vertices in an undirected k-regular graph with diameter D, the diameter of
a k-regular graph with n vertices is at least (logk1 n) 2/k. A random
k-regular graph almost always has diameter O(logk1 n) (Bollobas-de
la

[1988] proved that a random cubic graph


Vega [1982]). BollobasChung

obtained by adding a random complete matching to a cycle almost always


has diameter O(lg n).

EXERCISES
1.2.1. () Let G be a graph with rs vertices that decomposes into rK s and sK r .
Prove that G
= K r K s . Construct infinitely many examples to prove that in
general a graph with rs vertices that is not isomorphic to F H may decompose
into sF and rH , where r = | V(F)| and s = | V(H)| ,

1.2.2. () Count the isomorphism classes of n-vertex trees with diameter 3.

1.2.3. () Let G be a tree with n vertices, k leaves, and maximum degree k. Determine the minimum and maximum values of diam G (in terms of n and k).
1.2.4. () Prove that K1 Pn1 has a spanning tree with diameter k whenever
2 k n 1.
1.2.5. () Let u and v be vertices in a connected n-vertex graph. Prove that if
d(u , v) > 2, then d(u) + d(v) n + 1 d(u , v). Construct examples to show that
this can fail whenever n 3 and d(u , v) 2.

1.2.6. () Use a triangle with edges of weights 5, 4, and 3 to show that Dijkstras Algorithm may fail when the edge weights are not all nonnegative.
1.2.7. () Prove that (G) 12 (1 + diam G) for every graph G.

1.2.8. () Prove that diam(G 2) = diam(G)/2 for every graph G (recall that
xy E(G 2) if and only if d G(x , y) 2 Definition 0.58).

83

Chapter 1: Trees and Distance

1.2.9. () Prove that every connected graph G with a cycle has girth at most
2diam(G) + 1.
1.2.10. () Prove that the center of a tree T consists one vertex if and only if its
diameter is twice its radius. Conclude that if | V(T)| is odd, then every automorphism of T maps some vertex to itself.
1.2.11. () Find the minimum radius among the spanning trees of the kdimensional hypercube Qk .
1.2.12. () Determine the average distance between points in the k-dimensional
hypercube Qk (averaged over all pairs of points).

1.2.13. () There are five cities in a network. The travel time for traveling directly from i to j is the entry ai , j in the matrix below. The matrix is not symmetric (use directed graphs), and ai , j = indicates that there is no direct route.
Determine the least travel time and quickest route from i to j for each pair i , j .

0
7
14

23

10
0
13

20
5
0
17
15 12

17
22 33
15 27

0 10
8
0

1.2.14. () Let G be an n-vertex graph, and let G be obtained from G by appending a leaf x. Let s be the sum of the distances in G from x to the other vertices
of G . Prove that D(G) > D(G) if and only if s > nD(G).
1.2.15. () Let n1 , . . . , nk be nonnegative and have sum m. Prove that i6= j ni nj
is maximized when ni = m/k for all i.

1.2.16. Let P be a maximal path in a graph G, and let x and y be the endpoints
of P. Prove that if d(x , y) > 2, then d(x , y) l + 2 d(x) d(y), where l is the
length of P. (Tracy [2000])

Section 1.2: Distance and Diameter

84

1.2.20. Given a starting vertex u in an unweighted graph or digraph G, prove directly (without Dijkstras Algorithm) that the BFS algorithm (Algorithm 1.2.9)
computes d(u , z) for every z V(G).

1.2.21. Minimum diameter spanning tree. An MDST is a spanning tree of G having smallest diameter.
a) Prove that in the unweighted case (edge-weights 1), a spanning tree is an
MDST if and only if it arises by running Dijkstras Algorithm from a vertex of
minimum eccentricity. (Note: when there are multiple candidates with the same
distance from the root , the choice of the new vertex can be made arbitrarily.)
b) Construct a 4-vertex weighted graph G such that the MDST cannot be
obtained by running Dijkstras Algorithm from any vertex.
1.2.22. Prove that diam G > 3 implies diam G < 3.
1.2.23. Prove that there is a 16-vertex 5-regular graph with diameter 2.

1.2.24. A graph is diameter-maximal if for every nonadjacent pair of vertices,


adding an edge joining them decreases the diameter. Prove that a graph G is
diameter-maximal if and only if for each vertex u of maximum eccentricity, each
vertex v is adjacent to all vertices whose distance from u differs from d(u , v) by
at most 1. (Hint: For the proof of sufficiency, show that there are exactly two
vertices of maximum eccentricity.) (Ore [1968])
1.2.25. () For 2 d < n, determine the maximum number of edges in an nvertex graph having diameter at least d. (Ore [1968])

1.2.26. Prove that the following algorithm finds the diameter of a tree. First ,
run breadth-first search from an arbitrary vertex w to find a vertex u farthest
from w. Next , run breadth-first search from u to reach a vertex v farthest from
u. Report diam T = d(u , v). (CormenLeisersonRivest [1990, p476])

1.2.27. The Kneser graph K(n , k) is the graph on vertex set ([n]
where vertices
k )
are adjacent if and only if they are disjoint. Prove that diam(K(n , k)) = 2 if n
3k 1. Determine the girth and diameter of K(2k + 1 , k). (Comment: In general,
1
diam (K(n , k)) = nk2k
+ 1; see Valencia-Pabon & Vera [2005].)

1.2.17. Let u be a vertex in a connected graph G. Without using Dijkstras Algorithm, prove that there exist shortest paths from u to all vertices of G such that
the union of the paths is a tree.

1.2.28. Construct a graph where the center consists of two vertices and the distance between these two vertices is k. (Comment: Thus the center of a graph can
be a disconnected set inducing components arbitrarily far apart.)

1.2.18. () Because every spanning tree has at least two leaves, a connected graph
G with at least three vertices has two vertices x and y such that G {x , y} is connected. Strengthen this by proving that x and y can be chosen so that the distance
between them is at most 2. (Chung [1978])

1.2.29. Prove that if G has no chordless cycle and its diameter is twice its radius,
then the center of G is a clique.

1.2.19. The shortcut to Dijkstras Algorithm for a single distance d(x , y) is to


run Dijkstras Algorithm from x and y independently, stopping when the distance from each is known to some single vertex u, concluding that d(x , y) =
d(x , u) + d(y , u). Provide an example to prove that this may not compute d(x , y)
correctly. Obtain a valid stopping rule so that d(x , y) will be computed correctly.

1.2.30. Radius and eccentricity. Consider a graph G with radius r.


a) Prove that the eccentricity of adjacent vertices differs by at most 1.
b) Given (x) = r + 1, determine the maximum possible distance (in terms of
r) from x to the center of G.
1.2.31. Let G be a tree. Prove that 2 G(v) G(x) + G(y) if x and y are distinct neighbors of v. Determine the smallest graph in which eccentricity fails
this property at some vertex.

85

Chapter 1: Trees and Distance

1.2.32. Let x be a vertex outside the center of a graph G.


a) Prove that if G is a tree, then x has a neighbor with eccentricity (x) 1.
b) Show that part (a) does not hold for all graphs by constructing, for each
even r that is at least 4, a graph with radius r in which x has eccentricity r + 2
and has no neighbor with eccentricity r + 1. (Hint: Use a graph with one cycle.)
1.2.33. The barycenter of a graph is the set of vertices at which s(x) =
y d(x , y) is minimized.
a) Let G be a tree. Prove that 2s(x) < s(y) + s(z) if y , z N(x), and conclude
that the barycenter of a tree is a vertex or two adjacent vertices.
b) Determine the maximum distance between the center and the barycenter
for trees of diameter d. For d 4, determine the minimum number of vertices
in a tree of diameter d achieving this maximum distance.
1.2.34. Prove that any tree T has a vertex v such that for all e E(T), the component of T e containing v has at least half the vertices of T . Prove that either
v is unique or there are just two adjacent such vertices. (JiangWest [2004])

1.2.35. Let X be a set with metric d (distances between distinct elements are
positive and satisfy the triangle inequality). Let V be a finite subset of X (on V
the metric defines an edge weighting). For x X , let s(x) = vV d(x , v), and let
= inf s(x). Let be the sum of the weights in a minimum spanning tree of the
complete graph induced on V .
a) Prove that / 1 if s(x) is minimized by a vertex of V .
b) Prove that / 1/2 always, and that / can be arbitarily close to 1/2.
c) Prove that / can be arbitrarily large. (Demel/Hennebry)

1.2.36. Let G be a connected n-vertex graph. Let T(G) be the graph whose vertices are the spanning trees of G, with vertices adjacent if the trees share n 2
edges. Prove that T(G) is connected, and determine its maximum diameter.
1.2.37. () Prove or disprove: If a graph with diameter 2 has a cut-vertex, then
its complement has an isolated vertex.
1.2.38. Let G be a graph having spanning trees with diameter 2 and diameter l.
For 2 < k < l, prove that G also has a spanning tree with diameter k. (Galvin)

1.2.39. () Let S and T be trees with leaves {x1 , . . . , xk } and {y1 , . . . , yk }, respectively. Suppose that d S(xi , xj ) = d T (yi , yj ) for each pair i , j . Prove that S
and T are isomorphic. (Smolenskii [1962])

1.2.40. () Let G be a connected n-vertex graph with minimum degree k, where


n 3 k 2. Prove that diam G 3 nk+21 1. Prove that the bound is best possible
when k + 1 divides n 2. (Moon [1965b])
1.2.41. A local cut at vertex v in a graph G is a set of size d(v) consisting of the
vertex x or the edge vx for each x N(v). A diameter-increasing set is a set
U V(G) E(G) such that diam(G U) > diam G.
a) Let x and y be vertices of the hypercube Qk , with k 3 and d(x , y) = r.
Prove that Qk contains a family of k paths from x to y such that no two share an
internal vertex, with r paths having length r and k r having length r + 2.

Section 1.2: Distance and Diameter

86

b) Let U be a smallest subset of V(Qk) E(Qk ) whose deletion destroys all


shortest paths joining two antipodal vertices. Prove that U is a local cut at one
of those two vertices.
c) Let U be a smallest diameter-increasing set in Qk , where k 4. Prove
that the diameter of Qk U is k + 1 and that U consists of k 1 elements in a
local cut of Qk . (Ramras [2004])
1.2.42. Determine the minimum number of vertices in a graph in which the minimum length of an even cycle is r and the minimum length of an odd cycle is s.
(Harary-Kovacs [1982])
1.2.43. Let G be a graph having girth g and minimum degree k. Prove that if
k 2, then G contains a cycle of length at least (g 2)(k 1) + 2.

1.2.44. () Let G be an n-vertex graph with m edges and diameter 2. Theorem


1.2.20 states that if (G) < n 4, then m 2n 4.
a) Prove that if (G) {n 3 , n 4}, then m 2n 5. (Hint: Argue that
this bound is already present in the proof of Theorem 1.2.20.)
b) For k {n 3 , n 4}, construct such graphs with 2n 5 edges and maximum degree k. (Hint: Study the proof of Theorem 1.2.20.)
c) For n 4 (mod 5) and k = (3n + 3)/5, construct an n-vertex graph with
6 edges. (Hint: Use four
diameter 2, maximum degree k, and fewer than 12n
5
vertices of high degree.)
d) For n 2 (mod 4) and k = n/2 2, construct an n-vertex graph with diameter 2, maximum degree k, and 3n 15 edges. (Hint: Use six vertices of high
degree.)
(Comment: The constructions in parts (c) and (d) are roughly optimal near
two of the breakpoints in Theorem 1.2.21. In fact , (d) seems to do better than
what should be the lower bound.)
1.2.45. For k in each range below, construct an n-vertex graph with diameter 2,
maximum degree k, and the specified number ofedges.
10 k n 3.
a) 2n 5 + (n 3 k)2 edges when n 3 n
(n
b) 3n 15 edges when 2)/2 k < n 3 n 10.
(Hint: In part (a), modify a 5-cycle. In part (b), modify the Petersen graph. Com[1994] showed that these constructions have the minimum
ment: FurediSeress

28
number of edges when n > 2 2 .)

1.2.46. (+) LetG be a graph of order n with diameter 2 and maximum degree
k,where k = n 1 with > 1. Prove that G has at least n(n 1)/k(1 + x) =
n n 1/( + 1/) edges, where x = (n 1)/k. (Hint: prove that (G) x. Use this
to prove that vV(G) d(v)2 ak 2 + (n a)x2 , where a is defined by ak + (n a)x =
2 | E(G)| . Compare this with the number of ordered paths of length at most two.)
1.2.47. Given that there exists r such that k = r + nr r , construct an n-vertex
graph with diameter 3 and maximum degree k having only n r + (2r ) edges. (Com[1990] showed
ment: Furedi

that this is the minimum possible number of edges


in such a graph when (4/ 3) n 2 < k < n.)

87

Chapter 1: Trees and Distance

1.2.48. For k-regular connected graphs (with k 3), prove that any two of the
d
three properties {diameter d, girth 2d + 1, order 1 + k[(kk1)2 1] } imply the third.
1.2.49. Prove that the 50-vertex HoffmanSingleton graph of Example 1.2.16 is
a Moore graph. (HoffmanSingleton [1960])

1.2.50. A (k , g)-cage is a smallest graph among k-regular graphs with girth g.


a) For k 2 and g 3, prove that a k-regular graph with girth g exists.
(Hint: To construct such a graph inductively, use a (k 1)-regular graph H with
girth g and a graph with girth g/2 that is regular with degree | V(H)|.)
b) Prove that every (k , g)-cage has diameter at most g. (Hint: Consider x , y
V(G) with d G(x , y) > g and modify G appropriately.) (ErdosSachs [1963])
1.2.51. Let d be the diameter and d the oriented diameter of the torus Cm Cn .
a) Prove that d > d if m and n are odd.
b) Prove that d = d + 1 if m = 3 and n is even.

1.2.52. () Let G be a bipartite graph having an orientation of diameter at most


k in which every vertex lies on an l-cycle, where l k. Prove that G K 2 has
an orientation of diameter at most k + 1 in which every vertex lies on an l-cycle.
Prove that for k 4, the oriented diameter of the k-dimensional hypercube Qk is
k. (Hint: for k = 4, view Q4 as C4 C4 .)

1.2.53. Give a short direct proof (without Theorem 1.2.26) that a graph with
radius 1 and no cut-edge has an orientation with radius at most 2 and diameter
at most 4.
2

1.2.54. Prove that the graph G r of Example 1.2.25 has oriented radius r + r. For
each odd d, construct a graph with diameter d and oriented diameter d 2/2 + d.
(KwokLiuWest [2009])
1.2.55. Prove that every strong orientation of the Peterson graph has a consistently directed 5-cycle. Use this to prove that the oriented diameter of the Pe[1978])
tersen graph is 6. (ChvatalThomassen

1.2.56. () The graphs of Example 1.2.25 have cut-vertices. There are highly
connected graphs with oriented diameter almost as bad. The 2-connected graph
G4 ,2 shown below has diameter 4 and oriented diameter at least 8. Prove constructively that there is a k-connected graph G d ,k with diameter d and oriented
[1978])
diameter at least 14 d 2 + d. (ChvatalThomassen

1.2.57. Prove that Theorem 1.2.27 is sharp for k = 3 and k = 4 by constructing in


each case an infinite family of graphs in which every edge belongs to a k-cycle, but
in every orientation there is an edge that does not belong to a directed (h(k) 1)[1978])
cycle. (ChvatalThomassen

Section 1.2: Distance and Diameter

88

1.2.58. Let n1 , . . . , nk be positive integers with sum n 1.


k
a) By counting edges in complete graphs, prove that i=1 ( n2i ) ( n2 1 ).
b) Use part (a) to prove that vV(T) d(u , v) (n2) when u is a vertex of a tree
T . (Hint: Use strong induction on the number of vertices.)

1.2.59. () Determine the maximum and minimum values of the distance-sum


(Wiener index) D(G) for n-vertex trees. Determine the set of trees achieving the
maximum value and the set of trees achieving the minimum value.
1.2.60. Let G be an n-vertex graph with m edges. Let D(G) be the average disn
n1 1 ), and detertance, and let I(G) = vV(G) d(v)1 . Prove that D(G)I(G) n( m
mine when equality holds. (Hint: Use the CauchySchwarz Inequality to prove
that I(G) n2/ d(v). Comment: the special case D(G)I(G) n for trees was
conjectured by GRAFFITI and proved by Zhou [1992] and by Shi [1993]. Moon
[1996] proved the general result and strengthed the bound for trees to D(T)I(T)
2n 4 + 4/n, with equality only for stars and for P4 .)

1.2.61. Let be a real number in (0 , 1/2), and let m = 2 n2 . Construct an


nvertex graph with (1 + o(1))m edges and average distance (1 + o(1))2(1 2) m.
1.2.62. For distributed loop digraphs with two steps, prove that
a) d(t2 ; 1 , t) = 2t 2 and d(t2 ; 1 , t) = t 1. (WongCoppersmith [1974],
RaghavendraGerla [1981])
b) d(3t2 + 3t; 1 , 3t + 2) = 3t. (HwangXu [1987], ErdosHsu [1992])

) has diameter D. Prove


1.2.63. In the undirected case, suppose that G(n; s1 , s2
that n 2D2 + 2D + 1, and conclude that d 2(n) ( 2n 1 1)/2. (Wong
[1974]). Prove
Coppersmith
the optimality of this bound by letting s1 =

( 2n 1 1)/2 and s2 = ( 2n 1 + 1)/2 . (BermondIlliadesPeyrat [1985],


BoeschWang [1985], YebraFiolMorilloAlegre [1985])

1.2.64. (+) Let G be a weighted digraph in which for each v V(G) the total weight on edges leaving v is at least 1. Prove that G has a path with total
weight at least 1. (Hint: prove the stronger result that the conclusion still holds
even when one vertex is allowed to have out-weight less than 1.) (BollobasScott

[1996])

S-ar putea să vă placă și