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

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 2
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.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern