Leveraging Operations Research for Call Center Efficiency

Harnessing the power of efficient workforce optimization to drive organizational excellence

Saif Ali Kheraj
Towards Data Science

--

In today’s data-driven world, organizations can efficiently allocate resources, reduce costs, and provide exceptional customer experiences by leveraging the power of data and applying advanced optimization models.

When predictive analytics is combined with prescriptive analytics, it enables managers to make crucial decisions within the company. We will observe this by utilizing the output of predictive analytics — demand of call center service representatives at each hour — to efficiently allocate customer service representatives by performing optimization, which will ultimately result in increased customer satisfaction and reduced expenses for the business as a whole.

Figure 1: Analytics Pyramid and the importance of Prescriptive Analytics (Figure by Author)

General Overview

One of the key challenges faced by call center companies is low call answering rates, which can result in customer dissatisfaction and potentially lead to customer churn. For example, if a call center company has a call answering rate of only 70%, this means that 30% of customers are not able to get through to the company, which can lead to frustration and dissatisfaction.

In this post, we will solve an optimization problem for better call center scheduling using an example scenario with equations and problem solving in Pyomo. This will help you understand everything in great detail. We will apply some constraints while optimizing by minimizing the shortage of call center service representative on each day and hour. Then you can go deeper to come up with more interesting soft constraints related to increasing motivation among agents, such as possible vacations after some weeks, and so on.

Figure 2: Freepik

Example Scenario:

We have ten call center agents who must be assigned to a specific shift each day.

Shifts and Schedule Types

There could be several shifts in a day, with breaks in between. Let us see how the company’s management has designed the various possible shifts.

Figure 3 — Conceptual Model 1 : Shift Matrix Designed with pre-defined breaks and working hours (By Author)

So we have a total of 16 shifts made by the company’s management. For example, if a call center agent is assigned shift 5, the agent will work essentially from 4 to 12 with one defined break in between. So there are a total of 9 hours with one break in between for the agent to rest.

In this case, we define shift with variable K and hour with variable T.

Let A be shift matrix and Akt is 1 if shift k covers period t and 0 otherwise.

Equation 1: Shift Matrix Assignment (By Author)

We want to assign one customer service representative (CSR) to only one shift per day. These shifts will essentially tell when an employee should come, leave, and take a break after optimization. This is essentially the first component of our model.

Shift Assignment Matrix (Decision Variable)

Figure 4— Conceptual Model 2: Shift Assignment Matrix — whether CSR is assigned to particular shift (By Author)

Then there’s the Shift Assignment Matrix, where we can denote customer service representatives as I and J as days. K is already defined as shift, and we have a total of 16 shifts as defined in previous section.

This matrix simply indicates whether Customer Representative I is assigned to day J at a specific shift K. This is essentially our decision variable in which we are interested in assigning CSR to right shift in order to minimize shortage at each hour.

Decision variable (Math Notation)

Equation 2: Shift Matrix Assignment (By Author)

Shortage

Let us now work out on the conceptual notion of shortage.

Figure 5— Conceptual Model 3: Getting Total Assigned, Demand and Shortage (By Author)

Demand has already been provided to us through predictive model, and we can calculate Total assigned representatives once we have total assigned customer service representatives at each hour. Once we’ve defined the shift assignment matrix(Figure 4 — Conceptual Model 2 ) and shift schedule matrix(Figure 3— Conceptual Model 1), we can quickly construct this table. We can simply do dot product of 10 x 16(Conceptual Model 2) and 16 x 24(Conceptual Model 1) to get 10 x 24 where 10 is the total number of call center service representative and 24 is number of hours. Thus, with each CSR assignment to each hour, we can easily achieve what we have above(Figure 5 — Conceptual Model 3). This allows us to easily calculate the total assigned CSRs for each day and hour. For the sake of simplicity, we assume a constant demand of three, but in the real world, this would come from a predictive model based on historical data.

Predictive model would be based on different factors and variables like historical call volume, customer demographics, seasonality, product/service trends.

Once we have total assignment and demand, we can easily calculate shortage, which is what we need to minimize and will be the basis for our objective function. This concludes our third conceptual table.

Objective Function

