Adjacency Matrices and Airlines

Name ____________________________________ Date ____________
Algebra2/Trig Apps: Adjacency Matrices
Taken from http://aix1.uottawa.ca/~jkhoury/graph.htm
The Königsberg Bridge Problem
Königsberg was a city in Russia situated on the Pregel River, which served as the residence of the
dukes of Prussia in the 16th century. Today, the city is named Kaliningrad, and is a major industrial
and commercial centre of western Russia. The river Pregel flowed through the town, dividing it into
four regions, as in the following picture.
C
A
D
B
In the eighteenth century, seven bridges
connected the four regions. Königsberg people
used to take long walks through town on
Sundays. They wondered whether it was
possible to start at one location in the town,
travel across all the bridges without crossing
any bridge twice and return to the starting
point. This problem was first solved by the
prolific Swiss mathematician Leonhard Euler,
who, as a consequence of his solution invented
the branch of mathematics now known as graph
theory.
Understanding the reading:
a) What country is Königsberg in?
b) How many regions of Königsberg are there?
c) How many bridges connect the regions of Königsberg?
d) What did the people in Königsberg want to know about the bridges? (in your own words.)
e) According to the picture, is there a bridge that connects region A to B?
f) If so, how many?
g) According to the picture, is there a bridge that connects region D to B?
h) If so, how many?
i) Name 2 distinct paths you can take to get from region A to region D. (Example: You can go
from A to D directly. How else can you go, even if it’s not the best possible way?)
Name ____________________________________ Date ____________
Basic concepts of graph theory
A graph is a collection of points called vertices,
joined by lines called edges
(edges don’t need to be straight!!):
A graph is called directed or a digraph if its edges
are directed (that means they have a specific
direction).
A path joining two vertices of a digraph is a sequence of distinct vertices and directed edges.
A graph is called connected if there is a path connecting any two distinct vertices. It is called
disconnected otherwise:
Understanding the reading:
1. Look back at the picture of Königsberg, draw a graph (not a digraph) of the situation. If there
is more than one bridge from one place to another, connect the vertices with more than one
line.
C
A
B
D
Name ____________________________________ Date ____________
Graph Theory is now a major tool in mathematical research, electrical engineering, computer
programming and networking, business administration, sociology, economics, marketing, and
communications. For instance, problems of efficiently planning routes for mail delivery, garbage
pickup, snow removal, diagnostics in computer networks, and others, can be solved using models that
involve paths in graphs.
How do Matrices Tie In?
Matrices are a very useful way of studying graphs, since they turn the picture into numbers.
An Adjacency Matrix shows what vertices are connected. I
 If there is a path from one vertex to another, then you write a “1.”
 If two vertices are NOT connected, write a “0.”
Example: The adjacency matrix for Königsberg problem is:
𝐴
𝐵
𝐶
A
B
[
C
D
𝐷
]
2. Write the adjacency Matrix for Graph G1, below.
P1 P2 P3 P4 P5 P6 P7
P1
P2
P3
P4
P5
P6
P7
A
B
C
D
3. If the adjacency matrix for four towns, A, B, C, and D are given below, draw a graph
representing the situation.
A B C D
0 0 1 1
0 0 1 0
[
]
1 1 0 0
1 0 0 0
Name ____________________________________ Date ____________
Adjacency Matrices and Airlines
Taken from http://courses.ncssm.edu/math/TCMConf/TCM2004/TCMTalks/MatrixApps.pdf
You have been hired by the website travelocity.com to help people plan trips between various cities.
Often your customers are business travelers so that they want to travel between cities in the morning
to conduct a day’s business. Large cities often provide flights to many cities, but small cities often are
quite limited in the number of cities that they service.
Your customers are particularly interested in travel between the following cities: Albany, Boston, New
York, Philly, Wash, Richmond, Detroit, and Las Vegas. For simplicity, we will only use the first letter to
refer to the city. Here is the flight information that you are given.
From Boston there are flights to N, P, W, D
From Albany there are flights to N, W
From New York there are flights to B, P, W, R, D, L
From Philly there are flights to N, B, W, R
From Wash there are flights to B, A, N, R, P, L
From Richmond there are flights to N, P, W
From Detroit there are flights to B, N
From Las Vegas there are flights to N, W
1. Make a graph of this information where vertices represent cities and every edge represents a
flight.
2. Make an adjacency matrix for the information.
B
B
A
N
P
W
R
D
L
A
N
P
W
R
D
L
Name ____________________________________ Date ____________
3. Is there a round-trip path between every city that is connected? How is it indicated on the matrix
if a flight that goes from one city to another, but does not return?
The numbers in an adjacency matrix indicate how many paths exist from one vertex of a graph to
another. If you square that matrix, M2 (multiply it by itself,) the resulting values indicate how many
two-stop paths exist from one vertex to another.
4. Enter the matrix in your calculator and square it. Write your answer here.
B
A
N
P
W
R
D
L
B
A
N
P
W
R
D
L
5. What does this matrix tell you about Washington to New York?
6. Give an explanation of how this information might be valuable to airlines.
7. What do you think the cube of the matrix (M3) represents?