Networks and matrices



Similar documents
Chinese postman problem

Chapter 6: Graph Theory

12 CRITICAL PATH ANALYSIS

Networks and Paths. The study of networks in mathematics began in the middle 1700 s with a famous puzzle called the Seven Bridges of Konigsburg.

Graph Theory Problems and Solutions

V. Adamchik 1. Graph Theory. Victor Adamchik. Fall of 2005

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 72.

Magnetometer Realignment: Theory and Implementation

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

Any two nodes which are connected by an edge in a graph are called adjacent node.

Phonics. High Frequency Words P.008. Objective The student will read high frequency words.

Not for distribution

Graph Theory Origin and Seven Bridges of Königsberg -Rhishikesh

McAfee Network Security Platform

Social Media Mining. Graph Essentials

Scheduling. Getting Started. Scheduling 79

The Half-Circle Protractor

Introduction. Teacher s lesson notes The notes and examples are useful for new teachers and can form the basis of lesson plans.

Networking Guide

Maths Targets for pupils in Year 2

INTRODUCTION TO MATHEMATICAL MODELLING

Decision Mathematics D1 Advanced/Advanced Subsidiary. Tuesday 5 June 2007 Afternoon Time: 1 hour 30 minutes

SCHOOL BUS TRANSPORTATION Frequently Asked Ques ons

A booklet for Parents

Section 9: Applied Optimization

Chapter 11 Number Theory

Decision Mathematics D1. Advanced/Advanced Subsidiary. Friday 12 January 2007 Morning Time: 1 hour 30 minutes. D1 answer book

Numeracy and mathematics Experiences and outcomes

Number Who Chose This Maximum Amount

OA4-13 Rounding on a Number Line Pages 80 81

EdExcel Decision Mathematics 1

International Indian School, Riyadh SA1 Worksheet Class: VI Mathematics

Unit 5 Length. Year 4. Five daily lessons. Autumn term Unit Objectives. Link Objectives

The London Independent Girls Schools Consortium. Mathematics Sample Questions

The London Independent Girls Schools Consortium. Mathematics Specimen Paper

Level 2 Routing: LAN Bridges and Switches

How we teach calculations in Maths A Parent s Guide

Ready, Set, Go! Math Games for Serious Minds

Innovations of MerrTaxi

Fractions. Chapter Understanding fractions

Make maths fun!! Give your child lots of praise and encouragement!

SUPPLEMENT TO CHAPTER 6 MINIMUM SPANNING-TREE PROBLEMS

GEOMETRIC MENSURATION

Working with whole numbers

Home Study Modules KS4 Foundation Level. Pythagoras Theorem. MathSphere material is used in over schools in the UK and abroad

Three daily lessons. Year 5

Unit 6 Number and Operations in Base Ten: Decimals

PAYCHEX, INC. BASIC BUSINESS MATH TRAINING MODULE

An Australian Microsoft Partners in Learning (PiL) Project

Project Scheduling by PERT/CPM

MD5-26 Stacking Blocks Pages

Introduction to Graph Theory

AwanaGames Circle. Official. Diagram 1. Key to diagram: Pin & Striped Bean Bag C Diagonal or Starting Line. B Scoring Pins, or Center.

Acquisition Lesson Planning Form Key Standards addressed in this Lesson: MM2A3d,e Time allotted for this Lesson: 4 Hours

Fractions Packet. Contents

CAGED System Primer For Community Guitar by Andrew Lawrence Level 2

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

6.3 Conditional Probability and Independence

4 UNIT FOUR: Transportation and Assignment problems

PUSD High Frequency Word List

Grade 7 & 8 Math Circles Circles, Circles, Circles March 19/20, 2013

Session 7 Bivariate Data and Analysis

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

MATHEMATICS GRADE 2 Extension Projects

Midterm Practice Problems

MATHEMATICS Unit Decision 1

Fry Phrases Set 1. TeacherHelpForParents.com help for all areas of your child s education

How to Design Your Perfect Kitchen in Just 15 Minutes Using Microsoft Word

Balls, Hoops and Odds & Ends

Test A. Calculator not allowed. Mathematics test. First name. Last name. School. DfE no. KEY STAGE LEVELS

Test A. Calculator not allowed. Mathematics test. First name. Last name. School. DCSF no. KEY STAGE LEVELS

Graph Theory Techniques in Model-Based Testing

The Crescent Primary School Calculation Policy

SALE TODAY All toys half price

Circuits 1 M H Miller

Wednesday 13 June 2012 Morning

Bar Graphs and Dot Plots

By Heather Forest. Outcome: Students will learn about farm animals and how the animals in this story adopt human traits.

To start using your phone as a navigation device, tap the TomTom button in the Windows Mobile start menu.

(Refer Slide Time: 2:03)

Get more from your hot water

MATHEMATICS FOR ENGINEERING BASIC ALGEBRA

Plotting Ordered Pairs on a Four Quadrant Grid Grade Five

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

Area and Perimeter: The Mysterious Connection TEACHER EDITION

How To Work With Beads. By Rowan

Project Teamwork. Theme: Cooperative games encourage students to work together as a team while having fun in a positive environment.


1.6 Division of Whole Numbers

Teaching & Learning Plans. Arithmetic Sequences. Leaving Certificate Syllabus

EARLY CHILDHOOD LITERACY AND NUMERACY BUILDING GOOD PRACTICE MARILYN FLEER AND BRIDIE RABAN

Dynamic Programming. Lecture Overview Introduction

4. What could be the rule for the pattern in the table? n Rule

ALGEBRA. Find the nth term, justifying its form by referring to the context in which it was generated

OA3-10 Patterns in Addition Tables

Representing Vector Fields Using Field Line Diagrams

CRITICAL PATH ANALYSIS AND GANTT CHARTS

Monday 4 March 2013 Morning

1 st Grade Math Do-Anytime Activities

Transcription:

Networks and matrices ontents: G H I J Network diagrams onstructing networks Prolem solving with networks Modelling with networks Interpreting information with matrices urther matrices ddition and sutraction of matrices Scalar multiplication Matrix multiplication Using technology for matrix operations Review set

