Definitions and Examples
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 1 Definitions and examples I hate definitions! Benjamin Disraeli In this chapter, we lay the foundations for a proper study of graph theory. Section 1.1 formalizes some of the graph ideas in the Introduction, Section 1.2 provides a variety of examples, and Section 1.3 presents two variations on the basic idea. In Section 1.4 we show how graphs can be used to represent and solve three problems from recrea- tional mathematics. More substantial applications are deferred until Chapters 2 and 3, when we have more machinery at our disposal. 1.1 Definitions A simple graph G consists of a non-empty finite set V(G) of elements called vertices (or nodes or points) and a finite set E(G) of distinct unordered pairs of distinct elements of V(G) called edges (or lines). We call V(G) the vertex-set and E(G) the edge-set of G. An edge {v, w} is said to join the vertices v and w, and is usually abbreviated to vw. For example, Fig. 1.1 represents the simple graph G whose vertex-set V(G)is {u, v, w, z}, and whose edge-set E(G) consists of the edges uv, uw, vw and wz. In any simple graph there is at most one edge joining a given pair of vertices. However, many results for simple graphs also hold for more general objects in which two vertices may have several edges joining them; such edges are called multiple edges. In addition, we may remove the restriction that an edge must join two distinct vertices, and allow loops – edges joining a vertex to itself. The resulting object, with loops and multiple edges allowed, is called a general graph – or, simply, a graph (see Fig. 1.2). Note that every simple graph is a graph, but not every graph is a simple graph. Figure 1.1 Figure 1.2 1.1 Definitions 9 Thus, a graph G consists of a non-empty finite set V(G) of elements called vertices and a finite family E(G) of unordered pairs of (not necessarily distinct) elements of V(G) called edges; the use of the word ‘family’ permits the existence of multiple edges. We call V(G) the vertex-set and E(G) the edge-family of G. An edge {v, w} is said to join the vertices v and w, and is again abbreviated to vw. Thus in Fig. 1.2, V(G) is the set {u, v, w, z} and E(G) consists of the edges uv, vv (twice), vw (three times), uw (twice) and wz. Note that each loop vv joins the vertex v to itself. Although we sometimes need to restrict our attention to simple graphs, we shall prove our results for general graphs whenever possible. Remark. The language of graph theory is not standard – all authors have their own terminology. Some use the term ‘graph’ for what we call a simple graph, while others use it for graphs with directed edges, or for graphs with infinitely many vertices or edges; we discuss these variations in Section 1.3. Any such definition is perfectly valid, provided that it is used consistently. In this book: All graphs are finite and undirected, with loops and multiple edges allowed unless specifically excluded. Isomorphism Two graphs G1 and G2 are isomorphic if there is a one–one correspondence between the vertices of G1 and those of G2 such that the number of edges joining any two vertices of G1 equals the number of edges joining the corresponding vertices of G2. For example, the two graphs in Fig. 1.3 are isomorphic, under the correspondence u 3 l, v 3 m, w 3 n, x 3 p, y 3 q, z 3 r. Figure 1.3 For many problems, the labels on the vertices are unnecessary and we drop them. We then say that two ‘unlabelled graphs’ are isomorphic if we can assign labels to their vertices so that the resulting ‘labelled graphs’ are isomorphic. For example, we regard the unlabelled graphs in Fig. 1.4 as isomorphic, since the labelled graphs in Fig. 1.3 are isomorphic. The difference between labelled and unlabelled graphs becomes more apparent when we try to count them. For example, if we restrict ourselves to graphs with three vertices, then there are eight different labelled graphs (see Fig. 1.5), but only four 10 Definitions and examples Figure 1.4 Figure 1.5 Figure 1.6 unlabelled ones (see Fig. 1.6). It is usually clear from the context whether we are referring to labelled or unlabelled graphs. Connected graphs We can combine two graphs to make a larger graph. If the two graphs are G1 and G2 ʜ and their vertex-sets V(G1) and V(G2) are disjoint, then their union G1 G2 is the ʜ ʜ graph with vertex-set V(G1) V(G2) and edge-family E(G1) E(G2) (see Fig. 1.7). Most of the graphs discussed so far have been ‘in one piece’. A graph is connected if it cannot be expressed as a union of graphs, and disconnected otherwise. Clearly, any disconnected graph G can be expressed as the union of connected graphs, each of which is called a component of G; a disconnected graph with three components is shown in Fig. 1.8. Figure 1.7 1.1 Definitions 11 Figure 1.8 When proving results about graphs in general, we can often obtain the correspond- ing results for connected graphs and then apply them to each component separately. A table of all the unlabelled connected simple graphs with up to five vertices is given in Fig. 1.9. Figure 1.9 12 Definitions and examples Adjacency and degrees We say that two vertices v and w of a graph are adjacent if there is an edge vw joining them, and the vertices v and w are then incident with such an edge. We also say that two distinct edges e and f are adjacent if they have a vertex in common (see Fig. 1.10). Figure 1.10 The degree of a vertex v is the number of edges incident with v, and is written deg(v); when calculating the degree of v, we usually make the convention that a loop at v contributes 2 (rather than 1) to deg(v). A vertex of degree 0 is an isolated vertex and a vertex of degree 1 is an end-vertex. Thus each of the two graphs in Fig. 1.11 has two end-vertices and three vertices of degree 2, while the graph in Fig. 1.12 has one end-vertex, one vertex of degree 3, one of degree 6 and one of degree 8. The degree sequence of a graph consists of the degrees written in increasing order, with repeats where necessary. For example, the degree sequences of the graphs in Figs 1.11 and 1.12 are (1, 1, 2, 2, 2) and (1, 3, 6, 8). Figure 1.11 Figure 1.12 The earliest result on graph theory is essentially due to Leonhard Euler in 1735 (although he did not express it in the language of graphs). It is sometimes called the handshaking lemma. THEOREM 1.1 (Handshaking lemma) In any graph the sum of all the vertex- degrees is an even number. Proof. The sum of all the vertex-degrees is equal to twice the number of edges, since each edge contributes exactly 2 to the sum. It is thus an even number. ■ The handshaking lemma is so called because it tells us that if several people shake hands, then the total number of hands shaken must be even – this is precisely because just two hands are involved in each handshake. A useful corollary of the handshak- ing lemma is the following: COROLLARY 1.2 In any graph the number of vertices of odd degree is even. 1.1 Definitions 13 Proof. If the number of vertices of odd degree were odd, then the sum of the vertex- degrees would also be odd, contradicting Theorem 1.1. So the number is even. ■ Subgraphs A graph H is a subgraph of a graph G if each of its vertices belongs to V(G) and each of its edges belongs to E(G). Thus the graph in Fig. 1.13 is a subgraph of the graph in Fig. 1.14, but is not a subgraph of the graph in Fig. 1.15, since the latter graph contains no ‘triangles’. Figure 1.13 Figure 1.14 Figure 1.15 We can obtain subgraphs of a graph by deleting edges and vertices. If e is an edge of a graph G, we denote by G - e the graph obtained from G by deleting the edge e; more generally, if F is any set of edges in G, we denote by G - F the graph obtained by deleting the edges in F. Similarly, if v is a vertex of G, we denote by G - v the graph obtained from G by deleting the vertex v together with the edges incident with v; more generally, if S is any set of vertices in G, we denote by G - S the graph obtained by deleting the vertices in S and all edges incident with any of them. An example is shown in Fig. 1.16. Figure 1.16 We also denote by G \ e the graph obtained by taking an edge e and ‘contracting’ it – that is, removing it and identifying its ends v and w so that the resulting vertex is incident with all those edges (other than e) that were originally incident with v or w.