0% found this document useful (0 votes)
6 views4 pages

Untitled Document

Uploaded by

anasblouch223
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Untitled Document

Uploaded by

anasblouch223
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Problem: Optimal Task Scheduling for a University

Student

1.1 Problem Statement


A university student has a busy day with multiple tasks to complete, such as
attending classes, studying, exercising, and social activities. The goal is to optimize
the schedule to maximize the total benefit from completing these tasks while
considering the available time and energy throughout the day.

The student receives a list of tasks, each characterized by:

● Duration: The time required to complete the task.


● Benefit: The value or importance of completing the task.
● Deadline: The latest time by which the task should be completed.

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

● The student can only perform one task at a time.


● The total time for all tasks must not exceed the available hours in the day.
● Each task must be completed by its deadline.
● Tasks cannot be interrupted once started.

1.3 Input
● An integer n representing the number of tasks.

● An integer Tmax representing the maximum available hours in the day.

● An integer Emax representing the maximum energy available for the day.

● A list of tasks, where each task t is represented by:

● 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

● Task 2: (1 hour,40 benefit,3 hours deadline) - Attend Lecture

● Task 3: (1 hour,30 benefit,6 hours deadline) - Exercise

● Task 4: (3 hours,60 benefit,8 hours deadline) - Work on Project

● Tmax =8 hours
● Emax =50 units
● Hourly energy consumption rate = 5 units/hour
2.2 Output

● Task 1 scheduled from hour 1 to 3


● Task 2 scheduled from hour 3 to 4
● Task 4 scheduled from hour 4 to 7
● Task 3 not scheduled (or another optimal arrangement)

2.3 Dynamic Programming Approach


To solve this problem using dynamic programming, we use a state representation
that includes:

● The subset of tasks considered.


● The time consumption state.
● The energy consumption state.

Define a DP table DP[i][t][e] where:

● i is the index of the current task.


● t is the remaining time.
● e is the remaining energy.

The state transition can be defined as:

DP[i][t][e]=max(DP[i−1][t][e],max(DP[i−1][t−di ][e−di ⋅
energy_rate]+bi))

where di is the duration of task i, and bi is the benefit of task i.


Steps

1. Initialize the DP table.


2. Iterate through each task and each possible state (time and energy).
3. For each task, decide whether to schedule it based on constraints.
4. Update the DP table accordingly.
5. The maximum value in the DP table at the end will give the maximum
benefit.

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.

You might also like