Spanning G is a subgraph that has all the vertices of G. Trees - - PowerPoint PPT Presentation

spanning
SMART_READER_LITE
LIVE PREVIEW

Spanning G is a subgraph that has all the vertices of G. Trees - - PowerPoint PPT Presentation

SpanningSubgraphs MathematicsforComputerScience MIT6.042J/18.062J A spanning subgraph of graph Spanning G is a subgraph that has all the vertices of G. Trees Albert R Meyer, April 8, 2013 Albert R Meyer, April 8, 2013 spanning.1


slide-1
SLIDE 1

Albert R Meyer, April 8, 2013

Spanning Trees

spanning.1

Mathematics for Computer Science MIT 6.042J/18.062J

Albert R Meyer, April 8, 2013

Spanning Subgraphs

A spanning subgraph of graph G is a subgraph that has all the vertices of G.

spanning.2

Albert R Meyer, April 8, 2013

Spanning Subgraphs

A spanning subgraph of graph G is a subgraph that has all the vertices of G. A spanning tree is a spanning subgraph that is a tree.

spanning.3

Albert R Meyer, April 8, 2013

Spanning Trees

spanning.4

1

slide-2
SLIDE 2

Albert R Meyer, April 8, 2013

Spanning Trees

a spanning tree

spanning.5

Albert R Meyer, April 8, 2013

Spanning Trees

another spanning tree (can have many)

spanning.6

Albert R Meyer, April 8, 2013

Spanning Trees

Lemma: G connected implies

G has a spanning tree Pf: Namely, any minimum edge connected spanning graph.

spanning.7

Albert R Meyer, April 8, 2013

Minimum Weight Spanning Trees

Suppose edges have weights:

min-tree.9

Find min weight spanning tree?

4 4 1 3 6 9 2 1 7

2

slide-3
SLIDE 3

Albert R Meyer, April 8, 2013

Build MST using gray edges

  • Start with vertices
  • Color components black & white
  • gray edge ::=
  • add min weight gray edge
min-tree.10

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.11

color components

4 4 1 3 6 9 2 1 7

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.12

color components

4 4 1 3 6 9 2 1 7

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.13

gray edges

4 4 1 3 6 9 2 1 7

3

slide-4
SLIDE 4

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.14

gray edges: min weight

4 4 1 3 6 9 2 1 7

Albert R Meyer, April 8, 2013

4 4 1 3 6 9 2 1 7

Minimum Spanning Trees

min-tree.15

re-color components

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.16

re-color components

4 4 1 3 6 9 2 1 7

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.17

gray edges

4 4 1 3 6 9 2 1 7

4

slide-5
SLIDE 5

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.18

gray edges: min weight

4 4 1 3 6 9 2 1 7

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.19

4 4 1 3 6 9 2 1 7

re-color components

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.20

4 4 1 3 6 9 2 1 7

re-color components

Albert R Meyer, April 8, 2013

Minimum Spanning Trees

min-tree.21

etc

4 4 1 3 6 9 2 1 7

5

slide-6
SLIDE 6

Ways to grow an MST

  • start at any vertex, keep

building one tree. (Prim)

  • keep choosing min weight edge

between diff components (Kruskal)

  • grow trees in parallel (Meyer)

Albert R Meyer, April 8, 2013

min-tree.22

6

slide-7
SLIDE 7

MIT OpenCourseWare http://ocw.mit.edu

6.042J / 18.062J Mathematics for Computer Science

Spring 2015 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.