Docsity

Greedy Algorithms for Interval Scheduling: Minimizing Lateness - Prof. Chandra S. Chekuri, Study notes of Algorithms and Programming

Partial preview of the text

Download Greedy Algorithms for Interval Scheduling: Minimizing Lateness - Prof. Chandra S. Chekuri and more Study notes Algorithms and Programming in PDF only on Docsity!

CS 473: Algorithms

Chandra Chekuri [email protected] 3228 Siebel Center

University of Illinois, Urbana-Champaign

Fall 2008

Problem Types

Part I

Problems and Terminology

Problem Types

Terminology

A problem Π consists of an infinite collection of inputs {I 1 , I 2 ,... , }. Each input is referred to as an instance. The size of an instance I is the number of bits in its representation. For an instance I , sol(I ) is a set of feasible solutions to I. Typical implicit assumption: given instance I and y ∈ Σ∗, there is an way to check if y ∈ sol(I ). In other words, problem is in NP. For optimization problems each solution s ∈ sol(I ) has an associated value. Typical implicit assumption: given s, can compute value efficiently.

Problem Types

Problem Types

Decision Problem: Given I output whether sol(I ) = ∅ or not. Search Problem: Given I , find a solution s ∈ sol(I ) if sol(I ) 6 = ∅. Optimization Problem: Given I , Minimization problem. Find a solution s ∈ sol(I ) of minimum value Maximization problem. Find a solution s ∈ sol(I ) of maximum value Notation: opt(I ): interchangeably (when there is no confusion) used to denote the value of an optimum solution or some fixed optimum solution.

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

What is a Greedy Algorithm?

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

What is a Greedy Algorithm?

No real consensus on a universal definition.

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

Pros and Cons of Greedy Algorithms

Pros: Usually (too) easy to design greedy algorithms Easy to implement and often run fast since they are simple Several important cases where they are effective/optimal Lead to a first-cut heuristic when problem not well understood

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

Pros and Cons of Greedy Algorithms

Pros: Usually (too) easy to design greedy algorithms Easy to implement and often run fast since they are simple Several important cases where they are effective/optimal Lead to a first-cut heuristic when problem not well understood Cons: Very often greedy algorithms don’t work. Easy to lull oneself into believing they work Many greedy algorithms possible for a problem and no structured way to find effective ones

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

Greedy Algorithm Types

Crude classification: Non-adaptive: fix some ordering of decisions apriori and stick with the order Adaptive: make decisions adaptively but greedily/locally at each step

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

Greedy Algorithm Types

Crude classification: Non-adaptive: fix some ordering of decisions apriori and stick with the order Adaptive: make decisions adaptively but greedily/locally at each step

Plan: See several examples Pick up some proof techniques

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

The AlgorithmCorrectness Running TimeExtensions and Comments

Interval Scheduling

Input A set of jobs with start and finish times to be scheduled on a resource (example: classes and class rooms) Goal Schedule as many jobs as possible Two jobs with overlapping intervals cannot both be scheduled!

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

The AlgorithmCorrectness Running TimeExtensions and Comments

Interval Scheduling

Input A set of jobs with start and finish times to be scheduled on a resource (example: classes and class rooms) Goal Schedule as many jobs as possible Two jobs with overlapping intervals cannot both be scheduled!

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

The AlgorithmCorrectness Running TimeExtensions and Comments

Greedy Template

Initially R is the set of all requests A is empty (* A will store all the jobs that will be scheduled *) while R is not empty choose i ∈ R add i to A remove from R all requests that overlap with i return the set A

Main task: Decide the order in which to process requests in R ES SP FC EF

Interval Scheduling Scheduling to Minimize LatenessInterval Partitioning

The AlgorithmCorrectness Running TimeExtensions and Comments

Earliest Start Time

Process jobs in the order of their starting times, beginning with those that start earliest.

Back Counter