8 NTWORKS N MTRIS (hapter ) (T) Networks are used to show how things are connected. They can e used to help solve prolems in train scheduling, traffic flow, ed usage in hospitals, and project management. The construction of networks elongs to the ranch of mathematics known as Topology. Various procedures known as algorithms are applied to the networks to find maximum or minimum solutions. This further study of the constructed networks elongs to the ranch of mathematics known as Operations Research. HISTORIL NOT The theory of networks was developed centuries ago, ut the application of the theoretical ideas is relatively recent. Real progress was made during and after the Second World War as mathematicians, industrial technicians, and memers of the armed services worked together to improve military operations. Since then the range of applications has extended, from delivering mail to a neighourhood to landing man on the moon. usinesses and governments are increasingly using networks as a planning tool. They usually wish to find the optimum solution to a practical prolem. This may e the solution which costs the least, uses the least time, or requires the smallest amount of material. OPNING PROLMS There are several common types of networking prolem that we will e investigating in this chapter. or some types there are well-known algorithms that provide quick solutions. few prolems, however, remain a great challenge for st century mathematicians. Shortest Path Prolem ien and Phan are good friends who like to visit each other. The network alongside shows the roads etween their houses. The times taken to walk each road are shown in minutes. a ssuming there is no ack-tracking, how many different paths are there from ien s house to Phan s house? Which is the quickest route? ien s house Phan s house Shortest onnection Prolem computer network relies on every computer eing connected to every other. The connections do not have to e direct, i.e., a connection via another computer is fine. What is the minimum length of cale required to connect all computers to the network? The solid line on the network shows one possile solution, ut not the shortest one. 8 9 8

NTWORKS N MTRIS (hapter ) (T) 9 hinese Postman Prolem postman needs to walk down every street in his district in order to deliver the mail. The numers indicate the distances along the roads in hundreds of metres. The postman starts at the post office P, and returns there after delivering the mail. What route should the postman take to minimise the distance travelled? Travelling Salesman Prolem salesman leaves his home H in the morning, and over the course of his day he needs to attend meetings in towns,, and. t the end of the day he returns home. In which order should he schedule his meetings so that the distance he must travel is minimised? H 0 8 9 P In addition to the prolems posed aove, we will investigate how networks can e used to model projects with many steps. We will see how networks are related to matrices and learn how operations with matrices can e performed. NTWORK IGRMS network diagram or finite graph is a structure or model where things of interest are linked y physical connections or relationships. The things of interest are represented y dots or circles and the connections or relationships represented y connecting lines. or example, in the Travelling Salesman Prolem ( Opening Prolem question ) the dots represent the salesman s house and the four towns. The connecting lines represent the roads etween them. TRMINOLOGY ² graph or network is a set of points, some or all of which are connected y a set of lines. ² The points are known as nodes or vertices (singular vertex). ² In a graph, we can move from node to node along the lines. If we are allowed to move in either direction along the lines, the lines are called edges and the graph is undirected. Pairs of nodes that are directly connected y edges are said to e adjacent. arc adjacent nodes node or vertex edge If we are only allowed to move in one direction along the lines, the lines are called arcs. The graph is then known as a digraph or directed graph. arc

0 NTWORKS N MTRIS (hapter ) (T) ² n edge or arc may sometimes e assigned a numer called its weight. This may represent the cost, time, or distance required to travel along that line. Note that the lengths of the arcs and edges are not drawn to scale, i.e., they are not in proportion to their weight. ² The degree or valence of a vertex is the numer of edges or arcs which touch it. loop starts and ends at the same vertex. It counts as one edge, ut it contriutes two to the degree of a vertex. n isolated vertex has degree zero. loop counts as one edge, ut adds two to the degree of the vertex. So this vertex has degree degree degree degree isolated vertex, degree 0 ² connected graph is a graph in which it is possile to travel from every vertex to every other vertex y following edges. The graph is otherwise said to e disconnected. a connected graph a disconnected graph ² complete graph is a graph in which every vertex is adjacent to every other vertex. This graph is complete. This graph is not complete. The addition of the dotted edge would make it complete. ² simple graph is a graph in which no vertex connects to itself, and every pair of vertices is directly connected y at most one edge. a simple graph non-simple graphs ² path is a connected sequence of edges or arcs showing a route that starts at one vertex and ends at another. or example: - - - ² circuit is a path that starts and ends at the same vertex. or example: - - - -

NTWORKS N MTRIS (hapter ) (T) ² n ulerian circuit is a circuit that traverses each edge (or arc) exactly once. or example: -------- ² Hamiltonian path is a path which starts at one vertex and visits each vertex once and only once. It may not finish where it started. or example: - - - - ² Hamiltonian circuit is a circuit which starts at one vertex, visits each vertex exactly once, and returns to where it started. or example: - - - - - ² spanning tree is a simple graph with no circuits which connects all vertices. or example: is a spanning tree. XRIS. or the networks shown, state: i the numer of vertices ii the numer of edges iii the degree of vertex iv whether the graph is simple or non-simple v whether the graph is complete or not complete vi whether the graph is connected or not connected. a c d or the graph shown: a name a path starting at and ending at that does not visit any vertex more than once name a Hamiltonian path starting at and finishing at c name a Hamiltonian circuit from d name a Hamiltonian circuit from e draw a spanning tree which includes the edges and.

NTWORKS N MTRIS (hapter ) (T) or the network shown, draw as many spanning trees as you can find. or the graph shown, list all possile Hamiltonian circuits starting at. gas pipeline is to e constructed to link several towns in the country. ssuming the pipeline construction costs are the same everywhere in the region, the cheapest network is: a Hamiltonian circuit an ulerian circuit a spanning tree a complete graph Give real life examples of situations where a person may e interested in using a a Hamiltonian path a Hamiltonian circuit INVSTIGTION LONHR ULR N TH RIGS O KÖNIGSRG The 8th century Swiss mathematician Leonhard uler is famous in many areas of mathematics and science, including calculus, mechanics, optics, and astronomy. In fact, uler pulished more research papers than any other mathematician in history. However, nowhere was uler s contriution more significant than in topology. You have already met ulerian circuits that were named in his honour. In this investigation we will meet another of his most famous contriutions which is closely related to ulerian circuits. The town of Königserg or Kaliningrad as it is now known, was situated on the river Pregel in Prussia. It had seven ridges linking two islands and the north and south anks of the river. What to do: The question is: could a tour e made of the town, returning to the original point, that crosses all of the ridges exactly once? simplified map of Kaliningrad is shown alongside. uler answered this question - can you? pparently, such a circuit is not possile. However, it would e possile if either one ridge was removed or one was added. Which ridge would you remove? Where on the diagram would you add a ridge? river

