Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Show that a greedy algorithm that schedules talks in a lecture hall, as described in Example 7, by selecting at each step the talk that overlaps the fewest other talks, does not always produce an optimal schedule.

Short Answer

Expert verified

It is proved that the greedy algorithm that schedules talks in a lecture hall does not always produce an optimal schedule.

Step by step solution

01

Step 1:

In order to show that this algorithm does not always give an output schedule, then we construct a counter example.

So, let us consider three talks:

Talk 1 starts at 8 am and ends at 9.15 am

Talk 2 starts at 9 am and ends at 10am

Talk 3 starts at 9.45 am and ends at 11am .

02

Step 2:

So, now we will select Talk 2 since it is shortest.

And, as once Talk 2 is selected then it is not possible to select Talk 1 , as it is not compatible.

Therefore, it is proved that the greedy algorithm that schedules talks in a lecture hall does not always produce an optimal schedule.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free