Let us now define the notion of shortage, as we need to minimize it. Let y[j,t] represent the shortage of CSRs during day j’s time period t. The objective is to minimize the total shortage of CSRs across all time periods and days, as shown in the equation 3 below.

y[j,t] is a derived decision variable because it is calculated based on other decision variables and parameters in the shift scheduling optimization model.

You can simply think shortage as summing up red highlighted in conceptual model table 3 (above) for all the day.

Equation 3: Objective Function to minimize shortage (Figure by Author)

We will see in our constraints part the notion of shortage further.

Constraints

Hard Constraints:

  1. For each day and time, the shortage should be greater than or equal to zero. The shortage is calculated as the difference between the demand and the number of assigned CSRs(Supply). If the assigned CSRs exceed the demand, the shortage is considered as zero. We must be able to express demand and supply in order to define shortage. Djt (Demand of CSR required in day j’s period t). Let us define D[j,t] as the demand for CSR in the period t of day j.

We could simply use a shift schedule matrix(Figure 3 — Conceptual Model 1 figure) and a shift assignment matrix(Figure 4— Conceptual Model 2 figure) to calculate supply or total assigned CSRs at a specific hour on each day. Let me demonstrate by calculating the number of CSRs assigned at hour 0.

Let us choose the first column (hour 0) of our shift matrix(Figure 3 — Conceptual Model 1) and the first row (CSR 1) of the shift assignment matrix(Figure 4— Conceptual Model 2).

Figure 6— Dot Product Operation to calculate total assigned CSRs at hour 0 (By Author)

This is a straightforward dot product operation. We’ve chosen hour 0 on a specific day (Monday) as an example. We are taking the dot product of the shift matrix(Figure 3 at hour 0) and the shift assignment (Figure 4 of CSR 1). Because CSR 1 is assigned to shift # 5, which does not have hour 0 as a working hour, the result will be zero. We will calculate the product of the shift matrix at hour 0 with all of the CSR 1–16 and sum it to get the total assigned CSRs at hour 0. We can simply sum this across all shift K of each CSR(I), and we would do this for all I and J. This is the intuitive understanding, and the equation below corresponds to what I described.

Equation 4: Defining Shortage — Non Linear Function (Figure by Author)

To calculate shortage, simply take the difference between demand and supply (demand — supply), and if the value is negative, indicating oversupply, we would take that as 0. This would be accomplished by using the max function. However, this will no longer be a linear program. We want to be able to convert this equation to a linear form so that we can solve it with linear programming. Let us define linear equation now for this.

Equation 5: Defining Shortage — Linear Function (Figure by Author)

Thus, here we have managed to convert non linear equation into linear equation.

2. One Shift per Day Constraint: Each CSR can only be assigned to work in one shift per day to prevent excessive workload.

Equation 6: Person should take exactly one shift each day (Figure by Author)

For each CSR I in each day J, person should take exactly one shift so here we are just summing accross shift K for that CSR on day J. Intuitively, you can think this as summing for a particular CSR in shift assignment matrix and making sure it is less than equals to 1. In other words, particular row (CSR) for a particular day in shift assignment matrix must be less than equals to 1.

If the person is taking a day off, he should take shift 0 which you can define yourself.

Soft Constraints

  1. Maximum Extra CSR Constraint to control the number of extra on-duty CSRs by setting a maximum limit. This is to reduce burden and to ensure active backlogs. We won’t be implementing this part but let us discuss the equation.
Equation 7: Maximum number of extra CSRs on duty — Optional (Figure by Author)

The soft constraint relates to the maximum number of extra CSRs on duty, which means the additional CSRs beyond the minimum required to meet customer demand. We want to minimize the number of extra CSRs, but ensure that the objective function value, denoted as W1, is greater than or equal to the total number of extra CSRs for each time period of each day.

To achieve this, we introduce a soft constraint that imposes an upper limit on the extra CSRs. This constraint ensures that the number of extra CSRs, obtained by subtracting the demand for CSRs from the supply, does not exceed a specified maximum value.

To include this soft constraint, we would need to modify our objective function a bit by adding weighted component q.

Equation 8: Modified Objective Function — Optional (Figure by Author)

This is out of scope for now but this is just for the sake of understanding.

Final Equations before Implementation

Final Equations 9 (Figure by Author)

Implemention in Python (Pyomo Package)

