CS223-0401-Prim

CS223-0401-Prim - Broadcasting problem in Computer Networks...

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

View Full Document Right Arrow Icon
CS223 Advanced Data Structures and Algorithms 1 Prim’s Minimum Spanning Tree Algorithm Prim’s Minimum Spanning Tree Algorithm Neil Tang Neil Tang 4/1/2008 4/1/2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview The minimum spanning tree problem An application Prim’s algorithm Implementation and time complexity
Background image of page 2
CS223 Advanced Data Structures and Algorithms 3 Minimum Spanning Tree Problem Minimum Spanning Tree Problem The cost of a tree: The sum of the weights of all links on the tree. The Minimum Spanning Tree (MST) problem: Given a weighted undirected graph G, find a minimum cost tree connecting all the vertices on the graph
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS223 Advanced Data Structures and Algorithms 4 Minimum Spanning Tree Problem Minimum Spanning Tree Problem
Background image of page 4
CS223 Advanced Data Structures and Algorithms 5 An Application An Application
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Broadcasting problem in Computer Networks: Find the minimum cost route to send a package from a source node to all the other nodes in the network. CS223 Advanced Data Structures and Algorithms 6 Prim’s Algorithm Prim’s Algorithm CS223 Advanced Data Structures and Algorithms 7 Prim’s Algorithm Prim’s Algorithm CS223 Advanced Data Structures and Algorithms 8 Prim’s Algorithm Prim’s Algorithm CS223 Advanced Data Structures and Algorithms 9 Implementation and Time Complexities Implementation and Time Complexities Difference between Prim and Dijkstra: 1) Arbitrarily pick a node to start with; 2) Relaxation d w =min(d w , c w,v ) Trivial: O(|V| 2 + |E|) = O(|V| 2 ) Heap: deleteMin |V| times + decreaseKey |E| times O(|V|log|V| + |E|log|V|) = O (|E|log|V|)...
View Full Document

Page1 / 9

CS223-0401-Prim - Broadcasting problem in Computer Networks...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online