Chapter three In many real-life situations we need to know how robust a graph that represents a certain network is, how edges or vertices can be removed without completely destroying the overall connectivity, for example, a network of connected computers (like the Internet) where all communication must go through a specific connection or central computer is more vulnerable than a network where every two computers are connected via several distinct computers or connections. Also, is there a circuit or trial in the graph that spans or covers all of the edges of the graph? Is there a simple path or a cycle that covers all the vertices of the graph? We start considering the first question in detail, a question that prompted Euler to write the first paper on graph theory, as we mentioned in Chapter one. Euler asked and solved a more general question namely, what type of a connected graph has a circuit that contains all of the edges of the graph? As for Eulerian graphs, the original question about a round trip in the graph G, visiting each vertex once, is also due to a well-known Irish mathematician, Sir William Rowan Hamilton. This is precisely the main theme of this chapter. 3.1 Cutvertices, Bridges, and Blocks Two vertices and of are said be connected if there is a path in. Connection is an equivalence relation on the vertex set. Thus, there is a partition of into nonempty subsets such that two vertices and are connected if and only if and belong to the same set. The induced subgraphs are called components of. If has exactly one component, is connected; otherwise is disconnected. We denote the number of components of by. 36
Figure 3.1 Consider now, four connected graphs of Figure 3.1. is a minimal connected graph; deleting any edge disconnected it. cannot be disconnected by deletion of a single edge, but can be disconnected by deletion of one vertex, its vertex cut vertex. There are no cut edges or cut vertex in, but even so is clearly not as well connected as, the complete graph on five vertices. Thus, intuitively, each successive graph is more strongly connected than the previous one. We shall now introduce to some definitions A cutvertex of a graph is one whose removal increases the number of components, and a bridge is (cut edge) such an edge. Thus if is a cutvertex of a connected graph, then is disconnected. A nonseparable graph is connected, nontrivial, and has no cutvertices. A block of a graph is a maximal nonseparable subgraph. If itself is often called a block. is nonseparable, then A graph is a critical block if is a block and for every vertex the graph is not a block. Hence a block is a non-critical if and only if there exists a vertex of G such that is also a block. A graph is a minimal block if is a block and for every edge the graph is not a block 37
Figure 3.2: A graph and its blocks In Figure 3.2, is a cutvertex while is not; is a bridge but is not; and the four blocks of are displayed. Each edge of a graph lies in exactly one of its blocks, as does each vertex which is not isolated or a cutvertex. Furthermore, the edges of any cycle of also lie entirely in a single block. Thus, in particular, the blocks of a graph partition its edges and its cycles regarded as sets of edges. The first three theorems of this section present several equivalent conditions for each of these concepts. Theorem 3.1.1. Let be a vertex of a connected graph. The following statements are equivalent: (1) is a cutvertex of. (2) There exist vertices and distinct from such that is on every path. (3) There exists a partition of the set of vertices into subsets and such that for any vertices and, the vertex is on every path. Proof. (1) implies (3) Since is a cutvertex of, is disconnected and has at least two components. Form a partition of by letting consist of the vertices of one of these components and the vertices of the others. Then any two vertices and lie in different components of. Therefore every path in contains. 38
(3) implies (2) This is immediate (since is a special case of ). 2) implies 1) If is on every path in joining and, then there cannot be a path joining these vertices in. Thus is disconnected, so is a cutvertex of. Theorem 3.1.2. Let be a edge of a connected graph. The following statements are equivalent: (1) is a bridge of (2) is not on any cycle of. (3) There exist vertices and v of such that the edge is on every path joining and (4) There exists a partition of into subsets and such that for any vertices and the edge is on every path joining and. Theorem 3.1.3. Let be a connected graph with at least three vertices. The following statements are equivalent: (1) is a block. (2) Every two vertices of lie on a common cycle. (3) Every vertex and edge of lie on a common cycle. (4) Every two edges of lie on a common cycle. (5) Given two vertices and one edge of, there is a path joining the vertices which contains the edge. (6) For every three distinct vertices of, there is a path joining any two them which contains the third. (7) For every three distinct vertices of, there is a path joining any two of them which does not contain the third. Proof. (1) implies 2) Let and be distinct vertices of, and let be the set of vertices different from which lie on a cycle containing. Since has at least three vertices and no cutvertices, it has no bridges; therefore, every vertex adjacent to is in, so is not empty. 39
Figure 3.3: Paths in blocks Suppose is not in. Let w be a vertex in for which the distance is minimum. Let be a shortest path, and let and be the two paths of a cycle containing and (see Figure 3.3 a). Since w is not a cutvertex, there is a path P' not containing w (see Figure 3.3 b). Let w' be the vertex nearest in P' which is also in, and let u' be the last vertex of the subpath of ' in either or. Without loss of generality, we assume ' is in. Let be the ' path consisting of the ' subpath of and the subpath. Let be the path consisting of followed by the subpath of. Then and are disjoint paths. Together they form a cycle, so w' is in. Since ' is on a shortest path, ). This contradicts our choice of, proving that and do lie on a cycle. (2) implies (3) Let be a vertex and an edge of. Let be a cycle containing and A cycle ' containing and can be formed as follows. If w is on, then ' consists of together with the path of containing u. If is not on, there is a path not containing since otherwise would be a cutvertex by Theorem 3.1.1 Let ' be the first vertex of in. Then ' consists of followed by the subpath of and the path in containing. (3) implies (4) This proof is analogous to the preceding one, and the details are omitted. (4) implies (5) Any two vertices of are incident with one edge each, which lie on a cycle by (4). Hence any two vertices of lie on a cycle, and we have (2), so also (3). Let and be distinct vertices and a edge of. By statement 3), there are cycles containing and, and containing and. lf is on or is on, there is clearly a path joining and containing. Thus, we need only consider the case where is not on and is not on. Begin with and proceed along until reaching the 40
first vertex of, then take the path on joining and which contains. This walk constitutes a path joining and that contains. (5) implies (6) Let and w be distinct vertices of G, and let x be any edge incident with. By (5), there is a path joining and which contains, and hence must contain. (6) implies (7) Let,, and be distinct vertices of. By statement (6), there is a path containing. The subpath of does not contain w. (7) implies (1) By statement (7), for any two vertices and, no vertex lies on every path. Hence, must be a block. Theorem 3.1.4. Every nontrivial connected graph has at least two vertices which are not cutvertices. Proof. Let and be vertices at maximum distance in, and assume is a cutvertex. Then there is a vertex w in a different component of than. Hence is in every path joining and, so which is impossible. Therefore, and similarly are not cutvertices of. 3.2 Block graphs and cutvertex graphs There are several intersection graphs derived from a graph which reflect its structure. If we take the blocks of as the family of sets, then the intersection graph is the block graph of, denoted by The blocks of correspond to the vertices of ) and two of these vertices are adjacent whenever the corresponding blocks contain a common cutvertex of. On the other hand, to obtain a graph whose vertices correspond to the cutvertices of, we can take the sets to be the union of all blocks which contain the cutvertex. The resulting intersection graph is called the cutvertex graph, Thus two vertices of are adjacent if the cutvertices of to which they correspond lie on a common block. Note that is defined only for graphs which have at least one cutvertex. Figure 3.4 illustrates these concepts, which were introduced in. 41
Figure 3.4 Theorem 3.2.1 A graph H is the block graph of some graph if and only if every block of is complete. Proof. Let and assume there is a block of which is not complete. Then there are two vertices in which are nonadjacent and lie on a common cycle of length at least 4. But the union of the blocks of corresponding to the vertices of which lie on is then connected and has no cutvertex, so it is itself contained in a block, contradicting the maximality property of a block of a graph. On the other hand, let be a given graph in which every block is complete. Form and then form a new graph by adding to each vertex of a number of end edges equal to the number of vertices of the block which are not cutvertices of Then it is easy to see that is isomorphic to. 3.3 Eulerian graphs A connected graph is Eulerian if there exists a closed trail containing every edge of. Such a trail is an. Note that this definition requires each edge to be traversed once and once only. A non-eulerian graph is if there exists a trail containing every edge of. Figs 3.5, 3.6 and 3.7 show graphs that are Eulerian, semi-eulerian and non-eulerian, respectively. 42
Figure 3.5 Figure 3.6 Figure 3.7 Problems on Eulerian graphs frequently appear in books on recreational mathematics. A typical problem might ask whether a given diagram can be drawn without lifting one's pencil from the paper and without repeating any edges. The name 'Eulerian' arises from the fact that Euler was the first person to solve the famous Konigsberg bridges problem which asks whether you can cross each of the seven bridges in Chapter 1 exactly once and return to your starting point. This is equivalent to asking whether the graph in Figure 3.8 has an Eulerian trail. A translation of Euler's paper, and a discussion of various related topics, may be found in Biggs, Lloyd and Wilson. Figure 3.8 One question that immediately arises is can one find necessary and sufficient conditions for a graph to be Eulerian?. Before answering this question in Theorem 3.3.2, we prove a simple lemma. Lemma 3.3.1 If contains a cycle. is a graph in which the degree of each vertex is at least 2, then Praoof. If has any loops or multiple edges, the result is trivial. We can therefore suppose that is a simple graph. Let be any vertex of. We construct a walk inductively by choosing to be any vertex adjacent to and, for each, choosing to be any vertex adjacent to except ; the existence of 43
such a vertex is guaranteed by our hypothesis. Since has only finitely many vertices, we must eventually choose a vertex that has been chosen before. If is the first such vertex, then that part of the walk lying between the two occurrences of required cycle. is the Theorem 3.3.2 (Euler 1736). A connected graph of each vertex of is even. is Eulerian if and only if the degree Proof. Suppose that is an Eulerian trail of. Whenever passes through a vertex, there is a contribution of 2 towards the degree of that vertex. Since each edge occurs exactly once in, each vertex must have even degree. The proof is by induction on the number of edges of. Suppose that the degree of each vertex is even. Since is connected, each vertex has degree at least 2 and so, by Lemma 3.3.1, contains a cycle. If contains every edge of, the proof is complete. If not, we remove from the edges of to form a new, possibly disconnected, graph with fewer edges than and in which each vertex still has even degree. By the induction hypothesis, each component of has an Eulerian trail. Since each component of has at least one vertex in common with, by connectedness, we obtain the required Eulerian trail of by following the edges of until a non-isolated vertex of is reached, tracing the Eulerian trail of the component of that contains that vertex, and then continuing along the edges of until we reach a vertex belonging to another component of, and so on. The whole process terminates when we return to the initial vertex (see Figure 3.9). This proof can easily be modified to prove the following two results. We omit the details. H C H Figure 3.9 44
Corollary 3.3.3 A connected graph is Eulerian if and only if its set of edges can be split up into disjoint cycles. Corollary 3.3.4 A connected graph is semi-eulerian if and only if it has exactly two vertices of odd degree. Note that, in a semi-eulerian graph, any semi-eulerian trail must have one vertex of odd degree as its initial vertex and the other as its final vertex. Note also that, by the handshaking lemma, a graph cannot have exactly one vertex of odd degree. We conclude our discussion of Eulerian graphs with an algorithm for constructing an Eulerian trail in a given Eulerian graph. The method is known as Fleury's algorithm. Theorem 3.2.5 Let be an Eulerian graph. Then the following construction is always possible, and produces an Eulerian trail of. Start at any vertex u and traverse the edges in an arbitrary manner, subject only to the following rules: (i) erase the edges as they are traversed, and if any isolated vertices result, erase them too; (ii) at each stage, use a bridge only if there is no alternative. Proof. We show first that the construction can be carried out at each stage. Suppose that we have just reached a vertex. If, then the subgraph that remains is connected and contains only two vertices of odd degree, u and. To show that the construction can be carried out, we must show that the removal of the next edge does not disconnect - or, equivalently, that is incident with at most one bridge. But if this is not the case, then there exists a bridge such that the component of containing w does not contain (see Figure 3.10). Since the vertex w has odd degree in. Some other vertex of must also have odd degree, giving the required contradiction. If, the proof is almost identical, as long as there are still edges incident with u. 45
u K w H v Figure 3.10 It remains only to show that this construction always yields a complete Eulerian trail. But this is clear, since there can be no edges of remaining untraversed when the last edge incident to is used, since otherwise the removal of some earlier edge adjacent to one of these edges would have disconnected the graph, contradicting (ii). 3.4 Hamiltonian graphs In the previous section we discussed whether there exists a closed trail that includes every edge of a given connected graph. A similar problem is to determine whether there exists a closed trail passing exactly once through each vertex of. Note that such a trail must be a cycle, except when is the graph. Such a cycle is a Hamiltonian cycle and is a Hamiltonian graph. A non-hamiltonian graph is semi-hamiltonian if there exists a path passing through every vertex. Figures 3.11, 3.12 and 3.13 show graphs that are Hamiltonian, semi-hamiltonian and non-hamiltonian, respectively Figure 3.11 Figure 3.12 Figure 3.13 46
The name 'Hamiltonian cycle' arises from the fact that Sir William Hamilton investigated their existence in the dodecahedron graph, although a more general problem had been studied earlier by the Rev. T.P. Kirkman. Such a cycle is shown in Figure 3.14, with heavy lines denoting its edges. Figure 3.14 In Theorem 3.3.2 and Corollary 3.3.3 we obtained necessary and sufficient conditions for a connected graph to be Eulerian, and we may hope to obtain similar characterizations for Hamiltonian graphs. As it happens, the finding of such a characterization is one of the major unsolved problems of graph theory! In fact, little is known in general about Hamiltonian graphs. Most existing theorems have the form, if has enough edges, then is Hamiltonian. Probably the most celebrated of these is due to G.A. Dirac, and known as Dirac's theorem. We deduce it from the following more general result of O. Ore. Theorem 3.4.1 (Ore, 1960). If is a simple graph with ( 3) vertices, and if for each pair of non-adjacent vertices v and w, then is Hamiltonian. Proof. We assume the theorem false, and derive a contradiction. So let be a non- Hamiltonian graph with vertices, satisfying the given condition on the vertex degrees. By adding extra edges if necessary, we may assume that is 'only just' non- Hamiltonian, in the sense that the addition of any further edge gives a Hamiltonian graph. (Note that adding an extra edge does not violate the condition on the vertex 47
degrees.) It follows that contains a path passing through every vertex. But since is non-hamiltonian, the vertices and are not adjacent, and so. It follows that there must be some vertex adjacent to with the property that is adjacent to (see Figure 3.15). But this gives us the required contradiction since is then a Hamiltonian cycle. Figure 3.15 Corollary 3.4.2 (Dirac, 1952). If is a simple graph with n ( 3) vertices, and if for each vertex, then is Hamiltonian. Proof. The result follows immediately from Theorem 3.4.1, since for each pair of vertices v and w, whether adjacent or not. 48