NTWORKS N MTRIS (hapter ) (T) or each of the following graphs determine: i the numer of vertices with even degree ii the numer of vertices with odd degree iii whether or not the graph has an ulerian circuit. (Try to find an ulerian circuit y trial and error.) Summarise your results in a tale: Network No of vertices No of vertices ulerian circuit (Yes/No) with even degree with odd degree a. a c d e f g h i G an you see a simple rule to determine whether or not a graph has an ulerian circuit? State the rule. esign your own networks or graphs to confirm the rule. rom Investigation you should have determined that: n undirected network has an ulerian circuit if and only if there are no vertices of odd degree.

NTWORKS N MTRIS (hapter ) (T) XMINING NTWORK IGRMS Networks can e used to display a wide variety of information. They can e used as: ² flow charts showing the flow of fluid, traffic, or people ² precedence diagrams showing the order in which jos must occur to complete a complex task ² maps showing the distances or times etween locations ² family trees showing how people are related ² displays for sports results and many more things esides. XRIS. onsider the network showing which people are friends in a tale tennis clu. Mark lan Sarah Paula Michael Sally Gerry a What do the nodes of this graph represent? What do the edges represent? c Who is Michael friendly with? d Who has the most friends? e How could we indicate that while lan really likes Paula, Paula thinks lan is a it of a creep? lex is planning to water the garden with an sprinkler head underground watering system which has popup sprinkers. network is to e drawn to T-piece show where the sprinklers are to e located. a ould the network e considered to e elow directed? with What are the nodes of the diagram? thread PV T-piece c What are the edges? pipe with thread d What prolem might lex e interested in solving? joining clamp PV pipe joiner elow t a school sports day, a round-roin tug of war competition is held etween the houses. lue a What are the nodes of this graph? What do the edges represent? c What is the significance of the degree of each node? yellow d Why, in this context, must we have a complete graph? e How many matches must e played in total? red green

NTWORKS N MTRIS (hapter ) (T) f g Using lue, R Red, etc. R is the match etween the lues and the Reds. List all possile games using this method. How could you indicate, on the network, who won each match? Jon constructed a network model of his morning activities from waking up to leaving for school. eat cereal wake up shower dress make toast eat toast drink juice listen to the radio clean teeth Write a rief account of Jon s morning activities indicating the order in which events occur. roughly drawn map of the Riverland of S Waikerie is shown alongside. The distances etween Renmark towns in kilometres are shown in lack. The times in minutes required to travel etween armera Kingston 0 the towns are shown in red. 0 9 erri a What are the nodes of the network? 0 What do we call the red and lack numers? 8 c What is the shortest distance y road from Waikerie to Renmark according to the map? Loxton d Is it further to travel from Renmark to Kingston or Renmark to Loxton? e Is it quicker to travel from Renmark to Kingston or Renmark to Loxton? leave The network alongside descries the distriution of water in a home. If we added weights to this network, descrie three things they could represent. water mains kitchen athroom sink dishwasher sink shower toilet laundry sink washing machine ISUSSION iscuss the following: ² What types of computer network could e used in an office or school? ² What type of network would e suitale for a telephone system? ² What would the vertices and edges represent in each case?

NTWORKS N MTRIS (hapter ) (T) ONSTRUTING NTWORKS Often we are given data in the form of a tale, a list of jos, or a veral description. We need to use this information to construct a network that accurately displays the situation. xample Self Tutor Model a Local rea Network (LN) of three computers connected through a server to a printer and scanner. computer one computer two computer three server printer scanner xample Self Tutor Model the access to rooms on the first floor of this two-storey house as a network. lounge dining kitchen stairs hall edroom ath edroom verandah lounge dining kitchen hall verandah ed ath ed Note: The rooms are the nodes, the doorways are the edges. XRIS. raw a network diagram to represent the roads etween towns P, Q, R, S and T if: Town P is km from town Q and km from town T Town Q is 0 km from town R and 8 km from town S Town R is km from town S. raw a network diagram of friendships if: has friends, and ; has friends, and ; has friends, and.

NTWORKS N MTRIS (hapter ) (T) raw a network diagram to represent how ustralia s states and territories share their orders. Represent each state as a node and each order as an edge. ustralia s states and territories arwin risane Perth delaide anerra : 0 000 000 Melourne 0 00 000 km Sydney Hoart a Model the room access on the first floor of the house plan elow as a network diagram. kitchen dining edroom ensuite hall family edroom edroom athroom plan: first floor Model access to rooms and outside for the ground floor of the house plan elow as a network diagram. onsider outside as an external room represented y a single node. entry living garage roller door study athroom rumpus laundry plan: ground floor

8 NTWORKS N MTRIS (hapter ) (T) INVSTIGTION What to do: TOPOLOGIL QUIVLN My house has ducted air conditioning in all of the main rooms. There are three ducts that run out from the main unit. One duct goes to the lounge room and on to the family room. The second duct goes to the study and on to the kitchen. The third duct goes upstairs, where it divides into three suducts that service the three edrooms. raw a network to represent the ducting in my house. o you think your network provides a good idea of the layout of my house? ompare your network to those drawn y your classmates. heck each network to make sure it correctly represents the description of my ducting. o all of the correct networks look the same? or a given networking situation, is there always a unique way to draw the network? In Investigation you should have found that there can e many ways to represent the same information. Networks that look different ut represent the same information are said to e topologically equivalent or isomorphic. or example, the following networks are topogically equivalent: heck to make sure each node has the correct connections. XRIS. Which of the networks in the diagrams following are topologically equivalent? a c d e f g h i j k l

