Transcript
Page 1: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Graph Theory

Trees

Page 2: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

WHAT YOU WILL LEARN• Trees, spanning trees, and

minimum-cost spanning trees

Page 3: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Definitions

A tree is a connected graph in which each edge is a bridge.

A spanning tree is a tree that is created from another graph by removing edges while still maintaining a path to each vertex.

Page 4: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Examples

Graphs that are trees. Graph that are not trees.

Page 5: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Example: Determining Spanning Trees

Determine two different spanning trees for the graph shown.

A

B

C

E F H

D G

A

B

C

E F H

D G A

B

C

E F H

D G

Page 6: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Minimum-cost spanning tree

A minimum cost spanning tree is the least expensive spanning tree of all spanning trees under consideration.

Page 7: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Kruskal’s Algorithm

To construct the minimum-cost spanning tree from a weighted graph:1. Select the lowest-cost edge on the graph.2. Select the next lowest-cost edge that does not

form a circuit with the first edge.3. Select the next lowest-cost edge that does not

form a circuit with the previously selected edges.4. Continue selecting the lowest-cost edges that do

not form circuits with the previously selected edges.

5. When a spanning tree is complete, you have the minimum-cost spanning tree.

Page 8: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Example: Kruskal’s Algorithm

Use Kruskal’s algorithm to determine the minimum spanning tree for the weighted graph shown. The numbers along the edges represent dollars.

A

B

C

G

D

E

F

12

11

10 5

22

14

4

17

22

18

Page 9: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Solution

Pick the lowest-cost edge of the graph, edge CD which is $4.

Next we select the next lowest-cost edge that does not form a circuit; we select edge CG which is $5.

A

B

C

G

D

E

F

12

11

10 5

22

14

4

17

22

18

Page 10: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Solution (continued)

Continue selecting edges, being careful not to form a circuit.

The total cost would be$12 + $10 + $5 + $14 +$18 + $4 = $63.

A

B

C

G

D

E

F

12

11

10 5

22

14

4

17

22

18

Page 11: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Determine a spanning tree for the graph shown below.

a.

c.

b.

d.

Page 12: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Determine a spanning tree for the graph shown below.

a.

c.

b.

d.

Page 13: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Determine the minimum-cost spanning tree for the following weighted graph.

Page 14: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

a.

c.

b.

d.

Page 15: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

a.

c.

b.

d.

Page 16: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Kathleen is planning on installing a new computer network at her small business. Her current system has computers already in place as shown in the figure below. The numbers are shown in feet.

Page 17: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Determine the minimum-cost spanning tree that reaches each computer.

a.

c.

b.

d.

Page 18: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

Determine the minimum-cost spanning tree that reaches each computer.

a.

c.

b.

d.

Page 19: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

If the new networking system materials cost $2.20 per foot, what is the cost of installing the system

a. $79.20

b. $83.60

c. $85.80

d. $112.20

Page 20: Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

If the new networking system materials cost $2.20 per foot, what is the cost of installing the system

a. $79.20

b. $83.60

c. $85.80

d. $112.20


Top Related