Title: Vocabulary and Representations of Graphs
1Vocabulary and Representations of Graphs
2NC Standard Course of Study
- Competency Goal 1 The learner will use matrices
and graphs to model relationships and solve
problems. - Objective 1.02 Use graph theory to model
relationships and solve problems.
3Graphs
- Recall that a graph is a set of points called
vertices and a set of line segments called edges. - Often graphs are used to model situations in
which the vertices represent objects, and edges
are drawn between the vertices on the basis of a
particular relationship between the objects. - The important characteristics of a graph will
remain unchanged if the edges are curved.
4Explore This
- Suppose the following diagram represents the
starting five players on a high school basketball
team, and the edges denote friendships.
B
A
E
C
D
5Exploration (contd)
- This graph indicates that player C is friends
with all of the other players and that E had only
two friends, C and B. - Note that edge CE and edge DB intersect in this
graph but that their intersection does not create
a new vertex.
6Graph Questions
- Which player has only one friend?
- How many friends does E have? Who are they?
- Redraw the graph so that A has no friends.
7Exploration (contd)
- Consider the following solutions
- A.
- Two, C and B.
- The graph shown below.
B
A
E
C
D
8Connected Graphs
- The previous graph is not connected.
- A graph is connected if there is a path between
each pair of vertices. - In the previous graph, there was no path from
point A to any of the other vertices.
9Explore This
- Lets say that the graph instead represents rooms
in the school. - The vertices are connected if there are direct
hallways between two rooms. - According to the graph, a student can get from
room C directly to any of the other four rooms.
B
A
E
C
D
10Adjacent Vertices
- When two vertices are connected with an edge they
are said to be adjacent. - C is adjacent to A, B, D, and E.
- Although there is no direct route from D to room
A, it is possible to get from room D to room A by
going through room C. - Although a path exists between D and A, they are
not adjacent.
11Redrawing the Graph
- Lets try redrawing the graph so there is direct
access from each room to every other room.
12Possible Solutions
A
B
A
E
C
D
D
B
C
E
13Similarities
- Even though the graphs appear to be different,
they are structurally the same, so they are
considered to be the same graph.
14Complete Graphs
- Graphs in which every pair of vertices is
adjacent, are called complete graphs. - Complete graphs are often denoted by KN, where N
is the number of vertices in the graph. - The previous graphs are deciptions of a K5 graph.
15Other Ways to Represent Graphs
- There are other ways to represent graphs besides
a diagram. - A second method is to list the set of vertices
and the set of edges. This can be illustrated
as - Vertices A, B, C, D, E
- Edges AC, CB, CE, CD, BD, BE
16Adjacency Matrix
- This is the third type of way to represent a
graph. - It is used to represent the vertices and edges of
the graph in a computer. - A 5 X 5 matrix is formed by labeling the rows and
columns corresponding to the vertices. If an
edge exists between vertices, a 1 will appear in
the position in the matrix otherwise a 0 will
appear.
17Adjacency Matrix (contd)
A
B
C
D
E
A
B
C
D
E
18Adjacency Matrix (contd)
- The entry in row 2, column 4 is a 1, which
indicates that an edge exists between vertices B
and D.
19Policy Change
- From now on, for all practice problems, they need
to be written down and completed to be turned in
the day after we finish a section. - Please do them on paper which can be turned in
(so preferably, not on NOTES!)
20Practice Problems
- Mr. Butler bought six different types of fish.
Some of the fish can live in the same aquarium,
but others cannot. Guppies can live with
Mollies Swordtails can live with Guppies Gold
Rams can live only with Plecostomi and Piranhas
cannot live with any of the other fish. Draw a
graph to illustrate this.
21Practice Problems (contd)
- Construct a graph for each of the following sets
of vertices and edges. Which of the graphs are
connected? Which are complete? - a. VA, B, C, D, E b. VM, N, O, P, Q, R,
S - EAB, AC, AD, AE, BE E MN, SR, QS,
SP, OP - c. VE, F, G, J, K, M d. VW, X, Y, Z
- EEF, KM, FG, JM, EG, KJ EWX, XZ, YZ, XY, WZ,
WY
22Practice Problems (contd)
- Draw a diagram representing the graph with
vertices A, B, C, D, E, F and edged AB, CD,
DE, EC, EF. - a. Name two vertices that are not adjacent.
- b. F, E, C is one possible path from F to C.
This path has length of 2, since two edges were
traveled to get from F to C. Name a path from F
to C with a length of 3. - c. Is this graph connected? Why or why not?
- d. Is this graph complete? Why or why not?
23Practice Problems (contd)
- Draw a graph with 5 vertices in which vertex W is
adjacent to Y X is adjacent to Z and V is
adjacent to each of the other vertices. - Construct a graph for each adjacency matrix.
Label the Vertices A, B, C, .
24Practice Problems (contd)
25Practice Problems (contd)
- Determine an adjacency matrix for each of the
following graphs
A
B
P
O
R
D
C
M
S
N
26Practice Problems (contd)
- Give the adjacency matrix for the following
graph
W
Y
V
Z
X
27Practice Problems (contd)
- What do you notice about the main diagonal of the
matrix? - A Matrix may be symmetric with respect to one of
its rows, columns or diagonals. Does the matrix
above possess symmetry? If so, where? - What would a 1 on the main diagonal indicate?
What would a 2 in the second row, first column,
indicate?
28Practice Problems (contd)
- 8. Using the graph and the adjacency matrix in
exercise 7, find the sum of each row of the
matrix. What does the sum of the rows tell you
about the graph? - 9. The number of edges that have a specific
vertex as an endpoint is know as the degree or
valence of that vertex. In the graph on the next
slide, the degree of vertex W, denoted by deg(W)
is 4. Find the degree of each of the other
vertices.
29Practice Problems (contd)
W
Y
V
X
Z
30Practice Problems (contd)
- An edge that connects a vertex to itself is
called a loop. If a graph contains a loop or
multiple edges (more than one edge between two
vertices), the graph is know as a multigraph. - a. Give the adjacency matrix for the following
multigraph
31Practice Problems (contd)
A
D
C
E
B
32Practice Problems (contd)
- What is the degree of each of the five vertices?
- Complete the chart below for the sum of the
degrees of the vertices in a complete graph.
Graph of Vertices Sum of Degrees of all of the Vertices Recurrence Relation
K1 1 0
K2 2 2 T2T1 2
K3 3 6 T3T24
K4
K5
K6
33Practice Problems (contd)
- Write a recurrence relation that expresses the
relationship between the sum of the degrees of
all of the vertices for KN and the sum for KN-1.