Download as pdf
Download as pdf
You are on page 1of 15
Graph Theory 235 “ yy % “4 % “a % % vs (a) Graph G (6) Complement G Fig, 9.32 Example of Complement Graph 9.5 Types of Graphs Few important types of graphs are discussed here which are frequently used in graph theory. y, Null graph A graph is called a null graph (also called totally discon- nected graph) if there are no edges or every vertex is an isolated vertex. In Fig. 9.33, a null graph with five vertices is shown. A null graph is also called vertex graph. Mathematically, a null graph es * one whose edge set is empty, ie. E = © and V # ® Ress ee noes Complete graph A complete graph is a loop-fee undirected graph where for all vertices v,, vy € V, ¥, #¥, there exists an edge {v,, vj}. In other words, in a complete graph every vertex is connected to every other vertex, i.e. every pair of different vertices are adjacent, ve oy A complete graph with » vertices is denoted by K,, and has (1/2) n(n ~ 1) edges. Figures 9.34 (a) to (@) show undirected complete graph K,, for n= 1, 2, ... 5. A , X/ sO /\ , ey vy M3 UN Me Ny % (Ky Ky () Ks (ct) Ky Ks Fig, 9.34. Examples of Undirected Complete Graph Regular Graph A graph in which every vertex has the same degree is called a regular graph. If every “rtex has degree r, then graph is called a regular graph of degree r. nn Every null graph is regular of degree zero and a complete graph K,, is regular of degree » — 1. Not that if a 8raph G has 7 vertices and is regular of degree r, then it has (1/2) ra edges. : fin a regular undirected graph, every vertex has the same degree, say f, then graph is called k-regular. Discrete a6 Mathematics Let G be a foop-fiee unditected graph with m vertices. The complemen op 1G entary graph , 4 ona ae subgiaph of K, consisting of the 1 vertices in G and all edges that are not in Goth aoe we thon G isa gtaph consisting of 7 vertices and no edges, In other words, G ig the gy is, = K,. te : enh ie Ay same mabe Srtices i with two of them are connected if and only it they ae vetted in G. That is, veitices which ate adjacent in G are not adjacent in G and vice versa * o a is, ; shows an undirected with $ vertices. Its complement is shown in Fig. 9.35 (6) where vere : trex as in y % vy ui 2 % 1 a . “a Vs Na wy Fig. 9.35 (a) Graph G Fig. 9.35 (6) Complement of G. Example 16 (c) Draw the connected regular graphs of degree 0, 1 and 2. (2) Draw two 3-regular graphs with six vertices. Solution (a) The required connected regular graphs of degree 0, 1 and 2 are shown in Figs 9.36 (a), ()3d (c). respectively. ang (0) O-regular (6) L-regular (c) 2-regular Fig. 9.36 Examples of Regular Graph (6) The required 3-regular graphs with six vertices are shown in Figs 9.37(a) and (4). Al Fig. 9.37 Examples of Regular Graph Graph Theory 7 Weighted graph A loop-free graph G is said to be a weig a Inted graph if a positive real number called the weight is assigned to cach of ils edye ¢ = (v, vj). Such a weight is denoted by wt (e) or wt (Vv, v)- itp ¥) © V but yp ¥) € Es then Wt (vv) = 0 ee For cach ¢ = (Vp ¥)) © Es the weight may represent (i) the length of a road from v, to v, (i) the time taken t travel on this read fom (0 ¥, oF (i) the cost of taveling fom v, to y ‘on this road, gipartite graph A loop-fice graph G is called ‘pipartte graph if iC is possible to partition the vertex set V into two subsets V, and V, of verti- ces such that every edge (Vv, v,) connects a vertex in V, and a vertex in V3, ie, there is no edge joining two vertices in set V, of V>. In other words, ‘a graph G is called bipartite graph when V=V, ty, UVzand V) AV, = © and every edge of G is of the form {v, v,} with vj € V, and V, € V2. The partite graphs Ky and K,4 are shown in Fig. 9.38 Examples of Bipartite Graphs 9.38 (a) and ih demoecttoel. My % (a)K. If each vertex in V, is joined with every vertex in V,, ie. there is an edge between each pair of vertices in V, and V,, then such a bipartite graph is called complete bipartite graph. Now if number of vertices in V, are m and number vertices in V, are n, then such a graph is denoted by K,, ,. A complete bipartite graph K,, ,, has m +n vertices and mn edges. Figure 9.39 is an example of complete bipartite (2) Kase Vy = (Wye Yabo Va = (ys Yes V5) (6) Kyi Va = Oe Fig. 9.39 Examples of Complete Bipartite Graph i Example 17 Show thatthe maximum number of edges ina complete bipartite graph with nverticesare 7” 4. ‘ %2 ‘3 V4 Ne i). Va = Wa Yo Yo} eeltion Let G (V, E) be a bipartite graph and let V, and V; be partition of the vertex set V of G. Since there omPlete bipartite graph, each vertex in V, is joined to each vertex in V, by exactly ove ede. Thus, rig, Ae iM edyes in G, where m, + ny =n, But the maximum value of mn, subject (0m + My “Hence, the maximum number of edges in G are 1°/4. F is 18 If the imersection of two paths ini a graph G is dis circuit Solution Let discon me the ested, ists g ie connected, then their union has at lea “that P, 0 Py is di cted, Since P, 0 Pp is P, and P, be two paths in G such ‘that P) ™ P2 is disconnected fsiesieitalea here is at least one pair of vertices u, v in P, P2 where bol we Owever, u,v e Py cy Py implies that u, v belong t0 both paths Py and P, and therefore, there ; 2 1 Path in P, and P, which connect vertices u and v. 238 Discrete Mathenaie, ‘As there is no path in P,P, conneeting vertices wand v, it may be assumed tha P, connecting w and v are edge-disjoint, ‘Thus, union of these (Wo paths connecting cirouit in P, U P, as shown in Figs, 9.40 Paths in p 4 and ¥ form 4 Vig. 9.40 Traversable multigraph A multigraph £9 G is said to be traversable if it can be aoa 2 drawn without any break in the curve and ‘ v2 \ ’ without repeating any edge. That is, if there NK) 4 ) is a path which includes all vertices and 7 al ov uses each edge exactly once. Such a path q> 27 & « | must be a trial (since no edge is used twice) v, - % e | , 3 (b) and it will be called a traversable trial. A taversable multigraph obviously must be (a) connected and have either zero or two ver- Fig. 9.41 Exampl iar tices of odd degree. ig :xamples of Traversable Multigraph Figure 9.41 (6) shows a traversable trial of the multigraph in Fig. 9.41 (a). Remark To prove a graph to be traversable, find the degree of each vertex and the determine whether all the vertices are of even degree or exactly two are of odd degree. If either condition is met, the grt is traversable. Example 19 (a) Draw the complete graphs K, and K,. (6) Find the number of edges in the graphs Kj, and K,s. . Solution (a) First draw given number of vertices and then draw edges from each vertex to every 2% vertex. The graphs for Ks and K, are shown in Figs 9.42 (a) and (6). i <= (aks ()Ke Fig. 9.42 ube of F : ‘ning uP (6) Since each pair of vertices determines an edge. Thus, general formula for detent 5 mts edge: aan ting ges in a complete graph Ky is "Cy = n(n ~ 1)/2, because there are "Ca ways of SEU Tos edges: out of n vertices. Hence, in Kj, m = 12 « 11/2 = 66 edges and in Ky, m= 15 * M2 = DOIUUON Ine rap U Ly, Ly oH degree and end at the other vertices of odd degree. In Fig. 9.42 (a), vertices ¢ and d are oa ucgics +e Figure 9.42 (b) gives one such solution as @ = {¢, a, d, 5, ¢, d}. Example 22 Construct a graph which is both regular and bipartite. Solution The bipartite graph’ K,,, » is regular of degree m because each vertex is connected to m other vertices and hence, its degree is m. An example of graph K, , is shown in Fig. 9.45, which is 3-regular. In this graph we can delete m disjoint edges and each time obtain a regular graph of one degree | Fig. 9.45 less. These graphs may be disconnected, but in any case their connected components have the desired properties. 8.8 “Isomorphic Graphs ton fi V, is called a graph Let G,(V,, E,) and G, (V3, E,) be two undirected graphs. A function fi oe v2 is Stetween thet ‘Somorphism if (i) f is ‘one-to-one and onto, i.e. there exist @ one ones Peover, vertices MAY Vertices as well as edges (both the graphs have equal number of vertices 7 edges, Du. .d (ii) for all u, v € V,, {u, ¥} € E ifando if y)} € E>: Ifsuch a function : “ } € E, ifa y if (Fw) S OD} € Fe “ta 7 py a 240 exists, then graphs G, and G examples of isomorphic pr phs. + It < Fig. 9.46. Examples of Isomorphic Graphs Remark By definition two isomorphic graphs must have (9 equal number of vertices and edges. ¢ ‘equal number of vertices with same degree. =. SN (6) Discrete Mathematics re called isomorphic graphs, Graphs shown in Fig. 9.46 (a) and (b) are \ \ (i) It should be possible to start at any vertex in two graphs and find a circuit that includes every edge of the graph. Example 23 Show that the graphs shown in Figs 9.47 (a) and (6) are isomorphic. Solution To show that two graphs are isomor- phic, we can arrange vertices from both graphs having same degrees in decreasing order of de- grees. If both graphs contain vertices having same degree, then they are isomorphic, otherwise 5 not. Note that no vertex is left out in any of the graphs which is not matching in terms of degree with the vertex in other graph, In Figs 9.47 (a) and (6), pairs of vertices in decreasing order of their degrees are follows: Degree 3: deg (c) = deg (v,); deg (a) = deg (v,); deg (d) = deg (v4) Degree 2: deg (b) = deg (v,) Degree 1: deg (e) = deg (v,) Since both the gra phs contain vertices having same degrees, therefore, they are isomorphic. Example 24 Show that the graphs shown in Figs 9.48 (a) and (6) are not isomorphic. Solution The graph in Fig, 9.48 (a) vertex b has Seuree 4, whereas graph in Fig. 9.48 (b) there is no Such Vertex. Hence, graphs are not isomorphic. (a) 6 (a) Fig. 9.47 s (6) ® Example 26 Verify whether two graphs in Fig. 9.51 are isomorphic. Solution Each of the two graphs shown in Fig. 9.51 has six vertices and nine ed In Fig,-9.51 (6), if we start at vertex u, then we find a circuit u > w > v yw zy or > vu. But it is not possible to find a circuit in Fig. 9.51 (a) where the only trails that includes each edge start at either b or e and then terminate at e or b, respectively. Hence, two graphs are not isomorphic. a LN. > > y. Graph Theory 249 (b) Since all vertices in G are not of even degree, ie. dep contain Eulerian circuit but has a Eulerian path a rd ae i nn ; : a Py PCy > es ey > ey, (©) The graph G is connected and all the vertices are having even degree, ‘Thus, 6 has a Euler af ‘ us, G has a Bulerian % @ . 6 (c) Fig. 9.64 Important Results ie 1. “if a graph G has a vertex of odd degree, then there ean be no Euler circuit in G. 27 Ifa graph G is connected and each vertex has even degree, then there is an Euler circuit in G. 3. Ma graph G has more than two vertices of odd degree, then there can be no Euler path in G. 4 Ifa graph G is connected and has exactly two vertices of odd degree, then there is an Euler path in _G. Any Euler path in G must begin at one vertex of odd degree and end at the other. Example-22 Determine which of the graph shown in Figs 9.65 (a), (6) and (c) has an Euler circuit, Euler path. . «Solution (a) The graph in Fig. 9.65 (a), has exactly two vertices of odd degree. Thus, graph is an Fuler Path but no Euler circuit, , (6) In Fig, 9.65 (6) each vertices has odd degree. Thus, there is neither Euler circuit nor a path. () In Fig, 9.65 (c), each vertex has even degree. Thus, graph has an Euler circuit Fig. 9.65 © 0 1. Illustrations Following graphs shown in Figs 9.66 (a), () and (c) illustrate comparison between Eulerian and Hamiltonian graphs. yy vy v3 v2 vy v; 7 * 4 s ‘ M4 Ne V5 V6 %5 ‘6 % Vy % (a) Hamiltonian but Non-Eulerian () Eulerian but Non-Hamiltonian _(c) Neither Eulerian nor Hamiltonian [deg (v) # even} [deg (v) = even] Fig. 9.66 Theorem 8 The connected graph G has 4 Hamiltonian circuit if for any two vertices u and v which are not adjacent, deg (u) + deg (v) > m, where n is the number of vertices. Proof This theorem will be proved by contradiction. Suppose, a non-Hamiltonian graph with m vertices satisfies the condition deg (u) + deg (v) 2 n for every non-adjacent vertices u and v. Choosing a graph G with maximum number of edges from all non-Hamiltonian graphs satisfying the given condition. Thus in G, there exist two non-adjacent vertices u and v such that an edge joining u and v will result in # Hamiltonian graph. It follows that there is a Hamiltonian path in G: u =x), xy... %q = Yo where wand V are end vertices as shown in Fig, 9.67. ae ° ° ee a eae ° ° .. ee °. °. aaa 3 ne) Xe Snot Fig. 9.67 Define two sets x, is adjacent to u in G) acre x, i8 adjacent to v in G) Aad such that |A| = deg (u) and |B] = deg (v) in G, where [Aj h ber of elements in A 3 B, respectively. We claim that A 4 B= @ and we ea eres ‘ts, me AO By then the edse (u, x) and (x, v) should be in G and the path ee Graph Theory al wax, x, . aa Xp XX pg py ee hye By gy ee ky will form a Hamiltonian circuit in G, which is a contradiction. Further, since vertex u = x adjacent to u nor adjacent to v, therefore x) ¢ A UB, Thus |A UB) ¢n— 1. So a deg (u) + deg (v) = JA] + |B] = |A UB) sn 1 which is again @ contradiction to our hypothesis. Hence, G is Hi Theorem (Dirac’s Theorem) 9 The connected graph G with |V| = n vertices has a Hamilton ak circuit if deg (v,) 2 "2 for each vertex n,. Ml ane Proof The proof of this theorem follows from Theorem 8, because de; of non-adjacent vertices u and v, , is neither Jamiltonian, & (u) + deg (v) 2 n for every pair Corollary The connected graph G with n vertices has a Hamiltonian circuit provided the number of Loa edges in G, € 2 > (n° - 3n + 6), for n 2 3. Proof Suppose graph G is non-Hamiltonian. Then the result of Theorem 8 implies that there exists @ pair of non-adjacent vertices u and v such that deg (u) + deg (v) < m ~ 1. Let H be subgraph of G obtained by deleting vertices u and v from G. So graph H has n ~ 2 vertices and e ~ [deg (u) + deg (v)] edges. Thus, the maximum number of edges in H will be "-C, and hence e~ [deg (u) + deg (W)] s"-2C, = 5(n=2) (n~3) = LO? - 5n +6) O es LO? ~5n +6) + (n= 1) = 20? ~3n 4) s 0? -3n +6) which is a contradiction. Hence, the result of theorem is true. Theorem 10 In a complete graph G with » (an odd number) > 3 vertices, there are (n ~ 1/2 edge- disjoint Hamiltonian circuits. Proof Since a complete graph G with m vertices has n (n - 1)/2 edges and a Hamiltonian circuit in G contains n edges, the number of edge-disjoint Hamiltonian circuits in G cannot exceed (m— 1)/2. We shall ‘now show that there are (n — 1)/2 edge-disjoint Hamiltonian circuits when n is old. A subgraph H of the complete graph G with n vertices as shown in Fig. 9.68 is a Hamiltonian circuit. n-2 Ss h 9.68 Hamiltonian Circuit In polynomial pattern anticlockwise by 5» > mR 7 oi jon produces a Hamiltonian circuit mT aps i 32a degrees, then we find that each rotation pr which has no edge in common with any of the previous ones. Consequently, we obtained (1~3)2 ney edge-disjoint Hamiltonian circuits. Hence, there are 1 + (m~3)/2 = (n ~ 1)/2 edge-disjoint Hamiltonia circuits. 9.10 Shortest Path Problems In this section, we shall di cuss two algorithms to determine the shortest distance between a designated vertex and each of the other vertices in a loop-free connected undirected graph 9.10.1 Shortest Path in a Unweighted Graph The shortest distance path in a loop-free unweighted graph G (V, E) is the path betwe v, and v, that uses the least number of edges. In this section, we shall discuss Breash and Back Tracking Scarch (BTS) algorithms to find shortest path in an unweight Steps of Breath First Search Algorithm ‘cen two vertices First Search (BFS, ted graph Set the count i = 0 and assign the first vertex Vo = 5 (say). 2 Search all other unassigned adjacent vertices of vertex vp = s in G. If there is no such vertex oa vertices, then vertex Vq is isolated, otherwise set the counter at i= + 1 and assign v,,, =f and find the length of a shortest path from s to ¢. Steps of Back-tracking Search Algorithm Set the counter at i = 2) and assign the last vertex v, Search an unassigned adjacent vertex u to v, and assign u = If i 3 _» Where 2 (u) = i= 1, stop, otherwise decrease i to i ~ 2 and go to Step 2. Example 33 Find the shortest path from vertex v, “Q to v, and its length in the graph shown in Fig, 9.69. Solution Using BFS, label v, as vp for i= 0, then yo ZZ ee adjacent vertices v and v, are labelled /=7+1-0 M <<) =. + 1= 1. Vertices adjacent to v, and vs, i.e. vertices S 6) v9(3) Ye and vg are lebelled j= 7+ 1'= 2. Then vertex vg Ss is labelled as (= 1+ 1 =2+1=3. Since last verte. “3 Vg is labelled 3, therefore, the length of a shortest Fig. 9.69 Path from v, to vz is 3, Now using back-tracking al Borithm, since 2 (vg) = 3, we start with j= 3 and v, = vg. Vertex adjacent 10 Ve are vq and vs, So we choose v, or vs with & (vs) = 2 and assign v, = 2, Next we choose v, adjacent 10 vs with 3. (v3) = I and assign v5 = 1. Finally, we take V, adjacent to vy with A (v,) = 0 and assign ¥1 = 0. Hence, the shortest path from v, to v, is ViV5¥5V ge 8.10.2 Shortest Path in a Weighted Graph Given a weighted graph G (V, E), we interpret weight as the length of a direct route from vertex ¥, 10 ¥j- For any vertices s, ¢ € V, suppose that Viv Var ++ Vq € V and that the edges (s, ¥))s (¥y ¥2 z 1) provide a path in G from s to 4. The Jength of this path is the sum of the weights of the edges on {his path and the shortest path between s and ¢ is the minimum length of the path. We denote the shortest path from s to ¢ as d(s, 4) ‘The procedure to find shortest Path between the first vertex and every other vertex in the weighted graph was developed by Edsger Wybe Dijkstra, a Dutch mathematician Graph Theory 253 The computations start from a vertex v, to an immediately succeeding vertex using a labelling procedure. Let d; be the shortest distance (weight) from initial vertex v, to vertex v, and dj (2 0) as the Prpath of edge (iJ). Then the label for vertex y is defined as: (dy 1) = (d+ dy 0. Labels in Dijkstta’s algorithm are of two types: replaced with another label ifthe shortest dis trident that no better route can be found, the mporary and permanent. A temporary label can be nee to the same vertex can be found, Ata point when it becomes jatus of the temporary label is changed to permanent. Steps of the algorithm are summarised below: LLabel the initial vertex v, (/= 1) with the permanent label (0, ~) and all other vertices with temporary abel (2, -). That is, initialise the optimal lengths : {: if i = s(initial vertex) & otherwise. Assign each vertex v, that ean be reached from initial vertex v,(i= 1) a permanent label with Lv) = Min {L(v), L (wy) + 4} provided vertex v, is not permanently labelled. If vertex v, is already labelled with (L (vj), vg] with another vertex v; and if L (v) + dy v5 > v4 v,= 55.

You might also like