NTWORKS N MTRIS (hapter ) (T) 9 Lael corresponding vertices of the following networks to show their topological equivalence: raw a network diagram with the following specifications: ² there are five nodes (or vertices) ² two of the nodes each have two edges ² one node has three edges and one node has four. Rememer when comparing your solution with others that networks may appear different ut e topologically equivalent. PRN NTWORKS Networks may e used to represent the steps involved in a project. The uilding of a house, the construction of a newsletter, and cooking an evening meal all require many separate tasks to e completed. Some of the tasks may happen concurrently (at the same time) while others are dependent upon the completion of another task. If task cannot egin until task is completed, then task is a prerequisite for task. or example, putting water in the kettle is a prerequisite to oiling it. If we are given a list of tasks necessary to complete a project, we need to ² write the tasks in the order in which they must e performed ² determine any prerequisite tasks ² construct a network to accurately represent the project. onsider the tasks involved in making a cup of tea. They are listed elow, along with their respective times (in seconds) for completion. tale like this is called a precedence tale or an activity tale. Retrieve the cups. Place tea ags into cups. 0 ill the kettle with water. 0 oil the water in the kettle. 00 Pour the oiling water into the cups. 0 dd the milk and sugar. G Stir the tea. 0

0 NTWORKS N MTRIS (hapter ) (T) xample Self Tutor The steps involved in preparing a home-made pizza are listed elow. a c d a c d efrost the pizza ase. Prepare the toppings. Place the sauce and toppings on the pizza. Heat the oven. ook the pizza. Which tasks can e performed concurrently? Which tasks are prerequisite tasks? raw a precedence tale for the project. raw a network diagram for the project. Tasks, and may e performed concurrently, i.e., the pizza ase could e defrosting and the oven could e heating up while the toppings are prepared. The toppings cannot e placed on the pizza until after the toppings have een prepared. ) task is a prerequisite for task. The pizza cannot e cooked until everything else is done. ) tasks,, and are all prerequisites for task. precedence tale shows the tasks and any prerequisite tasks. The network diagram may now e drawn. start finish Task Prerequisite Tasks,,, XRIS. The tasks for the following projects are not in the correct order. or each project write the correct order in which the tasks should e completed. a Preparing an evening meal: find a recipe clean up prepare ingredients cook casserole set tale serve meals Planting a garden: dig the holes purchase the trees water the trees plant the trees decide on the trees required Which tasks in question could e performed concurrently?

NTWORKS N MTRIS (hapter ) (T) The activities involved in preparing, arecuing and serving a meal of hamurgers are given in the tale alongside. raw a network diagram to represent this project. Task Prerequisite Gather ingredients - Pre-heat arecue - Mix and shape hamurgers ook hamurgers, Prepare salad and rolls ssemle hamurgers and serve, Your friend s irthday is approaching and you decide to ake a cake. The individual tasks are listed elow: G a c Mix the ingredients. Heat the oven. Place the cake mixture into the cake tin. ake the cake. ool the cake. Mix the icing. Ice the cake. raw a precedence tale for the project. Which tasks may e performed concurrently? raw a network diagram for the project. The construction of a ack yard shed includes the following steps: a c Prepare the area for the shed. Prepare the formwork for the concrete. Lay the concrete. Let concrete dry. Purchase the timer and iron sheeting. uild the timer frame. G ix iron sheeting to frame. H dd window, door and flashing. raw a precedence tale for the project. Which tasks may e performed concurrently? raw a network diagram for the project. The separate steps involved in hosting a party are listed elow: G ecide on a date to hold the party. Prepare invitations. Post the invitations. Wait for RSVPs. lean and tidy the house. Organise food and drinks. Organise entertainment.

NTWORKS N MTRIS (hapter ) (T) raw a network diagram to model the project, indicating which tasks may e performed concurrently and any prerequisites that exist. The tasks for cooking a reakfast of acon and eggs, tea and toast are listed elow: oil kettle; toast read; collect plate and utensils; serve reakfast; gather ingredients; cook acon and eggs; make tea; gather cooking utensils. a Rearrange the tasks so that they are in the order that they should e completed. Which tasks can e performed concurrently? c onstruct a precedence tale and network diagram for the project. ISUSSION ONURRN We have already seen how some tasks may e performed concurrently. What factors may determine whether the tasks are performed concurrently in practice? How might the numer of availale workers have an effect? PROLM SOLVING WITH NTWORKS In this section we will investigate a numer of network prolems, including: ² the numer of paths through a network ² the shortest and longest paths through a network ² the shortest connection prolem ² the hinese Postman prolem ² the Travelling Salesman Prolem. NUMR O PTHS PROLMS It is often useful to know how many paths there are from one point on a network to another point. Such prolems are usually associated with directed networks or ones for which we are not allowed to ack-track. INVSTIGTION NUMR O PTHS Many suurs of delaide are laid out as rectangular grids. Suppose we start in one corner of a suur and wish to travel to the opposite corner. property of the rectangular grid is that all paths from the start S to the finish have equal length so long as we never move away from the finish. ut how many of these paths are there? S What to do: or each network elow, how many shortest paths are there from the start S to the finish? a S S

NTWORKS N MTRIS (hapter ) (T) an you find a method which will help you count the numer of paths in a network such as: S? onsider the network in Investigation question a. Since no ack-tracking is allowed, the network is essentially directed, as shown: S NUMR O PTHS LGORITHM In numer of paths prolems we are interested in finding the total numer of paths which go from one node to another node without acktracking. ach connection on the graph allows traffic in one direction only. onsider the directed network: How many paths are there from to? Step : rom, there are two possile nodes we can go to. There is one possile path to each of them so we write near each. Step : We then look at the next step in the journey. t each successive node we add the numers from the previous nodes which lead to that point. one path from elow + one path from the left Step : Repeat Step until we finish at. So, there are possile paths for getting from to. Note: ² ² If we must avoid a given node, start y putting a zero ( 0) at that node. If we must pass through a particular node, start y avoiding nodes that do not allow passage through it.

