Minimum Spanning Tree - Data Structures - Lecture Slides, Slides of Data Structures and Algorithms

Some concept of Data Structures are Abstract, Balance Factor, Complete Binary Tree, Dynamically, Storage, Implementation, Sequential Search, Advanced Data Structures, Graph Coloring Two, Insertion Sort. Main points of this lecture are: Minimum Spanning Tree, Graph, Vertices, Graph, Subgraph, Complete Graph, Cost, Complete Graph, Minimum Spanning Tree, Kruskal'S Algorithm

Typology: Slides

2012/2013

Uploaded on 04/30/2013

dinpal
dinpal 🇮🇳

3.6

(12)

73 documents

1 / 74

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Minimum Spanning Tree
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a

Partial preview of the text

Download Minimum Spanning Tree - Data Structures - Lecture Slides and more Slides Data Structures and Algorithms in PDF only on Docsity!

Minimum Spanning Tree

A spanning tree of a graph is just a subgraph that

contains all the vertices and is a tree.

A graph may have many spanning trees.

or or or

Graph A Some Spanning Trees from Graph A

Spanning Trees

Minimum Spanning Trees

The Minimum Spanning Tree for a given graph is the Spanning Tree of

minimum cost for that graph.

Complete Graph Minimum Spanning Tree

Algorithms for Obtaining the Minimum Spanning Tree

  • Kruskal's Algorithm
  • Prim's Algorithm
  • Boruvka's Algorithm

The steps are:

  1. The forest is constructed - with each node in a separate tree.
  2. The edges are placed in a priority queue.
  3. Until we've added n-1 edges,
    1. Extract the cheapest edge from the queue,
    2. If it forms a cycle, reject it,
    3. Else add it to the forest. Adding it to the forest will join two

trees together.

Every step will have joined two trees in the forest together, so that at

the end, there will only be one tree in T.

A

B C

D

E

F

G

H

I

J

Complete Graph

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Sort Edges

(in reality they are placed in a priority

queue - not sorted - but sorting them

makes the algorithm easier to visualize)

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Cycle

Don’t Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Add Edge

A

B C

D

E

F

G

H

I

J

B

B

D

J

C

C

E

F

D

D H

J

E G

F

F

G

I

G

G

I

J

H J

I J

A D

B C

A B

Cycle

Don’t Add Edge