20
2.3 Solving Network Problems with Matrices

2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Embed Size (px)

Citation preview

Page 1: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

2.3 Solving Network Problems with Matrices

Page 2: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Planning travel between different cities can become very complicated. If the number of cities and the number of alternative routes are small, the problem is relatively easy and can be handled with little more than paper and pencil. If the number of cities is large (even just 5 cities) or if there are many alternative routes, the human mind has great difficulty organizing and considering all the alternatives.

A matrix is a mathematical tool that is useful for organizing and dealing with large amounts of data. Matrices (plural for matrix) can be used to summarize the routes between cities and to even calculate the different number of routes. Airlines, train and bus companies, and truck dispatchers are some of the organizations that use matrices as they make plans for moving people or goods to and from various locations.

To see how matrices are used in transportation planning, let’s start with something simple: a problem involving three cities and then we’ll extend what we’ve learned to a more realistic problem involving six cities.

Page 3: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 1: Three cities

• A small airline serves three cities, Atlanta (ATL), Boston (BOS), and Charlotte (CLT), using a limited number of airplanes. The flight service planner needs a convenient method for keeping track of all possible trips connecting the three cities. She is concerned with direct, one stop over and two stop over trips. A one stop over trip means that you start at one city, say Atlanta, and make one stop, say Boston, then continue on to a final destination city, either Atlanta or Charlotte.

Page 4: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Diagram

The following diagram illustrates the routes between the three cities. An arrow illustrates a route in that direction.

BOSATLCLT

Page 5: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix

• We can create a matrix that represents the routes between our three cities. Such a matrix will need three rows and three columns, each row and column represent each of the three cities.

• For each cell in the matrix, we can place a 1 to indicate that there is one route between the city in the row and column for that cell. For example, there is one route between Atlanta and Boston, so there should be a 1 in the cell on the first row, second column.

BOSATLCLT

Complete the matrix

Atlanta Boston CharlotteAtlanta 0 1 0Boston

Charlotte

Page 6: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix

The following is the completed network matrix for the direct routes between Boston, Atlanta and Charlotte.

0 1 0

1 0 1

0 1 0

⎢ ⎢ ⎢

⎥ ⎥ ⎥

Page 7: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix Calculations• The power of mathematics is derived from what information one can

gains from its use. To see this power, first produce all the one stop over routes between the three cities. To get you started, is there a one stop over route between Atlanta and Atlanta? Yes, you fly Atlanta to Boston then back to Atlanta. Any others? No. So 1 goes in the first cell. Is there a one stop over route from Atlanta to Boston? No, you can fly from Atlanta to Boston, but your next hop will take you away from Boston, so 0 will go in the next cell. Is there a one stop over route from Atlanta to Charlotte? Yes, you fly Atlanta to Boston then Boston to Charlotte. So 1 goes in the third cell.

Atlanta Boston CharlotteAtlanta 1 0 1Boston

Charlotte

Complete the table

Page 8: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix Calculations

Here is the completed table

Atlanta Boston CharlotteAtlanta 1 0 1Boston 0 2 0

Charlotte 1 0 1

Page 9: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix Calculations

Take the original network matrix and enter it into [A] in your calculator.

Then calculate [A]2.

[A] =

0 1 0

1 0 1

0 1 0

⎢ ⎢ ⎢

⎥ ⎥ ⎥

Page 10: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix CalculationsCompare [A]2 to the table you created for one stop

over.

[A]2 =

1 0 1

0 2 0

1 0 1

⎢ ⎢ ⎢

⎥ ⎥ ⎥

Atlanta Boston CharlotteAtlanta 1 0 1Boston 0 2 0

Charlotte 1 0 1

What do you notice???

Page 11: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix Calculations

So, if you want to write the matrix that represents how many routes there are with one stop over you calculate [A]2.

What would you do to write the matrix that represents the number of routes with 2 stop overs?

How would you calculate the matrix that represents at most 2 stop overs?

Page 12: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Network Matrix Calculations

[A]2 = 1 stop over

[A]3 = 2 stopovers

[A] + [A]2 + [A]3 = at most 2 stopovers

Page 13: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 2: Six cities

• Consider six cities: Los Angeles (LAX), Atlanta (ATL), Pittsburgh (PIT), Miami (MIA), Charlotte (CLT), and Boston (BOS). Suppose the following network diagram represents train routes between the different cities.

BOSPITCLTMIAATLLA

Page 14: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 2: Six cities

Complete the following table that represents the direct routes between cities.

Boston Pittsburgh Charlotte Miami Atlanta LosAngeles

BostonPittsburghCharlotte

MiamiAtlanta

LosAngeles

BOSPITCLTMIAATLLA

Page 15: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 2: Six cities

Here is the table representing direct routes between different cities

Boston Pittsburgh Charlotte Miami Atlanta LosAngeles

Boston 0 1 1 0 0 0Pittsburgh 1 0 0 0 1 0Charlotte 0 1 0 1 0 0

Miami 0 0 1 0 1 0Atlanta 0 1 0 1 0 1

LosAngeles

0 1 0 0 0 0

Page 16: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 2: Six cities

1. Determine the matrix that represents all of the routes with one stop over.

2. Determine the matrix that represents at most one stop over.

Page 17: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 2: Six cities

[A]2 =

1 1 0 1 1 0

0 2 1 1 0 1

1 0 1 0 2 0

0 2 0 2 0 1

1 1 1 0 2 0

1 0 0 0 1 0

⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥

Question 1

[A] + [A]2 =

1 2 1 1 1 0

1 2 1 1 1 1

1 1 1 1 2 0

0 2 1 2 1 1

1 2 1 1 2 1

1 1 0 0 1 0

⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥

Question 2

Page 18: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 3: Spy Network

A network of spies has been created according to these specifications

- Alison is able to talk to Greg and Kari directly- Greg is able to contact Steve and Kari directly- Kari can contact Alison, Greg and Toni directly- Steve can contact Greg directly- Toni can contact everyone directly

- Each spy can contact him or herself

Page 19: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 3: Spy Network

Draw a network diagram based on the description and using the following layout

Alison

Greg Kari

SteveToni

Page 20: 2.3 Solving Network Problems with Matrices. Planning travel between different cities can become very complicated. If the number of cities and the number

Example 3: Spy NetworkAlisonGregKariSteveToni