NTWORKS N MTRIS (hapter ) (T) xample Self Tutor lvin () wishes to visit arara () across town. lvin s other friend Sally lives at the intersection S. ind how many different pathways are possile in going from lvin s place to arara s place: a if there are no restrictions if lvin must visit Sally along the way c if lvin must avoid Sally in case he gets stuck talking. S a c 0 0 0 0 S P 0 S 0 0 0 0 8 S T 8 0 9 Starting from, we write numers on the diagram indicating the numer of paths from the previous vertices. or example, to get to P we must come from S or T. So, +=0. The total numer of paths is. We must go through S, so there are some vertices which are no longer useful to us. We start y marking the places we cannot go with zeros. The total numer of paths from to is 8. s S must e avoided, the total numer of paths is. an you see how to find the answer to c from a and only? XRIS. In each question, assume that ack-tracking is not allowed. alculate the numer of paths from S to in each of the following networks: a S S c d S S

a How many paths exist from to L in the network shown? How many of the paths go through G? c How many of the paths do not go through H? d How many paths would there e if they must go through and H? e What assumption have you made in your answers? SHORTST PTH PROLMS NTWORKS N MTRIS (hapter ) (T) J K L Solve the Opening Prolem question a for the numer of paths from ien s house to Phan s house. shortest path prolem is a prolem where we must find the shortest path etween one vertex (or node) and another in a network. The shortest path does not necessarily imply that all vertices are visited. They need not e. Note also that y shortest path we are not always referring to the path of shortest distance. We may also e referring to the quickest route that takes the shortest time, or the cheapest route of lowest cost. delaide typical example is the prolem of travelling from delaide to Mt 9 Tailem end Gamier. network of the road 0 Meningie route is shown alongside. The distances etween towns are shown in Keith kilometres. 09 Kingston S Which route from delaide to Mt Naracoorte 09 Gamier has the shortest distance? Roe 0 80 ind the answer y trial and error. Milicent Mt Gamier G H I INVSTIGTION What to do: ric has a choice of several paths to walk to school. The arcs of the directed network not only show the direction he must follow to take him closer to the school ut also the time it takes (in minutes) to walk that section of the journey. SHORTST PTH Y TRIL N RROR home How many different paths are possile for ric to travel to school? escrie the shortest path that he may travel from home to school. What is the minimum time in which he can walk to school? H I G L J K school

NTWORKS N MTRIS (hapter ) (T) INVSTIGTION Note: You will require string to cut into varying lengths for this investigation. SHORTST PTH Y TIGHT STRING What to do: onstruct the network shown using lengths of string proportional to the lengths marked on the edges, for example the value could e cm in length, the value could e cm. Tie the string at the nodes where edges meet. While holding your network at the knots representing the vertices at either end of the path ( and in this case), carefully pull the string tight. The path that has een pulled tight is the shortest path. XRIS. Several street networks for students travelling from home to school are shown elow. The numers indicate the times in minutes. In each case, descrie the quickest path and give the minimum travelling time. a c home home G H I school George has just arrived at Heathrow airport in London. an you help him work out the cheapest way to get to pping using the Tue and overground trains? Prices for each section of the route are given in pounds sterling. 9 8 G H school Heathrow aling roadway d.9 home G. Notting Hill home H school Paddington... Holorn I school pping Liverpool Street lthough the trial and error and tight string methods are valid ways to find shortest paths, they ecome incredily time-consuming when the networks are large and complicated. The mathematician ijkstra devised a much more efficient algorithm for large networks.

IJKSTR S SHORTST PTH LGORITHM NTWORKS N MTRIS (hapter ) (T) Step : Step : Step : Step : Step : ssign a value of 0 to the starting vertex. raw a ox around the vertex lael and the 0 to show the lael is permanent. onsider all unoxed vertices connected to the vertex you have just oxed. Lael them with the minimum weight from the starting vertex via the set of oxed vertices. hoose the least of all of the unoxed laels on the whole graph, and make it permanent y oxing it. Repeat steps and until the destination vertex has een oxed. ack-track through the set of oxed vertices to find the shortest path through the graph. t each stage we try to find the shortest path from a given vertex to the starting vertex. We can therefore discard previously found shortest paths as we proceed, until we have otained the actual shortest path from start to finish. xample Self Tutor ind the shortest path from to in the network alongside. Step : Step : ssign 0 to the starting vertex and draw a ox around it. The nodes and are connected to. Lael them with their distances from. 0 Step : The unoxed vertex with the smallest lael is. raw a ox around it. Step : onsider the unoxed nodes connected to. to has length, so we lael with +=. to has length, so we lael with +=0: 0 0 Step : The unoxed vertex with the smallest lael is. raw a ox around it.

8 NTWORKS N MTRIS (hapter ) (T) Step : onsider the unoxed nodes connected to. or we would have +=. This is more than so the lael is 0 0 9 unchanged. or we have +=9, so we replace the lael with 9. Step : The unoxed vertex with the smallest lael is. raw a ox around it. Step : The only unoxed node connected to is. +=8, and this is less 0 than 9 so we change the lael. 0 98 Step : The unoxed vertex with the smallest lael is the finishing vertex. We now acktrack through the network to find the shortest path: Ã Ã Ã. So, the shortest path is!!! and its length is 8 units. Note: ² In practice, we do not usually write out all of the steps and numerous diagrams. These have only een included to help you understand the procedure. ² Suppose in xample aove that we are forced to pass through on the way to. To solve this prolem we now find the minimum length from to and then add to it the minimum length from to. xample or the network alongside, find the shortest path from to O that passes through M. What is the length of this path? G H I J K L M N O Self Tutor Since we must pass through M, we find the shortest path from to M and then the shortest path from M to O. 0 0 G H I J G H I J 8 K L M N O K L M N O 0 8 Working ackwards we get O Ã N Ã M Ã H Ã G Ã Ã. ) the shortest path is!! G! H! M! N! O with length +=units.

