Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Greedy

Chen
November 01, 2022

 Greedy

Chen

November 01, 2022
Tweet

More Decks by Chen

Other Decks in Science

Transcript

  1. Activity Selection: Earliest End Time Earliest end time looks good:

    Note there are equally good alternatives here, but nothing better. But one example does not convince us.. 51 / 55
  2. Refute Maleficent’s Claim Ok Maleficient,... I We want you to

    think about the first activity you picked that we did not. I Can you just swap it out with one of ours that overlaps with it? I If so, just do that (you aren’t getting any extra benefit). I Repeat this swapping until the answer is no... 53 / 55
  3. Refute Maleficent’s Claim So now we have... I But we

    can’t just swap out Maleficent’s activity for ours, so the picture needs to look more like this: Because Maleficent needs some other activity in her choices that conflicts with ours (so she can’t just swap) I But for that to happen, her activity has to end earlier than ours—but we picked greedily based on end time! 54 / 55