Contact Center

Consider a contact center that operates between 8:30 and 18:00, having four agents which can take calls in a variety of languages. There are three possible shifts in which agents could be assigned: 8:30-16:30, 9:00-17:00, and 10:00-18:00. From previous forecasts, it is known that the demand for each language varies by day of the week. On Mondays, calls are usually in English and Portuguese, so there needs to be at least one agent that knows these languages. On Tuesdays, calls are usually in Spanish and French, so there needs to be at least one agent proficient in each of these languages. Regardless of the language, there must be at least two agents available at all times.

Several shifts per day

In this contact center example, there are three shifts per day, and the planning horizon spans two days. For example, the 8:30-16:30 shift on a specific Monday is represented as:

  {
    "shifts": [
      {
        "id": "Monday-2024-7-1 8:30-16:30",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 8,
          "minutes": 30
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 16,
          "minutes": 30
        }
      }
    ]
  }

Example with six shifts


    {
      "shifts": [
      {
        "id": "Monday-2024-7-1 8:30-16:30",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 8,
          "minutes": 30
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 16,
          "minutes": 30
        }
      },
      {
        "id": "Monday-2024-7-1 9:00-17:00",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 9
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 17
        }
      },
      {
        "id": "Monday-2024-7-1 10:00-18:00",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 10
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 18
        }
      },
      {
        "id": "Tuesday-2024-7-2 8:30-16:30",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 8,
          "minutes": 30
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 16,
          "minutes": 30
        }
      },
      {
        "id": "Tuesday-2024-7-2 9:00-17:00",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 9
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 17
        }
      },
      {
        "id": "Tuesday-2024-7-2 10:00-18:00",
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 10
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 18
        }
      }
    ]
  }
  

Languages as employee skills

The languages that an agent knows are represented as a skill. The first agent, Lauren, knows Spanish and Portuguese, and is represented as:

  {
    "employees": [
      {
        "id": "Lauren",
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "ES",
          "PR"
        ]
      }
    ]
  }

It is also possible to add other type of scheduling constraints, shift request, and employee preferences as described in other examples.

Example with all four employees


  {
    "employees": [
      {
        "id": "Lauren",
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "ES",
          "PR"
        ]
      },
      {
        "id": "Markus",
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "EN",
          "PR"
        ]
      },
      {
        "id": "Hans",
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "EN",
          "ES"
        ],
        "shiftRequests": [
          {
            "shiftIds": [
              "Monday-2024-7-1 10:00-18:00"
            ],
            "type": "STATUS_NOT_WORK"
          }
        ]
      },
      {
        "id": "Peter",
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "EN",
          "FR"
        ],
        "shiftPreferences": [
          {
            "shiftId": "Monday-2024-7-1 10:00-18:00",
            "preference": 1
          }
        ]
      }
    ]
  }
  

Demand coverage for agents and languages

Demand for agents or specific languages is represented with coverage requirements. The need for two agents is specified in roleRequirements, while the requirement for languages is specified in skillRequirements. The coverage requirements for Monday and Tuesday are represented as:

  {
    "coverageRequirements": [
      {
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 8,
          "minutes": 30
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 1,
          "hours": 18
        },
        "roleRequirements": [
          {
            "role_id": "Agent",
            "target_employee_count": 1,
            "priority": "PRIORITY_HIGH"
          }
        ],
        "skillRequirements": [
          {
            "skill_id": "EN",
            "target_employee_count": 1
          },
          {
            "skill_id": "PR",
            "target_employee_count": 1
          }
        ]
      },
      {
        "startDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 8,
          "minutes": 30
        },
        "endDateTime": {
          "year": 2024,
          "month": 7,
          "day": 2,
          "hours": 18,
          "minutes": 0
        },
        "roleRequirements": [
          {
            "role_id": "Agent",
            "target_employee_count": 1,
            "priority": "PRIORITY_HIGH"
          }
        ],
        "skillRequirements": [
          {
            "skill_id": "ES",
            "target_employee_count": 1
          },
          {
            "skill_id": "FR",
            "target_employee_count": 1
          }
        ]
      }
    ],
    "role_ids": [
    "Agent"
    ],
    "skill_ids": [
      "EN",
      "ES",
      "FR",
      "PR"
    ]
  }