XRIS. NTWORKS N MTRIS (hapter ) (T) 9 ind the shortest path from to Z and state its value: a Z 8 Z c d G H 0 9 G I Z H 0 J Z onsider again the prolem on page. delaide ind the shortest route from delaide to 9 Tailem end Mt Gamier using the routes shown. Meningie 0 Keith 09 Kingston S 09 Naracoorte Roe 80 0 Milicent U 8 Q Mt Gamier The time to run various tracks in an orienteering 8 event is shown. Times are in minutes. P T R a ind the quickest way to get from P to Q. 8 S Which is the quickest way if the track PS ecomes impassale due to a flood? V Solve Opening Prolem question for the quickest route etween ien s house and Phan s house. construction company has a warehouse 0 at W in the diagram shown. Often several trips per day are made from the warehouse 9 W to each of the construction sites. ind the shortest route to each of the construction sites from the warehouse. istances are 8 in km. 9

80 NTWORKS N MTRIS (hapter ) (T) The network alongside shows the connecting roads etween three major towns,, and. The weights 8 9 on the edges represent distances, in kilometres. a ind the length of the shortest 0 8 9 path etween towns and that goes through town. 9 ind the length of the shortest path etween towns and. salesman is ased in city T. The tale shows the airfares in dollars for direct flights etween the cities. a Put the information onto a network diagram. etermine the minimum cost of flights from T to each of the other cities. c etermine the cheapest cost etween T and Y if he must travel via V. 0 8 8 0 9 T U V W X Y T 80 0 80 U 80 80 V 80 0 0 W 0 80 0 X 0 80 0 Y 80 0 0 0 0 ISUSSION SHORTST PTH PROLMS What other situations involving shortest paths can you think of? LONGST PTH PROLMS In some situations we may need to find the longest path through a network. This may e to maximise profits or points collected on the way. learly we cannot allow ack-tracking in the network since otherwise we could continually go to and from etween nodes to increase the length forever. We can therefore only find longest paths if the network is directed or if we are not allowed to return to a node previously visited. Unfortunately, we cannot find longest paths y simply changing minimum to maximum in ijkstra s Shortest Path lgorithm. There are other more complex algorithms that can e used, ut they are eyond the scope of this course. We therefore present examples to e solved y trial and error. delaide XRIS. Tailem end hardware salesman needs to travel from delaide to Mt Gamier for a meeting. He has six hours to make the journey, which gives him Keith enough spare time that he can visit some clients along the way, ut not enough that we can acktrack to pick up other routes. ased on previous Kingston S Naracoorte sales he estimates the amount of money (in Roe hundreds of dollars) he can earn along each section of the route. Which way should the Milicent salesman go to maximise his earnings? Mt Gamier

NTWORKS N MTRIS (hapter ) (T) 8 The network shows the time in minutes to drive etween intersections in a street network. a etermine the route from S to M which would take the shortest time. etermine the route from S to M which would take the longest time. S G H I J K L M SHORTST ONNTION PROLMS In shortest connection prolems we seek the most efficient way of joining vertices with edges so that paths exist from any vertex to any other vertex. Vertices do not need to e linked directly to each other, ut they all must e somehow linked. Situations requiring such a solution include computers and printers in a network (as in Opening Prolem question ), connecting a set of pop-up sprinklers to a tap, or connecting a group of towns with telephone or power lines. You should recall from the eginning of this chapter that a spanning tree is a simple graph with no circuits which connects all vertices. The optimum solution requires a spanning tree for which the sum of the lengths of the edges is minimised. We call this the minimum length spanning tree. INVSTIGTION school has decided to add four new drinking fountains for its students. The water is to come from an existing purification system at point ; the points,, and mark the locations of the new fountains. learly all fountains must e connected to the purification system, though not necessarily directly. SHOOL OUNTINS What to do: Using the scale on the diagram, measure the length of pipe required for all fountains to e connected directly to the purification system. scale : y trial and error, find the minimum length spanning tree for the network which gives the shortest length of pipe to complete the project. What is this length of pipe? XRIS. Use trial and error to solve the following shortest connection prolems: a 8

8 NTWORKS N MTRIS (hapter ) (T) Joseph the electrician is doing the wiring for a house extension. The new room is to have two powerpoints and a light in the centre of the ceiling. The numers on the diagram indicate the distances in metres of cale needed etween those points. What is the shortest length of cale required? Just like the shortest path prolem, the shortest connection prolem ecomes very timeconsuming and awkward for large networks. However, we can again use algorithms to rapidly solve the prolem. PRIM S LGORITHM In this algorithm we egin with any vertex. We add vertices one at a time according to which is nearest. or this reason Prim s algorithm is quite effective on scale diagrams where edges are not already drawn in. It also has the advantage that ecause we add a new vertex with each step, we are certain that no circuits are formed. The algorithm is: Step : Step : Step : Step : Step : power point Start with any vertex. Join this vertex to the nearest vertex. Join on the vertex which is nearest to either of those already connected. Repeat until all vertices are connected. dd the lengths of all edges included in the minimum length spanning tree. power point 8 existing power supply light switch xample Self Tutor onsider the example of connecting the school fountains in Investigation. No distances etween the purification system and the fountains were given, ut the diagram was drawn to scale. Scale : 000 scale : Step : We choose to start at. Step : learly is closest to so we include in the solution. (Length is m using the scale diagram.) Step : onsider distances from and. is closest to so we include in the solution. (Length is m.)

NTWORKS N MTRIS (hapter ) (T) 8 Step : onsider distances from, or. is the next closest vertex (to ), so we include in the solution. (Length is m.) onsider distances from,, or. is the only vertex remaining. It is closest to, so we include in the solution. (Length is 0 m.) ll vertices are connected so we stop. Step : The minimum length is 00 m. NRST NIGHOUR LGORITHM In this algorithm we start with all edges of the network in place. We remove the longest edges one y one without disconnecting the graph until only the minimum length spanning tree remains. The algorithm is: Step : Locate the longest length edge which can e removed without disconnecting the graph. Step : Remove this edge. Step : Repeat Steps and until the removal of any more edges will disconnect the graph. Step : dd the lengths of all edges in the minimum length spanning tree. xample 8 Self Tutor Use the Nearest Neighour algorithm to find the minimum length spanning tree for the graph alongside. 0 H 8 G 0 The longest length edge is G (length ), so this is removed first. The next longest edge is G (length ) and it can also e removed without disconnecting the graph. There are two edges of weight. The edge that joins H can e removed. The edge cannot e removed ecause that would disconnect node. There are two edges of weight. The edge can e removed, ut G cannot e removed without disconnecting G and H. 0 H 0 H 8 8 G G 0 0

