vocabulary and representations of graphs. nc standard course of study competency goal 1: the learner...

33
Vocabulary and Representations of Graphs

Upload: jerome-townsend

Post on 17-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Vocabulary and Representations of Graphs

Page 2: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

NC 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.

Page 3: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Graphs

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.

Page 4: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Explore This

Suppose the following diagram represents the starting five players on a high school basketball team, and the edges denote friendships.

A

C

B

E

D

Page 5: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Exploration (cont’d)

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.

Page 6: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Graph Questions

1. Which player has only one friend?

2. How many friends does E have? Who are they?

3. Redraw the graph so that A has no friends.

Page 7: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Exploration (cont’d)

Consider the following solutions:

1. A.

2. Two, C and B.

3. The graph shown below.B

C

D

E

A

Page 8: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Connected 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.

Page 9: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Explore This

Let’s 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.

A

C E

B

D

Page 10: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Adjacent 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.

Page 11: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Redrawing the Graph

Let’s try redrawing the graph so there is direct access from each room to every other room.

Page 12: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Possible SolutionsA B

C

D

EA

B

C

D

E

Page 13: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Similarities

Even though the graphs appear to be different, they are structurally the same, so they are considered to be the same graph.

Page 14: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Complete 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.

Page 15: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Other 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}

Page 16: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Adjacency 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.

Page 17: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Adjacency Matrix (cont’d)

0 0 1 0 0

0 0 1 1 1

1 1 0 1 1

0 1 1 0 0

0 1 1 0 0

L

N

MMMMMM

O

Q

PPPPPP

A

B

C

D

E

A B C D E

Page 18: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Adjacency Matrix (cont’d)

The entry in row 2, column 4 is a 1, which indicates that an edge exists between vertices B and D.

Page 19: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Policy 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!)

Page 20: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems

1. 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.

Page 21: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

2. Construct a graph for each of the following sets of vertices and edges. Which of the graphs are connected? Which are complete?

a. V={A, B, C, D, E} b. V={M, N, O, P, Q, R, S}

E={AB, AC, AD, AE, BE} E= {MN, SR, QS, SP, OP}

c. V={E, F, G, J, K, M} d. V={W, X, Y, Z}

E={EF, KM, FG, JM, EG, KJ} E={WX, XZ, YZ, XY, WZ, WY}

Page 22: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

3. 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?

Page 23: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

4. 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.

5. Construct a graph for each adjacency matrix. Label the Vertices A, B, C, ….

Page 24: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

a.

b.

c. 0 1 0 0

1 0 1 1

0 1 0 1

0 1 1 0

L

N

MMMM

O

Q

PPPP

0 1 0 0 1

1 0 1 0 1

0 1 0 1 1

0 0 1 0 1

1 1 1 1 0

L

N

MMMMMM

O

Q

PPPPPP

0 1 0 0 0

1 0 0 0 0

0 0 0 1 1

0 0 1 0 1

1 0 1 1 0

L

N

MMMMMM

O

Q

PPPPPP

Page 25: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

6. Determine an adjacency matrix for each of the following graphs:

A B

C D

R

S

M

N

O

P

Page 26: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

7. Give the adjacency matrix for the following graph:

V

W

X

Y

Z

Page 27: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

a. What do you notice about the main diagonal of the matrix?

b. A Matrix may be symmetric with respect to one of its rows, columns or diagonals. Does the matrix above possess symmetry? If so, where?

c. What would a 1 on the main diagonal indicate? What would a 2 in the second row, first column, indicate?

Page 28: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

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.

Page 29: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

W

V

X

Y

Z

Page 30: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

10. 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:

Page 31: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

A

D

C

B

E

Page 32: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

b. What is the degree of each of the five vertices?

11. Complete the chart below for the sum of the degrees of the vertices in a complete graph.

Graph# of

VerticesSum of Degrees of all of the Vertices

Recurrence Relation

K1 1 0

K2 2 2 T2=T1 +2

K3 3 6 T3=T2+4

K4

K5

K6

Page 33: Vocabulary and Representations of Graphs. NC Standard Course of Study Competency Goal 1: The learner will use matrices and graphs to model relationships

Practice Problems (cont’d)

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.