# 11-twoup - Optimization Problems Each instance has a number...

This preview shows pages 1–4. Sign up to view the full content.

Optimization Problems Each instance has a number of candidate solutions . An objective function (usually) maps each candidate solution to a numeric value. The goal is to find a candidate solution that either minimizes or maximizes the objective function, depending on the problem. Example: Maximum subsequence sum. 1 Greedy Algorithms Builds an optimal solution incrementally. At each step, the partial solution is extended according to some criterion that is reasonably easy to evaluate. We must prove that whenever we have a partial solution that can be extended to an optimal solution, this extension will result in a partial solution that can be extended to an optimal solution. Not all optimization problems admit greedy algorithms; however, when a greedy algorithm is possible, it can usually be implemented efficiently. 2

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

View Full Document
Job Scheduling Input: A set of jobs { x 1 ,...,x m } , each having a natural number deadline and value . Output: An array sched [1 ..n ] such that for 1 i n , 0 sched [ i ] m ; if sched [ i ] negationslash = 0 , then i is no greater than the deadline of x sched [ i ] ; each j , 1 j m , appears at most once in sched [1 ..n ] ; and the sum of the values of the scheduled jobs is maximized. 3 Generalization The first step in constructing any greedy algorithm is to generalize the problem so that the input also includes a partial solution. A straightforward generalization includes as input a set of (unscheduled) jobs and a schedule of other jobs. In making the next scheduling decision, we don’t need to know which jobs occupy the occupied time slots — only that these slots are occupied. The generalization we use takes as input a set of unscheduled jobs and a boolean array indicating which time slots are available. 4
Scheduling Criterion We can transform this problem to a smaller instance by assigning a job to an unoccupied time slot so that this schedule can be extended to an optimal schedule.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern