{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

9. Min Trees - MATH 224 Discrete Mathematics Finding a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
8/27/09 11 MATH 224 – Discrete Mathematics A spanning tree of a graph is a subgraph that contains all the nodes of a graph and the minimum number of edges to connect the nodes. If the graph has N nodes how many edges will the spanning tree contain? Finding a Minimum Spanning Tree 0 4 3 1 2 6 5 The six edges in green represent a spanning tree for this graph. 0 1 2 3 4 5 6 0 0 1 1 1 1 0 1 1 1 0 1 0 1 1 1 2 1 1 0 0 0 1 0 3 1 0 0 0 0 0 0 4 1 1 0 0 0 1 0 5 0 1 1 0 1 0 1 6 1 1 0 0 0 1 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8/27/09 22 MATH 224 – Discrete Mathematics A minimum spanning tree of a graph is a subgraph that contains all the nodes of a graph and edges to connect the nodes with minimum cost. Kruskal’s algorithm selects one edge at a time starting with the smallest and avoiding cycles. Kruskal’s algorithm is called a greedy algorithm. Finding a Minimum Spanning Tree 0 4 3 1 2 6 5 0 1 2 3 4 5 6 0 0 5 9 3 2 0 5 1 5 0 8 0 5 3 3 2 9 8 0 0 0 4 0 3 3 0 0 0 0 0 0 4 2 5 0 0 0 5 0 5 0 3 4 0 5 0 2 6 5 3 0 0 0 2 0 5 3 2 3 3 4 8 5 2 5 9 5
Background image of page 2
8/27/09 33 MATH 224 – Discrete Mathematics Select edge {0, 4} and {5, 6} first since they are the smallest.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}