Operations research (OR) can be very useful for human resource planning as they can help organizations make more informed and effective decisions about how to allocate their human resources. Some advantages of using OR for human resource planning include:
Here is a small prototype model showing how OR can be used to model human resource planning. The idea is that you have a few employees with different availability and demand to be satisfied (the demand being the number of resources per time unit). The planner has to decide who works when to ensure the demand is satisfied, knowing the resource availability.
Loading the data:
employees = [1, 2, 3, 4, 5]
availability = {
1: [1, 1, 0, 1, 1],
2: [1, 1, 1, 1, 1],
3: [1, 1, 0, 0, 1],
4: [1, 1, 1, 0, 1],
5: [1, 0, 1, 1, 1]
}
demand = [3, 4, 2, 3, 4]
T = len(demand)
Loading the model:
from ortools.constraint_solver import pywrapcp
# Set up the solver
solver = pywrapcp.Solver('Human Resource Planning')
# Define the decision variables
assignment = {}
for e in employees:
for t in range(T):
assignment[e,t] = solver.IntVar(0, 1, 'assignment_%d_%d' % (e,t))
# Set up the constraints
for e in employees:
for t in range(T):
solver.Add(assignment[e,t] <= availability[e,t])
if t > 0:
solver.Add(assignment[e,t] <= 1 - assignment[e,t-1])
for t in range(T):
solver.Add(solver.Sum(assignment[e,t] for e in employees) == demand[t])
# Solve the model
status = solver.Solve()
# Print the solution
if status == pywrapcp.Solver.OPTIMAL:
for e in employees:
print(f'Employee {e} is assigned to the following periods:')
for t in range(T):
if assignment[e,t].solution_value() > 0:
print(t)
else:
print('The model could not be solved')