Presentation 2
Presentation 2
TASK SCHEDULING
7 employees
25 tasks
Question 1
• Task Scheduling
• A manager of a company is aiming to scheduling a set of tasks over
his employees. Each task is characterized by a duration (in minutes) and
can be handled by any of the employees (skills independent). Any
task should be allocated to only one employee, it cannot be divided
among many employees.
Decision Variables:
• X ij : is a binary decision variable indicating whether task I is assigned to employee j.
• d1j : is a decision variable representing the overhead deviation for employee j.
• d2j : is a decision variable representing the under-head deviation for employee j.
Objective Function:
• Minimize the sum of overhead and under-head deviation in assigned tasks for each employee
from the goal.
Minimize
Our Approach and Solution
Constraints:
• Each task must be assigned to exactly one employee no task to be split among
employees.
• Each employee can handle a minimum of one task to avoids scenarios where some
employees might be left without any tasks, contributing to work distribution fairness.
//Parameters
int m 25 // Number of tasks
int n 7 // Number of employees
range M 1 m
range N 1 n
float goal 3.57 //Average number of Tasks (Number of Tasks/Number of Employees)
//Decision Variables
dvar boolean x // X=1 if task M has been assigned to employee N, otherwise X=0
dvar float d N // overhead Deviation variable (Upper side deviation in assigned tasks from the
goal)
dvar float S N //underhead Deviation variables (Lower side deviation in assigned tasks from the
goal)
OPL Code
//Objective Function
//Minimize the sum of Upper side and Lower side deviation in assigned tasks for each employee from the goal
sum(j in N) x[j][i] == 1;
// Constraint that each employee will handle a minimum of one task (No one with zero task assignment)
C2 : forall (j in N)
C3 : forall (j in N)
sum(i in M) x[j][i]-d[j]+S[j]==goal;
C5 : forall (j in N)
S[j] >= 0;
}
OPL Results
Graphical Illustration
• - Given that there are 25 tasks and 7 employees, the linear programming solution
optimizes task allocation.
• - The solution assigns 4 tasks to 4 employees and 3 tasks to the remaining 3
employees, ensuring a fair distribution.
• -The result of this allocation sums up to the total of 25 tasks, maintaining task
completeness and fairness.
Total minimized deviation= 3.5
Employees with 3 tasks : D+=[0.5,0.5,0.5,0,0,0,0]
Employees with 4 tasks : D-=[0,0,0,0.5,0.5,0.5,0.5]
GRAPH ILLUSTRATION
0.5 0.5 0.5 0.5
goal=3.5
Question
A manager of a company is aiming to scheduling a set
of tasks over his employees. Each task is characterized by
a duration (in minutes) and can be handled by any of the
2
employees (skills independent). Any task should be
allocated to only one employee, it cannot be divided
among many employees.
Minimize
Our Approach and Solution
Constraints:
• Each task must be assigned to exactly one employee:
• - Each task has a specific duration, and the durations for the 25 tasks are as follows:
• duration[25] = [17,62,91,21,31,97,57,55,40,52,60,52,73,46,63,46,28,72,10,36,28,74,100,65,11]
dvar boolean x[N][M]; // X=1 if task M has been assigned to emloyee N, otherwise X=0
dvar float d1[N]; // overhead Deviation variable (Upper side deviation in assigned tasks from the goal)
dvar float d2[N]; //underhead Deviation variables (Lower side deviation in assigned tasks from the goal)
float goal=184; //Average Duration of Tasks assigned to each employee (Total duration of all Tasks/Number of Employees)
OPL Code
//Objective Function
//Minimize the sum of Upper side and Lower side deviation in assigned tasks for each employee from the goal
minimize sum(j in N) (d1[j]+d2[j]);
//Constraints
subject to {
// Constraint that each task must be assigned to exactly one employee (cannot split among employees)
C1 : forall (i in M)
sum(j in N) x[j][i] == 1;
// Constraint that each employee will handle a minimum of one task (No one with zero task assignment)
C2 : forall (j in N)
C3 : forall (j in N)
sum(i in M) (dr[i] * x[j][i])- d1[j]+d2[j]==goal;
// Constraint on Non-negative overhead deviation variable
C4 : forall (j in N)
d1[j] >= 0;
C5 : forall (j in N)
d2[j] >= 0;
}
Duration based Fair Scheduling of Employees
Employees Tasks assigned Duration assigned Deviation