P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> C H A P T E R 23 MODULE 5 E Undirected graphs PL How do we represent a graph by a diagram and by a matrix representation? How do we define each of the following: r graph r subgraph r vertex r edge (node) r loop r isolated vertex r bipartite graph r degenerate graph r connected graph r Euler path r Euler circuit r circuit r tree r Hamilton path r Hamilton circuit r adjacency matrix r spanning tree r complete graph r planar graph r degree of a vertex r simple graph M How do we apply Euler’s formula to planar graphs? How do we determine the shortest path between two given vertices on a graph? How do we find the minimum spanning tree of a graph? How do we apply Prim’s algorithm to find the minimum spanning trees of a connected graph? SA How do we apply the Hungarian algorithm? 23.1 Introduction and definitions A hockey team belongs to a competition in which there are six teams: A, B, C, D, E and F. A few weeks into the season, some of the teams have played each other: A has played B, F and E F B has played C, F and A B C has played B, D and E A D has played C and F C E has played A and C E F has played A, B and D D Figure 23.1 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson 614 and McMenamin TI-Nspire & Casio ClassPad material in collaboration with Brown P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 615 A A 0 B 1 C 0 D 0 E 1 F 1 B 1 0 1 0 0 1 C 0 1 0 1 1 0 D 0 0 1 0 0 1 E 1 0 1 0 0 0 PL A B C D E F A 0 1 0 0 1 1 B 1 0 1 0 0 1 C 0 1 0 1 1 0 D 0 0 1 0 0 1 E 1 0 1 0 0 0 F 1 1 0 1 0 0 E This situation can be represented graphically. The teams can be represented by points and two such points are joined by a line whenever the teams they represent have played each other. A figure such as Figure 23.1 is called a graph. The points A, B, C, D, E and F are called the vertices or nodes of the graph and the lines connecting the vertices are called edges. A graph consists of a set of elements called vertices and a set of elements called edges. Each edge joins two vertices. The vertices A and B of a graph are adjacent vertices if they are joined by an edge. The graph can be represented by a table or a matrix. A ‘1’ is used to denote that there is one edge connecting the two vertices and a ‘0’ indicates that there is no edge. The matrix shown below is called an adjacency matrix. Table for figure 23.1 F 1 1 0 1 0 0 Matrix for figure 23.1 M The adjacency matrix A of the graph is an n × n matrix in which for example the entry in row C and column F is the number of edges joining vertices C and F. SA Another graph, Figure 23.2, is shown opposite. Note that three edges leave from A. The graph is said to have multiple edges as there are two edges joining A and D. C has one edge, which links C to itself. This edge is called a loop. The table and matrix appear as shown below. A C D B Figure 23.2 Note: A loop is recorded as one edge in an adjacency matrix A B C D A 0 1 0 2 B 1 0 0 1 C 0 0 1 0 D 2 1 0 0 A A 0 B 1 C 0 D 2 B C D 1 0 2 0 0 1 0 1 0 1 0 0 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 616 Essential Further Mathematics – Module 5 Networks and decision mathematics Example 1 Representing a graph by a table or matrix Construct the table and matrix corresponding to the graph shown, which represents three houses, A, B and C, connected to three utility outlets, gas (G), water (W) and electricity (E). A B C G W E Solution A A 0 B 0 C 0 G 1 W 1 E 1 B C G W 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 PL A B C G W E A 0 0 0 1 1 1 B 0 0 0 1 1 1 C 0 0 0 1 1 1 G 1 1 1 0 0 0 W 1 1 1 0 0 0 E 1 1 1 0 0 0 E Figure 23.3 E 1 1 1 0 0 0 Figure 23.3 is called a bipartite graph as the set of vertices is partitioned into two disjoint sets (A, B, C) and (gas, water, electricity) and each edge has a vertex in each set. M A bipartite graph is a graph whose set of vertices can be split into two subsets X and Y in such a way that each edge of the graph joins a vertex in X and a vertex in Y. At each non-isolated vertex, A, in a graph there will be some edges joined to A (incident with vertex A). The degree of vertex A, written as deg(A) is the number of edges incident with it. SA A For Figure 23.4: deg A = 3 deg B = 2 deg C = 2 Note:deg D = 5 D C B Figure 23.4 Loops add two to the degree of avertex. A simple graph is a graph with no loops or multiple edges. Figure 23.5 is a simple graph. For a simple graph, the sum of the degrees of the graph is equal to twice the number of edges of the graph. ∴ the sum of the degrees of a simple graph is even. E D A B Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson Figure 23.5 TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin C P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 617 For Figure 23.5: Sum = deg(A) + deg(B) + deg(C) + deg(D) + deg(E) = 3 + 2 + 2 + 3 + 2 = 12 For a simple graph, the entries for the corresponding table are either 1s or 0s. Note that the sum of the 1s = 12 = 2 × the number of edges. E A B C D E 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 B PL If E is an isolated vertex (i.e. there are no edges incident to E) then deg(E) = 0. See Figure 23.6. A B C D E A C E D Figure 23.6 B A graph is said to be degenerate if all its vertices are isolated. See Figure 23.7. A C M Figure 23.7 SA Many applications of graphs involve ‘getting from one vertex to another’. In order to discuss B this, the idea of a path is introduced. C A path in the graph in Figure 23.8 from A to F could be A D AB, BG, GE, EC, CD, DE, EG, GF (shown in red). Not all G the edges or vertices in a path are required to be different. E F A path can be thought of as a sequence of edges. Figure 23.8 A graph is said to be connected if there is a path between each pair of vertices. The graph in Figure 23.9 is connected. The graph in Figure 23.6 is not connected. A circuit is a sequence of edges linking successive vertices that starts and finishes at the same vertex. In Figure 23.9, one circuit is A B C D F A. Another circuit is E F D E. B C A D F E Figure 23.9 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 618 Essential Further Mathematics – Module 5 Networks and decision mathematics A subgraph of a graph consists of selected edges and vertices of the graph with the same links as the original graph and with the selected vertices including all the endpoints of the selected edges. Figures 23.10a and 23.10b show two subgraphs of Figure 23.9. B B C A B C A C A D D F E E F D F E E Figure 23.10b Figure 23.10a Figure 23.10c PL The graph shown in red in Figure 23.10c is not a subgraph as it has an edge that does not exist in the original graph. Exercise 23A Town B 1 This section of a road map can be considered as a graph, with towns as vertices and the roads connecting the towns as edges. Town C Town A Town D M a Give the degree of: i Town A ii Town B iii Town H b Construct the table (matrix) for this graph. c Is this graph simple? Why? Town H 2 For each of the following graphs give the associated table (matrix). a A D b SA B A B C c A B C D d A D C e A D B f A g B E C C D A B B h C D F A C 3 Which of the graphs in Question 2 are: a simple? b connected? Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin D P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 619 4 For each of the following, draw the graph for the given table (matrix). A B C D A 0 1 1 0 B 1 0 1 1 d 1 0 0 0 0 0 1 1 0 1 1 0 C 1 1 0 0 0 1 0 0 D 0 1 0 0 b A B C e 0 1 1 A 0 0 0 B 0 0 0 1 0 1 1 1 0 C 0 0 0 c A B C D A 0 1 0 1 B 1 0 1 0 f 0 1 2 1 1 0 1 1 2 1 0 0 C 0 1 0 1 1 1 0 0 PL 5 a Draw three connected subgraphs, with four B vertices, of the graph shown. (Note that there are many such subgraphs.) A b What is the degree of vertex A? c Give the sum of the degrees of the vertices of the graph. F d Give a circuit from A passing through 4 vertices (including A). C D E M Planar graphs and Euler’s formula Leonard Euler (pronounced ‘oiler’) was one of the most prolific mathematicians of all time. He contributed to mathematics in an amazing array of topics. His proof of the formula named after him is considered to be the beginning of the branch of mathematics called topology. The application of Euler’s formula is developed in this section. Electrical circuits can be represented by a graph, as in C B Figure 23.11. SA 23.2 D 1 0 1 0 E a D A F E Figure 23.11 For certain electrical circuits it is advantageous to not have connections AD and CE crossing. C B Figure 23.11 can be redrawn as shown in Figure 23.12 so that these edges do not cross. D A F E Figure 23.12 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 620 Essential Further Mathematics – Module 5 Networks and decision mathematics A graph that can be drawn in such a way that no two edges meet (or have common points), except at the vertices where they are both incident, is called a planar graph. E Not all graphs are planar. Figure 23.13 cannot be redrawn so that the edges have no intersection points except at the vertices. It is true that all simple graphs with four or fewer vertices are planar. PL Figure 23.13 C B f4 f1 A f2 D f3 F E Figure 23.14 M Consider a connected planar graph ABCDEF shown in Figure 23.14. This graph has 6 vertices and 8 edges. Connected planar graphs also have faces or regions. Figure 23.14 has four faces: f 1 , f 2 , f 3 and f4 , where f4 is an infinite face. There is a relationship between the number of vertices, edges and faces in a connected planar graph. Let v denote the number of vertices. Let e denote the number of edges. Let f denote the number of faces. Note that in Figure 23.14: SA v −e+ f =6−8+4=2 This result holds for any connected planar graph and is known as Euler’s formula. Euler’s formula states: v −e+ f =2 Example 2 Verifying Euler’s formula Verify Euler’s formula for the graph shown. C B E f4 f3 f1 A Solution f2 D 1 The vertices are A, B, C, D, E. There are 5 vertices so v = 5. v = 5 2 There are 4 faces as shown on the diagram. f=4 Don’t forget the infinite face f1 : So f = 4. 3 The edges are AB, BC, CD, DA, DB, AE and CA. There are 7 of them, so e = 7. e=7 v−e+ f =5−7+4=2 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 621 Example 3 Verifying Euler’s formula A tetrahedron may be represented graphically by a connected planar graph. Verify Euler’s formula for the graph shown. Solution Example 4 E v = 4, f = 4, e = 6 v−e+ f =4−6+4=2 Using Euler’s formula PL A connected planar graph has 6 vertices and 8 edges. How many faces does the graph have? Draw a connected planar graph with 6 vertices and 8 edges. Solution Euler's formula: v − e + f = 2 v = 6 and e = 9 6−9+ f =2 −3 + f = 2 f =5 B C f1 f2 A D f3 E f4 f5 M F Exercise 23B SA 1 For each of the following graphs: i state the values of v, e and f a ii verify Euler’s formula. c b d 2 Show that the following graphs are planar by redrawing them in a suitable form: a A B C B b A F E c A C D D B C E D F E Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 622 Essential Further Mathematics – Module 5 Networks and decision mathematics 3 For a planar connected graph, find: a f, if v = 8 and e = 10 c f, if v = 5 and e = 14 b v, if e = 14 and f = 4 d e, if v = 10 and f = 11 23.3 E 4 a Represent this cube as a planar graph. b Verify Euler’s formula for this graph. Complete graphs K3 PL A complete graph is a graph with edges connecting all pairs of vertices. The complete graph with n vertices is denoted by K n . K4 K5 Note: K 3 and K 4 are planar while K 5 is not. n(n − 1) edges. 2 M The complete graph with n vertices, K n , has For example: 4(4 − 1) = 6 edges 2 5(5 − 1) = 10 edges K 5 has 2 K 4 has SA A complete graph could be used to represent a round robin competition (a competition in which each side plays every other side once). A For example, for five teams, A, B, C, D and E are shown. Each edge represents a match that D has been played. The adjacency matrix has 1’s in all positions except the main diagonal. This graph could be drawn for six people at a party. Each edge indicates that a conversation took place. The adjacency matrix has 1s in all positions except the main diagonal. B B C E C A D F E A A 0 B 1 C 1 D 1 E 1 0 1 1 1 1 1 B 1 0 1 1 1 C 1 1 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 D 1 1 1 0 1 1 1 1 0 1 1 E 1 1 1 1 0 1 1 1 1 0 1 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin 1 1 1 1 1 0 P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 623 Exercise 23C 1 A competition consists of six teams. In the competition each team plays every other team. a How many matches are there? b Represent the competition with the complete graph K 6 . c Represent the competition with an adjacency matrix. b Draw K 7 . E 2 a How many edges does K 7 have? 3 How many handshakes could take place among 8 people. Represent this with a graph. Euler paths PL Euler and Hamilton paths In a paper published in 1736, Leonard Euler solved the problem that had intrigued the citizens of Königsberg, which lay near the mouth of the Pregel River. The river divided the city into four parts, as shown in Figure 23.15. There were seven bridges. A B D Pregel River M C Figure 23.15 The problem was posed as follows: ‘Could we walk over each of the seven bridges once only and return to our starting point?’ Euler represented this situation as shown in Figure 23.16. A Euler showed that this graph cannot be traversed B completely in a single cyclical trail. That is, no matter D which vertex is chosen as the starting point it is impossible to cover the graph and come back to the chosen starting vertex while using each C edge only once. Figure 23.16 SA 23.4 We recall that for a graph, a path is a sequence of edges. In Figure 23.17, one path from A to D is e1 , e3 , e4 (red). Another path from A to D is e5 (green). B e1 A e3 C e4 e2 e5 Figure 23.17 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin D P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 624 Essential Further Mathematics – Module 5 Networks and decision mathematics Recalling the definition of circuit in section 23.1: a circuit is a path that begins and finishes at a particular vertex. In Figure 23.18, one circuit is e1 , e2 , e3 , e4 , e5 , e6 (red). This circuit begins and finishes at A. e2 B e1 C A e3 D e6 e5 e4 E F Figure 23.18 E A path that includes every edge just once is called an Euler path. An Euler circuit is an Euler path that starts and finishes at the same vertex. Identifying Euler paths and circuits Example 5 PL A useful way of identifying Euler circuits is to look for a connected graph where all vertices have an even degree. The converse result also holds: if a graph has an Euler circuit, then it is connected and each vertex has an even degree. Using this result, it can be seen that the graph for the Königsberg bridge problem does not contain an Euler circuit as vertex B has an odd degree. A connected graph has an Euler path starting at vertex A and finishing at vertex B if A and B are the only odd vertices of the graph. D Identifying an Euler circuit a Explain why the graph shown opposite has an Euler circuit. b List an Euler circuit for this graph. M C E Solution B a The graph has only even vertices. b An Euler circuit is C → D → E → C → A → B → C . SA Example 6 A Identifying an Euler path a Explain why the graph opposite has an Euler path between B and C. b List one possible Euler path (there are several) between B and C. Solution A E B D C a B and C are odd vertices. The remaining vertices are even. b B → A → E → D → B → C → D → C. Hamilton paths A Hamilton path is a path through a graph that passes through each vertex exactly once. A Hamilton circuit is a Hamilton path which starts and finishes at the same vertex. Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 625 It is easy to remember the difference between Hamilton paths (circuits) and Euler paths (circuits). Hamilton graphs are defined in terms of vertices and Euler graphs are defined in terms of edges. Unfortunately, unlike the condition for an Euler circuit, there is no nice condition to identify when a graph is a Hamilton circuit. It is just a matter of trial and error. Example 7 B C A E Identifying a Hamilton circuit List a Hamilton circuit for the graph shown. E D Solution H F G PL A Hamilton circuit is C → B → A → E → F → G → H → D → C . Not every graph that has a Hamilton circuit has an Euler circuit, and also not every graph that has an Euler circuit has a Hamilton circuit. The graph in Example 7 has a Hamilton circuit but not an Euler circuit. The graph in Figure 23.19 has an Euler circuit but not a Hamilton circuit. F A C E M Figure 23.19 Exercise 23D SA 1 a Which of the following graphs has: i an Euler circuit? ii an Euler path but not an Euler circuit? b Name the Euler circuits or paths found. c aA B C A bB E C C B B G E H D d C F A D D E e F A E D B D E C F A Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin B P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 626 Essential Further Mathematics – Module 5 Networks and decision mathematics 2 List a Hamilton circuit for each of the following. a A B C E D b B C c A F C H I D A D G B E F E e D B B A E F G E D A F E C d C B PL A 3 List a Hamilton path for this graph starting at F and finishing at G. F E G H D Weighted graphs M 23.5 C A weighted graph is one where a number is associated with each edge. These numbers are called weights. SA Examples of weighted graphs arise when the vertices of a graph are towns on a map and the edges are the roads between the towns. The number assigned to each edge is the distance between the towns represented by the vertices of that edge. Figure 23.20 is a weighted graph representing towns and the roads connecting them. Appleville 12 Snugvill 6 20 Melville 8 7 Cudstop 9 5 13 Clearview 11 Heavytown Figure 23.20 The numbers in a weighted graph may also represent times, fuel consumption, cost, and so on. The number attached to an edge is called the weight of that edge. Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 627 Trees A tree is a connected graph that contains no circuits. Figure 23.21 is a tree. A tree has no multiple edges. The simplest tree is a single vertex. A tree with n vertices has n − 1 edges. G B F A E C E D Figure 23.21 C 5 B 6 PL Minimum spanning trees A cable is needed to connect the communication systems of the four towns in figure 23.22. It is convenient to lay the cable alongside existing roads but it is not necessary to lay the cable next to all roads. A 4 3 5 D 6 Figure 23.22 M A subgraph connecting all four towns can be chosen. It is sensible for such a subgraph to be a tree (in red in figure 23.22) shown in figure 23.23. B A C 5 4 3 D Figure 23.23 SA A spanning tree is a subgraph that contains all the vertices of the original graph and is a tree. A minimum spanning tree for a weighted graph is a spanning tree for which the sum of the weights of the edges is as small as possible. Figure 23.23 is a minimum spanning tree for figure 23.22. Prim’s algorithm Prim’s algorithm is a set of rules to determine a minimum spanning tree for a graph. Examples of where Prim’s algorithm applies include such problems as the following ‘For a certain number of cities, a railroad network is to be developed and the cost of connecting any two given cities is known. Find how all the cities should be connected by rail to minimise total cost.’ Similar problems involve utility connections, e.g. water, gas, electricity. Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> 628 Essential Further Mathematics – Module 5 Networks and decision mathematics Prim’s algorithm: 1 Choose a vertex and connect it to a second vertex chosen so that the weight of the edge is as small as possible. 2 In each step thereafter, take the edge with the lowest weight, producing a tree with the edges already selected. (If two edges have the same weight the choice can be arbitrary.) 3 Repeat until all the vertices are connected and then stop. Example 8 E Applying Prim’s algorithm Apply Prim’s algorithm to obtain a minimum spanning tree for the graph shown. Write down its weight, and compare it to the weight of the original graph. C 8 B 3 6 2 D 5 5 PL A 7 6 6 E 2 F Solution Step 1 Step 2 B 2 Step 5 C C B 3 2 D A Step 4 5 C B B 2 3 5 M A 5 A A Step 3 B 2 5 2 A D 3 5 D 5 E E 2 F SA The total weight is 17. The total weight of the original graph is 50. Exercise 23E 1 Find a minimum spanning tree for each of the following graphs and give the total weight. a A 2 6 B 2 b 3 C 2 F 5 1 D 16 16 3 10 16 E 17 17 A C 24 B E 2 12 G 17 11 D 15 F Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin D P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 629 c B 10 E 18 A 20 9 18 70 H 19 10 D d C 18 100 140 C 80 90 G 200 90 F B D E 100 90 120 E A 2 By trial and error find the shortest path from A to E. B 6 4 F 7 D 8 A 3 5 PL 3 E C 3 Find the shortest Hamilton path for the following graph, starting at A. B 5 C 6 3 G 6 4 4 A D 2 5 F 3 4 5 E SA M 3 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Essential Further Mathematics – Module 5 Networks and decision mathematics Key ideas and chapter summary Graph A graph consists of a set of elements called vertices and a set of elements called edges. Each edge joins two vertices A figure such as the one drawn opposite is called a graph. F B A C E E D The points A, B, C, D, E and F are called the vertices or nodes of the graph and the lines connecting the vertices are called edges of the graph. Adjacent vertices The vertices A and B of a graph are adjacent vertices if they are joined by an edge Adjacency matrix The adjacency matrix A of the graph is an n × n matrix in which for example the entry in row C and column F is the number of edges joining vertices C and F. For the graph above the adjacency matrix is as shown. Multiple edges and loops The graph is said to have multiple edges as there are two edges joining A and D. C has one edge, which links C to itself. This edge is called a loop. PL Vertices (nodes) and edges A A 0 B 1 C 0 D 0 E 1 F 1 B 1 0 1 0 0 1 C 0 1 0 1 1 0 M Bipartite graph D 0 0 1 0 0 1 C E 1 0 1 0 0 0 F 1 1 0 1 0 0 A D B A bipartite graph is a graph whose set of vertices can be split into two subsets X and Y in such a way that each edge of the graph joins a vertex in X and a vertex in Y. SA Review 630 Degree of a vertex At each non-isolated vertex, A, in a graph there will be some edges joined to A (adjacent with vertex A). The degree of vertex A, written as deg(A) is the number of edges incident with it. Loops are counted twice. Simple graph A simple graph is a graph with no loops or multiple edges. Degenerate graph A graph is said to be degenerate if all its vertices are isolated. Path A path can be thought of as a sequence of edges of the form AB, BG, GE, EC, CD, DE, EG, GF B C A D G E F Connected graph A graph is said to be connected if there is a path between each pair of vertices. Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 631 B A circuit is a sequence of edges linking successive vertices that starts and finishes at the same vertex. A C D E A subgraph of a graph consists of selected edges and vertices of the graph with the same links as the original graph and with the selected vertices including all the endpoints of the selected edges. Planar graph A graph that can be drawn in such a way that no two edges meet (or have common points), except at the vertices where they are both incident, is called a planar graph. Euler’s formula Euler’s formula states that for any connected planar graph, v − e + f = 2, where v = the number of vertices, e = the number of edges, and f = the number of faces. Complete graph A complete graph is a graph with edges connecting all pairs of vertices. Euler path A path that includes every edge just once is called an Euler path. Euler circuit An Euler circuit is an Euler path that starts and finishes at the same vertex. Hamilton path A Hamilton path is a path through a graph that passes through each vertex exactly once. Hamilton circuit A Hamilton circuit is a Hamilton path that starts and finishes at the same vertex. Weighted graphs A weighted graph is a graph where a number is associated with each edge. These numbers are called weights. SA M PL E Subgraph Tree A tree is a connected graph that contains no circuits. A tree has no multiple edges. The simplest tree is a single vertex. A tree with n vertices has n − 1 edges. Spanning tree A spanning tree is a subgraph that contains all the vertices of the original graph and is a tree. Minimum spanning tree A minimum spanning tree for a weighted graph is a spanning tree for which the sum of the weights of the edges is as small as possible. Prim’s algorithm Prim’s algorithm is a set of rules to determine a minimum spanning tree for a graph. Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin Review Circuit P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Essential Further Mathematics – Module 5 Networks and decision mathematics Skills check E Having completed this chapter you should be able to: construct an adjacency matrix from a graph and draw the graph from an adjacency matrix determine whether a graph is simple, connected, planar or complete determine whether a graph has an Euler circuit or path by trial and error, determine whether a graph has a Hamilton path or circuit find a minimum spanning tree of a graph PL Multiple-choice questions 1 The minimum number of edges for a graph with seven vertices to be connected is: A 4 B 5 C 6 D 7 E 21 2 Which of the following graphs is a spanning tree for the network shown? 1 3 2 6 4 B 1 M A 1 3 3 5 4 5 7 7 C 1 D 1 3 2 4 5 7 7 6 6 4 5 2 2 SA Review 632 3 E 1 2 6 2 6 4 6 5 4 7 3 For the graph shown, which vertex has degree 5? A Q B T C S D R E U 3 5 7 Q S P U R T 4 A connected graph on 15 vertices divides the plane into 12 regions. The number of edges connecting the vertices in this graph will be: A 15 B 23 C 24 D 25 E 27 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 633 Review 5 Which of the following graphs does not have an Euler circuit? C A B D PL E E 6 A connected planar graph divides the plane into a number of regions. If the graph has eight vertices and these are linked by 13 edges, then the number of regions is: A 5 B 6 C 7 D 8 E 10 A B F C M 7 For the graph shown, which of the following paths is a Hamilton circuit? E A ABCDCFDEFAEA B AEFDCBA C AFCDEABA D D ABCDEA E AEDCBAF SA 8 For which one of the following graphs is the sum of the degrees of the vertices equal to 12? C B A D E 9 The sum of the degrees of the vertices on the graph shown here is: A 20 B 21 C 22 D 23 E 24 10 For the graph shown, which additional arc could be added to the network so that the graph formed would contain an A Euler path? A AF B DE C AB D CF E BF B C E F D Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Essential Further Mathematics – Module 5 Networks and decision mathematics 11 For the graph shown here, the minimum length spanning tree has length: A 30 B 31 C 33 D 34 E 26 7 8 4 5 4 10 6 9 2 E 12 Of the following graphs, which one has both Euler and Hamilton circuits? C B PL A D E 13 Which one of the following graphs has an Euler circuit? C B M A D E SA Review 634 2 14 Which one of the following is a spanning tree for the graph shown here? A 3 1 5 B 2 2 3 1 4 3 1 5 4 5 4 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 635 D 2 E 2 2 3 3 1 1 1 4 5 5 5 4 E 15 Which one of the following graphs has an Euler circuit? B A D PL C E M 16 Which one of the following graphs provides a counter-example to the statement: ‘For a graph with seven vertices, if the degree of each vertex is greater than 2 then the graph contains a Hamilton circuit’? C B A E SA D 17 For which one of the following graphs is the sum of the degrees of the vertices equal to 20? A B C D E Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin Review C P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Essential Further Mathematics – Module 5 Networks and decision mathematics 18 Which one of the following paths is a Hamilton circuit for the graph shown here? A PQRSTP B PQRSTUVP C PQUVRSTP D PQRSTUVUTP E PQRSTUVRVQUTP Q R V U P S T B E 19 Four towns, A, B, C and D are linked by roads as shown. Which of the following graphs could be used to represent the network of roads? Each edge represents a route between two towns C A B PL A B C B C A D B D B C C A A D D D E B C C A A M D D Extended-response questions 1 This question is about the vertices of a graph and the degree of a vertex. In Graph A below, there are four vertices (the dots). SA Review 636 Graph A Graph B 1 2 3 4 Graph C a Complete the table for Graph B. Degree 0 1 2 3 4 5 6 7 b Study Graphs A, B and C and then Number of vertices consider the statement: ‘In any graph the total number of vertices of odd degree is an even number.’ Is this statement true for Graphs A, B and C? How many vertices of odd degree does each graph have? Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Chapter 23 – Undirected graphs 637 Review c To Graph B an extra edge is added joining two vertices of even degree. Does the above statement still hold true for this graph? Explain the reasons for your answer. d From Graph C an edge joining an odd degree vertex to an even degree vertex is removed. Does the above statement still hold true for this graph? Explain the reasons for your answer. a Explain why this is a planar graph. b For this graph, write down: i the number of vertices ii the number of edges iii the number of faces E 2 Consider the graph shown here. PL Note: the region outside the graph is counted as a face. c Draw a spanning tree for this graph. d For the spanning tree drawn in c, write down i the number of vertices ii the number of edges iii the number of faces M 3 Let H denote a planar graph with n vertices. a If T denotes a spanning tree of H, specify: i the number of vertices in T ii the number of edges in T iii the number of faces in T b Hence verify that, for the graph T: number of vertices − number of edges + number of faces = 2. SA 4 The map shows six campsites, A, B, C, D, E and F which are joined by paths. The numbers by the paths show lengths in kilometres of sections of the paths. a 6 B 9 lake 5 A 3 D 4 1 5 2 F 3 4 C 5 E i Complete the graph opposite which shows B 9 6 the shortest direct distances between 4 campsites. (The campsites are represented C A 8 D by vertices and paths are represented by 5 F 7 edges.) 4 5 ii A telephone cable is to be laid to enable each 8 E campsite to phone each other campsite. For environmental reasons, it is necessary to lay the cable along the existing paths. What is the minimum length of cable necessary to complete this task? (cont’d.) Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin P1: FXS/ABE P2: FXS 9780521740517c23.xml CUAU031-EVANS September 7, 2008 7:0 Back to Menu >>> Essential Further Mathematics – Module 5 Networks and decision mathematics A A 0 B 1 C 0 D 1 E 1 F 1 B 1 0 1 0 0 0 C D E F 0 1 1 1 1 0 0 0 0 1 1 0 − − − − − − − − − − − − E iii Fill in the missing entries for the matrix shown for the completed graph formed above. M PL b A walker follows the route A−B−A−F−E−D−C−E−F−A. i How far does this person walk? ii Why is the route not a Hamilton circuit? iii Write down a route that a walker could follow which is a Hamilton circuit. iv Find the distance walked in following this Hamilton circuit. c It is impossible to start at A and return to A by going along each path exactly once. An extra path joining two campsites can be constructed so that this is possible. Which two campsites need to be joined by a path to make this possible? SA Review 638 Cambridge University Press • Uncorrected Sample pages • 978-0-521-61328-6 • 2008 © Jones, Evans, Lipson TI-Nspire & Casio ClassPad material in collaboration with Brown and McMenamin
© Copyright 2026 Paperzz