Note that all role and skill IDs must be defined in the request. They must match the IDs used to define the employees.

Example of a complete request


    {
      {
        "requestId": "contact_center_examples",
        "solve_parameters": {
          "time_limit": {
            "seconds": 60
          }
        },
        "employees": [
          {
            "id": "Lauren",
            "role_ids": [
              "Agent"
            ],
            "skill_ids": [
              "ES",
              "PR"
            ]
          },
          {
            "id": "Markus",
            "role_ids": [
              "Agent"
            ],
            "skill_ids": [
              "EN",
              "PR"
            ]
          },
          {
            "id": "Hans",
            "role_ids": [
              "Agent"
            ],
            "skill_ids": [
              "EN",
              "ES"
            ],
            "shiftRequests": [
              {
                "shiftIds": [
                  "Monday-2024-7-1 10:00-18:00"
                ],
                "type": "STATUS_NOT_WORK"
              }
            ]
          },
          {
            "id": "Peter",
            "role_ids": [
              "Agent"
            ],
            "skill_ids": [
              "EN",
              "FR"
            ],
            "shiftPreferences": [
              {
                "shiftId": "Monday-2024-7-1 10:00-18:00",
                "preference": 1
              }
            ]
          }
        ],
        "shifts": [
          {
            "id": "Monday-2024-7-1 8:30-16:30",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 8,
              "minutes": 30
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 16,
              "minutes": 30
            }
          },
          {
            "id": "Monday-2024-7-1 9:00-17:00",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 9
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 17
            }
          },
          {
            "id": "Monday-2024-7-1 10:00-18:00",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 10
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 18
            }
          },
          {
            "id": "Tuesday-2024-7-2 8:30-16:30",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 8,
              "minutes": 30
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 16,
              "minutes": 30
            }
          },
          {
            "id": "Tuesday-2024-7-2 9:00-17:00",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 9
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 17
            }
          },
          {
            "id": "Tuesday-2024-7-2 10:00-18:00",
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 10
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 18
            }
          }
        ],
        "coverageRequirements": [
          {
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 8,
              "minutes": 30
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 1,
              "hours": 18
            },
            "roleRequirements": [
              {
                "role_id": "Agent",
                "target_employee_count": 1,
                "priority": "PRIORITY_HIGH"
              }
            ],
            "skillRequirements": [
              {
                "skill_id": "EN",
                "target_employee_count": 1
              },
              {
                "skill_id": "PR",
                "target_employee_count": 1
              }
            ]
          },
          {
            "startDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 8,
              "minutes": 30
            },
            "endDateTime": {
              "year": 2024,
              "month": 7,
              "day": 2,
              "hours": 18,
              "minutes": 0
            },
            "roleRequirements": [
              {
                "role_id": "Agent",
                "target_employee_count": 1,
                "priority": "PRIORITY_HIGH"
              }
            ],
            "skillRequirements": [
              {
                "skill_id": "ES",
                "target_employee_count": 1
              },
              {
                "skill_id": "FR",
                "target_employee_count": 1
              }
            ]
          }
        ],
        "role_ids": [
          "Agent"
        ],
        "skill_ids": [
          "EN",
          "ES",
          "FR",
          "PR"
        ]
      }
    }
    

Response example

The response of the solver contains the assignment of agents to shifts and the status of the optimization procedure.

The following example shows the assigned shifts:

  {
    "solutionStatus": "OPTIMAL",
    "shiftAssignments": [
      {
        "employeeId": "Lauren",
        "shiftId": "Tuesday-2024-7-2 10:00-18:00",
        "roleId": "Agent"
      },
      {
        "employeeId": "Markus",
        "shiftId": "Monday-2024-7-1 8:30-16:30",
        "roleId": "Agent"
      },
      {
        "employeeId": "Peter",
        "shiftId": "Monday-2024-7-1 10:00-18:00",
        "roleId": "Agent"
      },
      {
        "employeeId": "Peter",
        "shiftId": "Tuesday-2024-7-2 8:30-16:30",
        "roleId": "Agent"
      }
    ],
    "requestId": "contact_center_examples"
  }