Untitled Document
Untitled Document
Student
The student has a limited amount of time and energy for the day.
The goal is to determine the optimal allocation of tasks to time slots to maximize
the total benefit, ensuring all tasks are completed within their deadlines and
without exceeding the available time and energy.
1.2 Constraints
1.3 Input
● An integer n representing the number of tasks.
● An integer Emax representing the maximum energy available for the day.
● dt: Duration.
● bt: Benefit.
● dlt : Deadline.
● The student's hourly energy consumption rate for tasks.
1.4 Output
A schedule of tasks that maximizes the total benefit, ensuring all tasks meet their
deadlines and the total time and energy consumption are within the allowed limits.
Example
2.1 Input
● Tasks:
● Task 1: (2 hours,70 benefit,5 hours deadline) - Study for Math
● Tmax =8 hours
● Emax =50 units
● Hourly energy consumption rate = 5 units/hour
2.2 Output
DP[i][t][e]=max(DP[i−1][t][e],max(DP[i−1][t−di ][e−di ⋅
energy_rate]+bi))
This example illustrates how a university student can manage their daily tasks by
applying dynamic programming to optimize the use of their time and energy,
ensuring they gain the maximum benefit from their activities.