8 NTWORKS N MTRIS (hapter ) (T) The removal of any more edges would make the graph disconnected, so this final graph is the minimum length spanning tree. The total weight of the minimum length spanning tree is 0 + 8 + + 0 + + + = 0 H 8 G 0 XRIS. Use Prim s algorithm to find the minimum length spanning tree for the following networks. In each case state the minimum length. a c 0 0 0 O 0 0 Use the Nearest Neighour algorithm to find the minimum length spanning tree for the following networks. In each case state the minimum length. a c G 9 R O Q 9 T P S H 0 0 ISUSSION MINIMUM ONNTION LGORITHMS iscuss the advantages and disadvantages of Prim s algorithm and the Nearest Neighour algorithm. What determines which is etter for a given prolem? Hint: One algorithm adds edges each step; the other removes edges each step. or each of the following prolems, use whichever algorithm is most appropriate to help find the solution: Solve the Opening Prolem question for the minimum length of cale required for the computer network. ssume the lengths given are in metres.

NTWORKS N MTRIS (hapter ) (T) 8 roadand caling is to e installed to six locations. The distances, in metres, etween each of these locations is shown alongside. ind the plan that will connect all the locations for the least cost. How many metres of cale would e laid for this plan? P U 8 8 0 T Q 9 S R 8 0 The diagram shows the distances (in km) etween towns in an lpine area. fter 0 heavy snow falls the road authorities wish to connect towns as quickly as possile y M 0 clearing the minimum distance of road. 0 a ind the roads that should e cleared and the minimum total length. 0 Workers report that due to the risk of avalanche, it is too dangerous to clear route. What is the est plan now? eduna Whyalla n aircraft company is proposing to set Port up a network of flights etween the South Pirie ustralian towns shown. The distances shown are flight distances of possile 0 0 routes. a ind the shortest length for the network of flights and illustrate the min- Port Lincoln delaide imum length spanning tree. omment on your answer. 9 Reconsider the prolem if it is essential that there are flights etween de- 0 laide and Port Lincoln and delaide and Whyalla. (istances in km.) Mt Gamier When Venice is flooded the authorities set up a network of raised platforms for pedestrians to walk on. If they connect the tourist attractions shown with the minimum length of platform possile, which walkways do they raise platforms over? istances are given in metres. Grand anal 00 00 00 00 0 00 00 00 0 Piazza San Marco

8 NTWORKS N MTRIS (hapter ) (T) 8 secure communication network is to e made etween towns as shown elow. The weights on the edges represent the distances etween towns, in kilometres. If the cost of making the network is proportional to distance, find the connection that minimises the cost. 8 8 0 0 9 9 TH HINS POSTMN PROLM This prolem was posed y the hinese mathematician Kwan Mei-Ko: postman has to leave from a depot, travel along a set numer of roads to deliver the mail, then return to the depot. How should he do this so he travels the minimum distance? In effect, the postman has to travel along every edge of a weighted network. The edges are the roads and the nodes are their intersections. The weights indicate the length of each road. Ideally, the postman would like to travel down every road only once. Such a delivery route is an ulerian circuit, since we start and finish at the same vertex, and every edge is travelled exactly once. However, we know this is only possile if the degree of every vertex is even. If an ulerian circuit does not exist, then the postman needs to choose which edges to travel twice such that the extra distance travelled is minimised. He has to travel twice etween whichever nodes have odd degree. So, we end up with a shortest path prolem to solve. xample 9 council worker has to mark lines in the middle of the roads shown alongside, starting and ending at the depot. The weights on the graph indicate distances in kilometres. ind the minimum distance that the marker can travel and a possile route he could follow. depot 0 00 0 80 0 Self Tutor 0 0 ll the vertices on the network graph are of even degree so an ulerian circuit exists. This means that it is possile to travel all the edges of the graph exactly once, starting and finishing at the same point. The minimum distance that he has to travel will e the sum of all the edges: 0 + 0 + + 0 + + 0 + 80 + 00 + 0 = 0 kilometres. possile route would e depot---------depot.

NTWORKS N MTRIS (hapter ) (T) 8 xample 0 Solve the hinese Postman Prolem for the weighted graph shown, starting and finishing at. The degrees of vertices and are odd, so an ulerian circuit does not exist. We need to walk twice etween and, so we use the shortest path algorithm to do this in the most efficient way: The most efficient route is therefore to traverse!! twice. The minimum distance travelled is the sum of all lengths in the diagram, plus, i.e., + = 9: G H 8 9 0 G H 8 9 9 0 0 0 Self Tutor possile route is: ---------G-H-- Notice how -- is used twice. XRIS. Solve the hinese Postman Prolem for each of the following networks: a O c 8 8 O 8 8 O onsider the network of roads joining towns L, M, N and O. istances are shown in km. L The district council depot is in town L. The council wishes to inspect all the roads linking the towns, returning to L in the least possile distance. ind the minimum distance to e travelled during the inspection and a possile route. 0 0 O 0 80 M N 0

88 NTWORKS N MTRIS (hapter ) (T) leak exists somewhere in the sewerage network shown. n inspector needs to walk the length of all tunnels, entering and leaving through the manhole at O. or ovious reasons he wants to walk the least distance possile. ind the shortest distance that he can walk and state the path that leads to this shortest distance. 00 00 O 00 00 00 800 00 00 istances are given in metres. 0 m parkland area has a central square (O) with paths arranged as shown. 0 m ind the circuit of smallest length that enales O 0 m 80 m 80 m the grounds staff to weed all paths. How long 0 m 0 m is this circuit? 0 m travel company offers a tour of cities of ngland for ustralian visitors. They claim to offer scenic routes along all of the major connecting roads shown. M is Manchester Y is York is amridge N is Nottingham L is London O is Oxford a Which road(s) need to e travelled twice to achieve this? What is the minimum road distance travelled? (istances shown are in km.) M 0 N 9 O Y 98 89 Solve Opening Prolem question. 90 L The malls in a shopping area are represented y the network shown. security patrol must travel along each mall starting and finishing at S. The numers represent the times (in mins) to walk each section. 8 a State the route for the patrolling officer S which takes the minimum time. If she starts one round at : am, what time will she finish the round? 0 c How much earlier would she finish if mall 9 8 is closed? 8 council in outack South ustralia plans to inspect all the local roads once every month. Plan a suitale route to enale this inspection, starting and finishing at O. istances are given in km. a Suggest a route, indicating roads that need to e travelled twice. O 0 0 G 0 0 0 0 0 0

