Assume there are n courses offered by the university, where each course has one or no prerequisites. If course j is the prerequisite for course i, then we are only allowed to take course i after course j. And after taking each course i, we can get a reward r_i. Given the reward and prerequisite for each course, design an algorithm to find the maximum total reward we can get by taking m courses. The time complexity should be O(nm^2).

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter14: Game Theory
Section14.3: Linear Programming And Zero-sum Games
Problem 9P
icon
Related questions
Question

Assume there are n courses offered by the university, where each course has one or no prerequisites.
If course j is the prerequisite for course i, then we are only allowed to take course i after course j. And after taking each course i, we can get a reward r_i. Given the reward and prerequisite for each course, design an
algorithm to find the maximum total reward we can get by taking m courses. The time complexity should
be O(nm^2).

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Bellman operator
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole