The Minimum Cost Spanning Tree Problem

Slides:



Advertisements
Similar presentations
and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action
Advertisements

Greed is good. (Some of the time)
1 Greedy 2 Jose Rolim University of Geneva. Algorithmique Greedy 2Jose Rolim2 Examples Greedy  Minimum Spanning Trees  Shortest Paths Dijkstra.
Dynamic Sets and Data Structures Over the course of an algorithm’s execution, an algorithm may maintain a dynamic set of objects The algorithm will perform.
CSE 421 Algorithms Richard Anderson Lecture 10 Minimum Spanning Trees.
Dynamic Sets and Data Structures Over the course of an algorithm’s execution, an algorithm may maintain a dynamic set of objects The algorithm will perform.
9/10/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 8 Greedy Graph.
Minimum Spanning Trees
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
1 Chapter 4 Minimum Spanning Trees Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Lecture: Priority Queue. Questions Is array a data structure? What is a data structure? What data structures are implemented by array? Priority queue.
Lecture: Priority Queue
Lecture ? The Algorithms of Kruskal and Prim
Algorithm Analysis Fall 2017 CS 4306/03
Data Structures and Algorithms I Day 19, 11/3/11 Edge-Weighted Graphs
Introduction to Algorithms
Network Simplex Animations
Heapsort.
Lecture 12 Algorithm Analysis
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Dijkstra’s Algorithm with two levels of buckets
Minimum-Cost Spanning Tree
Minimum Spanning Tree.
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
Lecture 9 Greedy Strategy
15.082J & 6.855J & ESD.78J Visualizations
15.082J & 6.855J & ESD.78J Visualizations
Lecture 6 Shortest Path Problem.
Data Structures – LECTURE 13 Minumum spanning trees
Greedy Algorithm (17.4/16.4) Greedy Algorithm (GA)
Breadth first search animation
Lecture 4 Graph Search.
Lecture 19-Problem Solving 4 Incremental Method
Introduction to Minimum Cost Flows
Spanning Tree Algorithms
and 6.855J Flow Decomposition
Primal-Dual Algorithm
Successive Shortest Path Algorithm
15.082J & 6.855J & ESD.78J Radix Heap Animation
Network Optimization Depth First Search
Introduction to Algorithms
Min Global Cut Animation
Autumn 2016 Lecture 10 Minimum Spanning Trees
Dijkstra’s Algorithm for Shortest Paths
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Reading before Lecture 13
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Network Optimization Topological Ordering
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
and 6.855J Dijkstra’s Algorithm
Visualizations Dijkstra’s Algorithm
Introduction to Maximum Flows
Network Simplex Animations
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
Eulerian Cycles in directed graphs
and 6.855J Topological Ordering
Minimum spanning trees
15.082J & 6.855J & ESD.78J Visualizations
Implementation of Dijkstra’s Algorithm
and 6.855J Depth First Search
Breadth first search animation
OPIM 915 Fall 2010 Data Structures 23-38,
Prim’s algorithm for minimum spanning trees
Winter 2019 Lecture 10 Minimum Spanning Trees
Introduction to Maximum Flows
Asst. Prof. Dr. İlker Kocabaş
Minimum-Cost Spanning Tree
15.082J & 6.855J & ESD.78J Visualizations
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

The Minimum Cost Spanning Tree Problem Lecture 8 The Minimum Cost Spanning Tree Problem Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, the max flow problem, the minimum cost flow problem, and the multicommodity flow problem. This will be a very efficient way of introducing the four problems. (Perhaps under 10 minutes of class time.)

a

The Greedy Algorithm animation

The Greedy Algorithm in Action 35 10 30 15 25 40 20 17 8 11 21 1 2 3 4 5 6 7 2 4 6 1 3 5 7

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

The Greedy Algorithm in Action 10 10 8 8 2 4 4 6 2 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11

Correctness

Exchange Property

Self-Reducibility

Data Structures “Disjoint Sets”

Kruskal Algorithm with Data Structure

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 1 2 3 4 5 4 7 10 10 8 8 2 4 2 4 6 6 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11 root node 40

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 1 4 3 4 5 4 7 10 10 8 8 2 2 4 2 4 6 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 5 7 15 15 11 41

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 1 4 3 4 5 4 5 10 10 8 8 2 4 2 4 6 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 7 3 5 7 15 15 11 42

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 1 4 5 4 5 4 5 10 10 8 8 2 4 6 2 4 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 3 5 7 7 3 5 7 15 15 11 43

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 1 4 4 4 4 4 4 10 10 8 8 2 4 6 2 4 6 35 35 15 15 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 5 7 3 3 5 5 7 7 3 5 7 15 15 11 44

The Greedy Algorithm in Action Node 1 2 3 4 5 6 7 First 4 4 4 4 4 4 4 10 10 8 8 2 4 6 2 4 6 35 35 15 15 1 1 1 25 25 20 20 30 30 17 17 21 21 40 40 11 3 3 5 7 5 7 3 5 7 15 15 11 45

Prim’s algorithm animation

Correctness The cut-optimality Condition

Prim’s Algorithm in Action 10 8 2 2 4 4 6 6 35 15 1 1 25 20 30 17 21 40 11 3 5 7 3 5 7 15 The minimum cost arc from yellow nodes to green nodes can be found by placing arc values in a priority queue.

Prim’s Algorithm in Action 25 10 10 8 2 2 2 4 4 6 6 35 35 15 1 1 25 20 30 17 21 40 11 3 5 7 3 5 7 15

Prim’s Algorithm in Action 8 20 30 21 8 10 10 10 2 2 2 4 4 4 6 6 35 35 15 1 1 25 25 30 20 17 21 40 11 3 5 7 3 5 7 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 17 15 15 1 1 25 25 30 30 17 20 20 21 21 40 11 3 5 7 3 5 7 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 15 11 11 3 5 5 7 3 5 7 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 15 11 11 3 5 5 7 3 5 7 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 11 11 11 3 5 5 7 7 3 5 7 15 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 11 11 11 3 3 5 5 7 7 3 5 7 15 15 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 11 11 11 3 3 5 5 7 7 3 5 7 15 15 15

Prim’s Algorithm in Action 8 8 8 10 10 10 2 2 2 4 4 4 6 6 6 35 35 15 15 15 1 1 25 25 30 30 17 17 20 20 21 21 40 11 11 11 3 3 5 5 7 7 3 5 7 15 15 15

Sollin’s Algorithm animation

Correctness Cut-optimality Condition

Sollin’s Algorithm in Action 10 8 2 2 2 4 4 4 6 6 6 35 15 1 1 1 25 20 30 17 21 40 3 3 5 5 7 7 3 5 11 7 15 Treat all nodes as singleton components, and then select the min cost arc leaving the component.

Sollin’s Algorithm in Action 10 8 2 2 4 4 6 6 6 35 15 1 1 25 20 30 17 21 40 3 3 5 5 7 7 3 5 15 11 7 Find the min cost edge out of each component

Appendix: Priority Queue

Priority Queue A priority queue is a data structure for maintaining a set of elements, each with an associated value, called a key. A min-priority queue supports the following operations: Insert(S,x), Minimum(S), Extract-Min(S), Increase-Key(S,x,k). Min-Heap can be used for implementing min-priority queue.