NTWORKS N MTRIS (hapter ) (T) 89 c etermine the distance that must e travelled. How does the situation change if extra roads are constructed etween and and and? to is 0 km and to is km. TH TRVLLING SLSMN PROLM (TSP) travelling salesman leaves his home village, visits all of the villages in the neighourhood, then returns home. How should he do this so that the distance he travels is minimised? The salesman has to travel along the edges of a network, starting and finishing at the same node, and visiting every other node in etween. The prolem is equivalent to finding the shortest Hamiltonian circuit on a complete graph. No algorithm exists that will efficiently solve the TSP for large networks. It therefore remains one of the great unsolved prolems of pure mathematics. However, for small networks we can solve the TSP relatively easily using an exhaustive search. This means we try all possiilities and choose the shortest. In practice this actually requires calculating only half the total numer of possiilities, since we do not need to recalculate the reverse of a given route. xample Solve the TSP for the network alongside, assuming the salesman lives in village. istances are given in kilometres. 8 Self Tutor We find all of the Hamiltonian circuits in the graph that start and finish at, and compare their total lengths. These are: : + 8 + + = 0 : + + + = : + 8 + + = 0 : + + 8 + = 0 : + + + = : + + 8 + = 0 Note that the three cycles on the right are simply those on the left in reverse order, so we need not have shown these calculations. The minimum solution to the TSP is 0 km, using any of the four routes listed.

90 NTWORKS N MTRIS (hapter ) (T) XRIS.8 Solve the TSP for the following graphs, assuming the salesman lives in village O. ll distances are given in kilometres. a O 8 9 O 0 0 8 Solve Opening Prolem question. n icecream van leaves a depot and stops at six spots during the afternoon. The map shows the locations and the times for possile routes etween them (in mins). What is the fastest route? epot 0 0 Lirary 0 L 0 0 0 O Oval PROJT IS Park P M Mall 0 0 0 0 0 Play ground G S Shopping centre postal van is to collect mail from mail oxes at various locations in a suur. The numers given indicate the times etween oxes in minutes. What is the fastest route for collecting the mail? epot MOLLING WITH NTWORKS 0 In the previous section we considered a range of network prolems and techniques for solving them. In this section we consider real-life, practical prolems that can e solved y networks. The following projects will help you distinguish etween the types of network prolem and thus choose which solutions technique to apply. Pamphlet rop hoose a map from a street directory. efine the area where you wish to deliver the pamphlets. ecide whether you will work in pairs or singly. One of each pair could walk down opposite sides of the street. If you work singly, most streets will proaly need to e traversed twice: up one side and down the other. raw a network of the area. stimate distances to an appropriate accuracy using the scale on the map. Use your knowledge of networks and any other ideas to design the est way to carry out the pamphlet drop in the area determined. Tourist Routes hoose several sites of interest around the city or town in which your school is located, or else sites in your state that would e attractive to tourists. etermine possile routes etween them and estimate distances along these routes. 8

NTWORKS N MTRIS (hapter ) (T) 9 Plan a tour that visits each of the sites of interest. It should visit every site just once and cover the smallest possile distance. Routes to School raw a network showing the major routes from your home to school. You may use different modes of transport along different edges on your plan. stimate distances etween nodes using a map or street directory. stimate times etween nodes y trialling them. Use network ideas to estalish the shortest and quickest routes etween home and school. Rememer these are not necessarily the same. Watering Plan onsider possile positions for sprinklers for an area of lawn at home or at school. Locate the source of water and plan the laying of pipes to ring water to the sprinklers so that the cost of piping is minimised. INTRPRTING INORMTION WITH MTRIS matrix is a rectangular array of numers. The plural of matrix is matrices. Matrices can e used to store information aout networks. They are particularly useful for large and complex networks. omputers and graphic calculators use matrices for many tasks, so they are very useful tools for dealing with networks. The matrix used to store a network is called an adjacency matrix. TH JNY MTRIX In the network elow we see the possile paths etween the houses of five friends. These paths can e displayed in an adjacency matrix. ach vertex is represented y a row and a column in the matrix, so the numer of rows and columns equals the numer of vertices. In general, if a network has n nodes its adjacency matrix representation is n n. n n n matrix is called a square matrix as it has the same numer of rows as columns. The entry in the row corresponding to vertex X and column corresponding to vertex Y is the numer of edges leading directly from X to Y. To The adjacency matrix for the network aove is therefore: 0 0 0 0 One path from to rom 0 0 0 0 0 Two paths from to

9 NTWORKS N MTRIS (hapter ) (T) UNIRT NTWORKS The five-friends introductory example is an undirected network and its adjacency matrix has some special features. Let us consider another example: xample on, Wei and Sam live in different cities. They can communicate with each other phone y phone, fax, or email. a Which people have: i internet access ii fax machines? ind the adjacency matrix of this undirected network. a i on and Wei ii on and Sam Initially we can summarise the information in tale form: To nodes S W which has rom 0 adjacency S 0 matrix W 0 fax email S Self Tutor W 0 0 0 onsider the adjacency matrices for the undirected networks we have seen so far. Notice that in oth cases: ² the matrices are symmetric aout the leading diagonal. This will e true for all undirected networks. ² the leading diagonal consists of all 0s. Will this e true for all undirected networks? 0 0 0 0 0 0 0 0 0 Other features of networks are also easily seen from their matrices. or example: ² a row of zeros corresponds to an isolated vertex ² a non-zero numer on the leading diagonal shows a loop. 0 0 0 isolated vertex loop G has adjacency matrix: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 vertex is isolated vertex has a loop