cse101_11_18_11

cse101_11_18_11 - Greedy Algortihms 1. Interval Scheduling...

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

View Full Document Right Arrow Icon
Greedy Algortihms 1. Interval Scheduling a. Given intervals [s i , e i ], I = 1…n, find the largest set of them that do not overlap b. Greedy Strategy: Repeat Pick the interval with earliest ending ime that doesn’t conflict with intervals already chosen. c. Why is this optimal? Let e* be some optimal solution. E* = [s 1 *, e 1 *], [s 2 *, e 2 *], … in order Quality of solution is e*. let e be our algorithm’s solution. E = [s 1 , e 1 ], [s 2 , e 2 ], in order Want to show e = e* Claim: for all k, e <= e* Proof: our alg chooses c 1 to be the earliest ending time. Therefore, e 1 <= e 1 *. When choosing the second interval, [s 2 *, e 2 *] is a possibility. We pick the earliest ending time, so e 2 <= e 2 *. And so on. 2. Minimum spanning tree a. A network-building problem You want to network a set of computers. You have a set of potential links between pairs of computers. Each link has a maintenance cost. Find the cheapest network. Make a graph
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/09/2012 for the course CSE 101 taught by Professor Staff during the Spring '08 term at UCSD.

Page1 / 2

cse101_11_18_11 - Greedy Algortihms 1. Interval Scheduling...

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

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