Lets pick the same scenario that we discussed with 10 CSRs, 16 shifts in a day, 24 hours, 1 day.


shift_matrix_array = np.array(
# Shift 1
[[1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1],
])

num_csrs=10
num_days=1
num_shifts=16
num_times=24
shift_matrix_array.shape
shift_matrix_dict=dict()

for row in range(shift_matrix_array.shape[0]):
#print(row)
for column in range(shift_matrix_array.shape[1]):
shift_matrix_dict[row,column]=shift_matrix_array[row,column]

model = ConcreteModel()

# Define the sets
model.I = Set(initialize=range(num_csrs))
model.J = Set(initialize=range(num_days))
model.K = Set(initialize=range(num_shifts))
model.T = Set(initialize=range(num_times))

model.shift_matrix = Param(model.K, model.T, initialize=lambda model, k, t: shift_matrix_array[k][t])

demand = {(j, t): 3 for j in range(num_days) for t in range(num_times)}

model.shift_demand = Param(model.J, model.T, initialize=demand)

# decision variables
model.x = Var(model.I, model.J, model.K, domain=Binary)
model.y = Var(model.J, model.T, within=NonNegativeReals)


model.demand_constraint = ConstraintList()
for j in model.J:
for t in model.T:
model.demand_constraint.add(
model.y[j, t] >= model.shift_demand[j, t] - sum(model.x[i, j, k] * model.shift_matrix[k,t] for k in model.K for i in model.I)
)

model.one_shift_per_day = ConstraintList()
for i in model.I:
for j in model.J:
model.one_shift_per_day.add(sum(model.x[i,j,k] for k in model.K) <= 1)

model.obj = Objective(
expr=sum(model.y[j, t] for j in model.J for t in model.T) ,
sense=minimize
)

solver = SolverFactory('glpk')
solver.solve(model)

Output:

print("Day | Hour | Assigned CSRs")
for j in model.J:
for t in model.T:
assigned_csrs = []
for i in model.I:
for k in model.K:
if model.x[i, j, k].value == 1 and model.shift_matrix[k, t] == 1:
assigned_csrs.append(i)
print(f"{j} | {t:02} | {assigned_csrs}")
Figure 7— Assigned CSRs on a specific day at each hour (Output by Author)
print("CSR | Assigned Shift")
for i in model.I:
assigned_shift = []
for j in model.J:
for k in model.K:
if model.x[i, j, k].value == 1:
assigned_shift.append(k)
#break
if assigned_shift is not None:
break
print(f"{i} | {assigned_shift}")
Figure 9— Assigned shifts to each CSR (Output by Author)
total_shortage = sum(max(model.shift_demand[j, t] - sum(model.x[i, j, k].value * model.shift_matrix[k, t] for i in range(num_csrs) for k in range(num_shifts)), 0) for j in range(num_days) for t in range(num_times))

print("Total shortage:", total_shortage)
Figure 10— Total Shortage after optimizing (Output by Author)

As we can see that we still have a shortage of 4 but this is what is optimized and we may need to hire additional CSRs. Thus, this also guides on hiring decision processes and we may save up cost to hire extra csrs.

Conclusion:

In conclusion, while the code for call center scheduling may appear simple, it is crucial to have a solid conceptual model and thoughtful consideration of various factors before implementing an optimization model. By incorporating the soft constraints, such as considering the maximum number of extra on-duty CSRs and addressing the issue of shortage, we can effectively tackle the challenges associated with call center scheduling.

Whether it’s healthcare staffing, retail workforce management, or logistics planning, the application of data science and optimization can help address similar challenges of resource allocation and shortage. By leveraging these approaches, organizations can optimize their operations, improve efficiency, and enhance customer satisfaction. The COVID-19 pandemic has highlighted the criticality of efficient resource management across industries. The demand for services and the need for effective scheduling have become more prominent than ever.

References

[1] Market Research — https://www.reportlinker.com/p087286/World-Call-Centers-Markets.html

[2] A Hybrid Personnel Scheduling Model for Staff Rostering Problems — https://www.mdpi.com/2227-7390/8/10/1702

[3] Personnel Scheduling: https://www.coursera.org/learn/operations-research-modeling

--

--

Key interests in telecom, media, retail, finance, sustainable business, Climate Change