1 Introduction

Organisations constantly face new realities of goods markets, technology markets and labour markets. Globalisation, increased competition by the liberalisation of markets, the fall of trade barriers, the speed of deploying technological improvements, the constant search for improved productivity and quality as a pillar of competitiveness are all factors that influence organisations’ management (Formichella and London 2013). These factors lead to continuous changes in, or adjustments to, internal structures and human resources management (HRM) policies. The recent COVID-19 pandemic has also placed pressure on, and increased difficulties in, management policies.

Staff planning has been extensively studied in recent decades and is a significant business challenge. Proper HRM provides many organisations with distinctive capacity (Romero and Santana 2001). For many years, the main HRM challenge has been to make permanent progress in the organisation of which human resources form part by making their internal and external activities more effective and efficient. These two factors lead to improved manufactured product quality and higher productivity levels (Camejo and Cejas 2009).

In most of the literature, the objectives of HRM problems consist of minimising the total costs of deployed policies by providing the system with flexibility and ensuring an expected service level (Rocha et al. 2013). This aim to minimise costs is generally consistent because labour costs form a significant part of direct costs. Therefore, finding a better staffing programme that reduces costs, even by only a low percentage, could prove very beneficial (Van Den Bergh et al. 2013).

However, a purely economic approach cannot be dominant for organisations that manage mainly people with functional diversity. For example, the mission of organisations, such as the Espurna Foundation (Espurna), is to promote the inclusion of people with intellectual disabilities in ordinary life. Its main objective is to create employment for people with these disabilities. Workers with specific needs must be integrated into a stable work environment to improve their skills and to enhance their relationship skills in a professional context (Segarra et al. 2019).

Although not-for-profit organisations like Espurna are subject to budgetary constraints and are obliged to not incur in losses, HRM should not take a purely economic focus. In most cases however, activities are of the manual manufacturing type and are performed for private organisations in labour enclaves. Such activities can be service activities; e.g., cleaning, entertainment or the food service industry. Moreover, the diversity of special needs of people with functional disabilities implies not only a change in the planning purpose, but also specific requirements in terms of constraints and the objective function, which are not found in the literature.

Staff planning particularities and specificities in this situation depend on not only workers and the kind of activity to be delivered, but also on the historic evolution and background of workers’ activities. People with intellectual disabilities need constant training to increase their skills and to mitigate their capacity to lose skills, which they do more quickly than other workers if they do not perform an activity during a specific time period. Staff planning for workers with intellectual disabilities should also consider rotation as a requirement to ensure high attention levels. Finally, they must be accompanied by coaches who support and supervise them, and by other workers to provide them with a high socialisation level.

This paper presents a novel mixed-integer linear model (MILP) designed for the case study carried out at Espurna (Garcia-Sabater and Garcia-Sabater 2017), more precisely in its Sheltered Employment Centre (SEC). In this staff planning model, workers (people with intellectual disabilities and coaches) are assigned on a fortnight horizon to work shifts in several labour enclaves to cover customers’ production/service requirements. Recruitments, holidays (weekly breaks, holidays, days off) and training are decisions that ensure that customer activity levels and legal issues are fulfilled. Teams should be created by considering the affinities between workers, and also the affinities between a worker and his/her destination (labour enclave and activity type). Consistency with both previous plans and the upper plan within the planning framework is also ensured.

The rest of the paper is as follows: firstly, a literature review on staff planning and scheduling is proposed and then a description of the case study is provided. Next the mathematical model is described and then the model is validated with a numerical example. Discussion about managerial implications and the difficulty in their implementation are introduced. Finally, some conclusions are drawn and future lines are presented.

2 Literature review

Planning a company's workforce is one of the most challenging activities that managers face. This problem becomes more complex as company size increases (Özder et al. 2020). Workforce planning defines when and how many workers should be hired or fired, and when these employees should work. To do so, some features should be considered, such as workers’ available days to work, planned and pending holidays, how many workers are currently on a rest period. Therefore during each time period, decisions must simultaneously evaluate the total capacity of human resources to be maintained and its distribution in different company areas (Garcia-Sabater et al. 2020).

Personnel planning problems entail some special features that do not appear in other types of resource allocation problems, such as materials or machines. These problems tend to be dynamic and complex because of staff’s nature (heterogeneity, fluctuating needs, etc.). In addition, good HRM must take into account different employee preferences, trade union limitations, the flexibility required to face demand uncertainty, as well as workers’ different skills (Özder et al. 2019).

At the operational level, the process of scheduling and assigning staff tasks is defined as the process of creating work schedules (Ernst et al. 2004a; b). The problem of assigning workers to calendars takes different names, such as staff rostering, staff planning, staff scheduling, among others, and is a combinatorial optimisation problem. The literature has extensively dealt with this problem by proposing very specific problems and a large set of resolution techniques (Brucker et al. 2011).

Calendars consist of not only assigning a worker to a working day, but also assigning him/her to a work shift, a specific team and/or a given activity after taking into account his/her adequate qualification to meet demand and by attempting to meet employee preferences (Bard and Purnomo 2005a, b).

Due to the variety and specificity of each problem, the literature presents very diverse models and resolution approaches; e.g., metaheuristics (Smet et al. 2016), exact methods (Beliën and Demeulemeester 2008) and mathematical programming models (Castillo-Salazar et al. 2016). In some cases, the solution that needs to be found must be an optimum one, while acceptable solutions (good and realistic) work for other cases (Ernst et al. 2004b).

For the areas of application, most of these works are related to hospitals (Ernst et al. 2004b; Bard and Purnomo 2005a; Brucker et al. 2011). The literature also presents works linked with other areas of application, such as call centres (Xia and Dube 2007), airports (Maenhout and Vanhoucke 2010; Stolletz 2010), the energy sector (Helber and Henken 2010; Özder et al. 2019) and services (Li et al. 2007).

The usual resolution problems include time horizons, which normally vary between longer term ones. One such case is the annual working calendar (Corominas et al. 2002, 2007), which is used to schedule work shifts or daily working hours. Cases in which a weekly programme of resources is set up after taking into account weekly breaks are especially relevant (Alfares 1998).

Workforce or staff scheduling is a complex problem that can be solved in any organisation. Determining which worker performs a task and when must meet several constraints regarding demand requirements, specifications of contractual obligations, employee preferences, among others. Here the objective to be fulfilled is to generally minimise the total HRM costs (Rocha et al. 2013).

However, SECs are characterised by having people with different cognitive abilities who work in unstable and changing environments. This leads to longer learning times and much shorter forgetful times. In addition, the casuistry in relationships must be taken into account by distinguishing several affinities. Finally, the specificities of the environment are relevant, such as tasks to be performed, the place where different labour enclaves are located, the context in which work takes place and the people with whom they work. In such areas in Espurna’s SEC, the objective and constraints differ from “traditional” problems.

Several scenarios appear depending on a worker’s ability to perform certain tasks well (Escobar 2005). In certain problems, some tasks can be performed only by those who possess a specific skill or a certain training level (Santos and Costa 2016), which implies constraints in the resolution process. In other situations, people who work differently implies distinct skills, which can maximise the results of the company for which they work. At other times, people with different qualifications entail distinct costs, and the company opts to minimise the total labour costs. In all these cases, a worker's skills not only influences the quality of the assignment, but can also be considered a hard constraint for the problem to be solved. However, this type of hard constraint in operational terms can become soft in tactical terms. These skills are traditionally acquired through training, practice and supervision. Some examples can be found in the literature (Knust and Schumacher 2011; Castillo-Salazar et al. 2016; Çakırgil et al. 2020).

The problem is quite different in the specific case of SECs where a large part of human resources may involve intellectual disabilities. First of all, it is necessary to consider that skills are not only acquired but can be reduced or considered lost due to lower practice rates. Secondly, emotional factors are important and condition the worker’s performance and personal development. For example, a worker’s affinity to the job, the labour enclave and the affinity between workers (both team colleagues and the assigned team coach) are key factors that need to be taken into account (Jarhag et al. 2009).

To the best of our knowledge, a specific mathematical model that addresses this specific staffing and scheduling problem and includes skills and affinities between workers and their labour enclave, is a novelty.

3 Problem description

The inclusion of people with special needs and different abilities in the labour market is only one step towards their insertion into “normal” life (Jarhag et al. 2009; García Sabater 2018). The “Espurna Foundation” is a not-for-profit organisation with more than 350 employees.

Espurna has its own SEC and several labour enclaves. Labour enclaves are the workplaces in which workers perform work activities in customer facilities, which leads them to interact with the customer's employees and to create a true sense of belonging (Nishi et al. 2014).

Most of Espurna’s customers are for-profit manufacturing companies that outsource part of their production activities through labour enclaves in its facilities.

In Espurna’s case, staff consists of people with intellectual disabilities (some may also have associated physical disabilities) and coaches. All these workers have different skills. Some are the result of apprenticeship (depending on training, practice or repetition), others cannot be acquired because of their disability and other skills may have been forgotten from not being trained for a time period. The role of coaches is to support, train and accompany workers in their work. Both coaches and workers with special needs have working days, personal calendars and distinct work constraints (holidays, hours worked, mandatory minimum weekly rest, etc.) because they have different kinds of employment contracts and personal situations (sick leave, days off, etc.).

Espurna’s CEO assigns groups of workers to the different labour enclaves to perform specific activities (or jobs) on a given work shift, and in such a way that it covers customers’ demand.

From this point onwards, all the groups that are formed between workers and coaches are called a labour enclave; that is, the coach assigns a set of workers to a certain activity on a given work shift. To do so, the CEO knows the specificity of each labour enclave activity, customers’ constraints and some aspects, which all facilitate the work that needs to be reviewed.

As the human aspect is the most important one for creating work teams, it is necessary to take into account each worker’s particularities. Some workers do not get on well with others and some cannot be assigned to specific labour enclaves. To manage this information, three different matrices were defined:

  • Worker-to-coach affinity matrix: the worker-coach relationship is crucial for ensuring an adequate working environment in the team group. Coaches can supervise most workers, but not others. As some coaches are used to working with some workers, it is advisable to put them together

  • Worker-to-worker affinity matrix: some pairs of workers are beneficial, and some pairs are indifferent about being assigned to the same labour enclave. In certain cases, some pairs must be avoided because workers’ work performance would lower if they worked together

  • The Worker-to-customer affinity matrix: it is the classic polyvalence matrix that depicts how a worker is trained on the job. It focuses on a worker adapting to the labour enclave activity, and vice versa. Theoretically, the actual existing affinity is that of the "Worker-to-labour enclave affinity matrix". However, two labour enclaves can consist of the same activity, in the same location, for the same customer, but on different work shifts (morning shift, afternoon shift or night shift, as in the automobile sector). In other cases, for the same customer there may be two work enclaves in the same location, but activities are of a very different nature. In the latter case, affinities generally tend to be similar because the prohibitions placed by customer companies that condition certain workers' assignments have more frequently appeared. For this reason, a decision was made to consider worker-to-customer affinity due to its simplicity

Preference of staff assignments to labour enclaves to form teams (including people with disabilities and their respective coaches) is expressed with these affinity/versatility matrices. Hence the considered affinities depend on their skills, their personal desire and/or their suitability to work (or not) in a specific labour enclave. Each person’s considered personal conditions and availability are expressed with availability tables and work information tables.

The activities to be performed by workers are also conditioning factors because they are of very different in nature. Although it is not an obligation, occasionally some customers request specific workers for one of their labour enclaves for their individual training and practice. Espurna’s norm is to respect this assignment. In addition, labour enclaves are very spread out geographically. This is an important condition because not all workers can go to all the active labour enclaves. Moreover, each worker’s days off should be respected.

Naturally, the objective of the problem is a multicriteria problem. Although it is true that there are decisions that can have an economic impact on the organisation, not all decision variables can be measured with costs and the objective function cannot be exclusively cost minimisation or customer service level maximisation. Some decision variables do not have measurable economic default values. For this reason, a single-objective function that expresses how far the found solution is from the ideal solution was considered. An objective function was, therefore, designed, where 0 is the desirable value of an ideal plan and any positive value of the objective function measures an undesired deviation independently of the optimal mathematical solution. The components of the considered objective function are explained below:

  • Decisions of the workers’ shift assignments problem must be aligned with annual planning. More specifically, the number of days on holiday assigned during the planning horizon must be aligned with the annual planning and be, therefore, the maximum possible. In addition, there are days when it is more desirable to take holidays to obtain longer weekends than other days when workers do not wish to rest (e.g., Wednesday). So this component should be maximised by assuming that not only the total days holidays can be weighted, but by also not penalising the days when it is not interesting to assign vacations. To simplify the model, the target value to be achieved is not considered a parameter.

  • As each worker/labour enclave is geographically spread out in the Valencia Region (Spain), the total travelled distance should be minimised for transportation cost reasons, but also to avoid employees’ long travel times. This factor was considered with the worker-to-customer affinity matrix in the objective function. In addition, Espurna prefers to value affinities or lack of affinity with letters. For this reason, a decision was made to transform the value of these affinities with 0 being the highest value and to use negative values if it was not an ideal assignment of pairs. An optimal affinity or an ideal assignment would, therefore, imply affinity with a value 0, while less affinity would take a negative value (similarly to disaffinity). This component should, therefore, be maximised.

  • To ensure the desired customer service levels, it is necessary to provide enough personnel, excess personnel allocation to an enclave can lead to idle times and, therefore, an extra cost. Hence this component should be minimised.

  • To simplify communication and to avoid unnecessary personnel movements between labour enclaves, a dimension of stability of assignment was incorporated. Frequently changing the assigned personnel in an enclave damages the image for customers. Therefore, the number of different labour enclaves to be assigned to each worker should be minimised. Thus the component of the objective function will measure the number of assignment changes and will be ideal if there are no assignment changes for any worker throughout the planning horizon.

Affinity is calculated as a weighted linear combination of a worker's affinity to the workplace, and his/her affinity to the quarterly plan and the established training plan.

It should also be noted that some labour enclaves belong to restaurants, headquarters or cleaning services. In this particular case, specific workers are involved because they have been hired specifically for the job as waiters, kitchen assistants, clerks or room managers.

Determining how many workers are required in labour enclaves depends on contracts with customers. In some cases, a quantity of accumulated production level is expected per time period. In other cases, a quantity of workers to remain in the labour enclave is established. Generally, in the latter case, a minimum workers-to-coach ratio is considered. Some works are carried out at Espurna’s sites and not at customer sites when orders are specific, volumes are flexible and time deliveries are long.

In the specific case of cleaners, specific training has been provided and workers can go to their workplace (flats, hotels, etc.) without a coach accompanying them. Similarly, swimming pool cleaning is a job that a few workers can perform and need no coach accompaniment because only minimal supervision is required.

At the upper planning and mid-term levels, decisions about hiring levels and training courses meeting service demand levels and the associated uncertainty are made. Fortnightly, requirements are known and relatively certain when some staff adjustments are required and excess capacity is assigned.

As established within the framework for operations and training planning set out in (Garcia-Sabater et al. 2020) personnel scheduling is a very difficult problem to solve. A good solution should contemplate different considerations: stability for workers’ assignments between plans is desirable because each worker’s capacity is different, and each assignment may need specific skills and training requirements. Two training types are differentiated: recommended training to gain productivity by mostly providing workers with the resources they need to perform their daily work well; specific training required to work, such as occupational hazards, food handling, etc. The training of coaches must also be contemplated, who must also be provided with all the knowledge they need to correctly perform their work.

According to this framework, the personnel scheduling problem in Espurna’s SEC aims to schedule staff to be assigned on a fortnightly basis (people with specific needs and coaches) to customers' labour enclaves (a customer indicates a specific shift, a certain place, but also a specific activity), and it must also define workers’ days off. This activity takes place on Thursdays and consists of scheduling the next 2 weeks. For calculations, allocations for the next 3 days (frozen horizon) are not modified (except in force majeure cases). Solving many of these assignment problems is complex, and this difficulty implies resolution times that exponentially grow with the number of considered variables.

The decision model contains many input parameters. All customers must report their daily needs per labour enclave or, if it applies, the accumulated needs per labour enclave, the worker-coach ratio desired per labour enclave (Espurna sets this ratio from the data provided by the customer company), and the hours of work or daily people required in each labour enclave. Customer requirements are expressed with versatility tables based on certain training requirements. The SEC must not only respect sick leave and other workers' rights, but keep workers' affinities and versatility matrices up to date. In the allocation problem, they must consider other mandatory aspects, such as legislation, by taking into account regulations about days off, weekly working days, plus desirable aspects like the distance between workers' homes and their work enclave (because the SEC manages workers’ transport) and hierarchical consistency with the upper horizon plan (holidays, training plans and weekly assignments). In addition, the results of implementing the previous plans should be considered to ensure these plans’ stability and coherence.

The criteria with which one solution is selected over another are fundamentally workers’ affinity to jobs (work enclaves), the number of different places to which workers are assigned, the total distance travelled by them and the achieved customer service level. The developed tool is able to improve both the way to operate and the quality of the result of programming the activities of a diverse human team with hundreds of workers and dozens of different jobs.

Solving this problem impacts service organisations with similar characteristics because it allows both the quality of the obtained solutions and the time spent on generating them to improve. Likewise, the time left over from manual activities can be used for analysis activities to improve the quality of the managed data and, therefore, the quality of the obtained results.

4 Mathematical model proposal

To mathematically formulate the problem, it is necessary to define the used nomenclature. Table 1 shows the sets and indices, and Table 2 includes the parameters notation. Table 3 defines the variables notation.

Table 1 Sets and indices.
Table 2 Parameters notation.
Table 3 Variable notation.

The objective function should maximise the total affinities while ensuring an efficient use of human labour force and the plan’s stability. Different components of the objective function (OFC) are considered to draw up a fair and adequate assignment plan (Table 4).

Table 4 Objective function components

Therefore, objective function Z should be maximised as:

$$Z = \pi_{{{\upvarphi }}} \cdot P_{{{\upvarphi }}} + \pi_{{\Phi }} \cdot P_{{\Phi }} + \pi_{{{\rm X}}} \cdot P_{{{\rm X}}} + \pi_{{\Psi }} \cdot P_{{\Psi }} - \pi_{{\text{D}}} \cdot P_{{\text{D}}} - \pi_{\omega } \cdot P_{\omega }$$

In the objective function of the model that is presented, a single weight was considered for each component of the objective function to validate the mathematical model. However, as described in the problem description section, this is an approximation of the implemented model, where there are no uniform weights, but specific weights can be considered for each subscript of the variables to more precisely discriminate.

The constraints to consider are as follows:

\(\sum_{j \epsilon J}{\delta }_{e,j,t}\le 1\)

\(\forall e\in\Theta\), \(t=0\dots T-1\)

(R00)

\({\psi }_{e,0}+{\chi }_{e,0}+\sum_{j \epsilon J}{\delta }_{e,j,0}=1\)

\(\forall e\in\Theta\)

(R01)

\({\psi }_{e,t}+{\psi }_{e,t-1}+{\chi }_{e,t}+\sum_{j \epsilon J}{\delta }_{e,j,t}=1\)

\(\forall e\in\Theta\), \(t=1\dots T-1\)

(R02)

\(\sum_{\tau =0}^{\tau =8}{\psi }_{e,t+\tau }\ge 1\)

\(\forall e\in\Theta , t=1\dots T-9\)

(R03)

\(\sum_{\tau =t}^{\tau =t+6}\sum_{j \epsilon J}{\delta }_{e,j,\tau }\le 5\)

\(\forall e\in\Theta , t=0\dots T-7\)

(R04)

\(\sum_{\forall e\in\Theta }{\delta }_{e,j,t}\ge {\mathrm{D}}_{j,t}\)

\(\forall\; j \,\epsilon\, J\), \(t=1\dots T\)

(R05a)

\(\sum_{\tau =1}^{\tau =t}\sum_{\forall e\in\Theta }{\delta }_{e,j,\tau }\ge \sum_{\tau =1}^{\tau =t}{\mathrm{AD}}_{j,\tau }\)

\(\forall\; j \,\epsilon\, J\), \(t=1\dots T\)

(R05b)

\(\sum_{w \epsilon {\Theta }_{w}}{\delta }_{w,j,t}-\overline{{\Gamma }_{j}}\bullet \sum_{c \epsilon {\Theta }_{c}}{\delta }_{c,j,t}\le 0\)

\(\forall\; j\in \mathrm{J if }\overline{{\Gamma }_{j}}>0, t=1\dots T\)

(R06)

\({\delta }_{e1,j,t}+{\delta }_{e2,j,t}-1-{\varepsilon }_{{e}_{1},{e}_{2},j,t}\le 0\)

\(\forall\; {e}_{1},{e}_{2} \,\epsilon\, {\Theta }_{w}/{e}_{1}\ne {e}_{2}\)

\(\forall\; j \,\epsilon\, J\), \(t=1\dots T\)

(R07)

\({\delta }_{e1,j,t}+{\delta }_{e2,j,t}\le 2\bullet {I}_{e1, e2}\)

\(\forall\; {e}_{1},{e}_{2} \,\epsilon\, {\Theta }_{w}/{e}_{1}\ne {e}_{2}\)

\(\forall\; j \,\epsilon\, J\), \(t=1\dots T\)

(R08)

\({\delta }_{w,j,t}={\Delta }_{w,j,t}\)

\(\forall\; w \,\epsilon\, {\Theta }_{w}\), \(\forall\; j \,\epsilon\, J\), \(t=0\dots {\mathrm{T}}^{F}-1\)

(R09)

\(\left(\sum_{\tau =t}^{t+6}\sum_{j \epsilon J}{\delta }_{e,j,\tau }\bullet \overline{{H }_{j}}\right)\le \overline{{H }_{e}}\)

\(\forall\; e \,\epsilon\,\Theta\), \(\forall\; j \,\epsilon\, J\), \(t=0\dots \mathrm{T}-7\)

(R10)

\({\delta }_{e,j,t}\le {A}_{e, j,t}\bullet {B}_{e, j}\)

\(\forall\; e \,\epsilon\,\Theta\), \(\forall\; j \,\epsilon\, J\), \(t=0\dots \mathrm{T}-1\)

(R11)

\({\delta }_{e,j1,t}+{\delta }_{e,j2,t+1}-1-{\omega }_{e,t}\le 0\)

\(\forall\; e \,\epsilon\,\Theta\), \(\forall\; {j}_{1},{j}_{2} \,\epsilon\, J/{j}_{1}\ne {j}_{2}\), \(t=0\dots \mathrm{T}-2\)

(R12)

Any employee is assigned, as a maximum, to a single labour enclave on any day of the planning horizon (R00). Any employee is assigned to a unique labour enclave, has a day off or it is a weekend day on the first day of the planning horizon (R01). Any employee is assigned, as a maximum, to a single labour enclave, has a day off or it is a weekend day during each time period t (R02). Each employee should have at least one weekend every 9 consecutive days (R03). Each employee should not work more than 5 days on a 7-day rolling horizon (R04). The quantity of labour force assigned to labour enclave j reaches the required level every day at least (R05a), as well as the accumulated quantity for some specific labour enclave (R05b). Every day in each labour enclave, the number of assigned workers should be accompanied by a minimum number of coaches if necessary (R06). The pairs of employees assigned to a labour enclave on a given day are limited (R07). Incompatible pairs of employees are forbidden (R08). Assigning workers to labour enclaves on the frozen horizon should be maintained (R09). Weekly working hours per employee are limited (R10). Workers’ availability is limited in certain cases (R11). The assignment change for workers is determined (R12).

5 Experimental design: application to the Espurna Foundation

5.1 The case study company

To describe the implementation of the proposed MILP model, data from Espurna, a Spanish SEC founded in 1996, were used. Espurna is a not-for-profit organisation which, thanks to its progressive growth, currently has 90 employees (January 2022). Of them, 68 are people with cognitive impairment (60% with medium-severe cognitive impairment), and about 13 coaches who work daily in 15 labour enclaves distributed in the Valencia Region. The other employees are clerks, cooks, managers or therapists.

5.2 Input data overview

The model proposed in this article includes the following data:

The assignment schedule is established on a rolling fortnight time horizon (15 days). The schedule is normally recalculated once a week. However, if either customers’ requirements or workers’ availability change (which occurred with the COVID-19 pandemic), frequency can be shortened. This decision-making process takes place on Thursdays. In this calculation, the assignment for the next 3 days (also called frozen horizon) must not be modified (except in force majeure cases).

Several types of employees should be distinguished. First of all, workers (employees with some intellectual disability type) represent most of the labour force. Although people with intellectual disabilities form the main part of Espurna, a team of coaches is necessary. Coaches play a fundamental role in SEC’s structure by managing the work team and the relationship with customers. They are responsible for not only managing and supervising the activity of workers with disabilities, but also for linking the SEC with customers’ companies and supporting the relationships of workers with disabilities to those of contracting companies. As stated in different labour laws and collective agreements, a range of 40–45 h per week is authorised for workers, with a maximum of 50 h per week for coaches. Other employees are hired exclusively for administration and support tasks and, therefore, their assignment to these jobs is practically compulsory. Approximately 20% of workers are presently in charge of administration, management or coaching.

Throughout the year, the number of active labour enclaves ranges between 15 and 30 because some activities are seasonal or depend on business cycles. Presently, 25 different labour enclaves are set up for 11 different customers. By means of contracts, labour enclaves should be defined as an activity to be performed in a given location, for a given time and on a specific work shift; that is, even if the activity takes place in the same company, and at the same manufacturing site, the model should consider different labour enclaves if an activity and/or a work shift differs. Table 5 shows the updated information on labour enclaves.

Table 5 Labour enclave data table.

Customers request a quantity of labour hours per day in each labour enclave and usually require a minimum number of workers. This demanded capacity is met with both workers and coaches. Coaches support workers in their specific needs and solve all the problems that arise on a working day. Hence these team leaders accompany and train workers to achieve the best performance with spirit and supervision. For all these reasons, workers are generally accompanied by a coach. Each labour enclave and the existing contract set the required workers-coaches ratio, which ranges from three to nine workers per coach. If no coach is required, the ratio is null. In some labour enclaves, the same worker does not require a coach’s supervision thanks to his/her training and versatility.

Assignment preferences are necessary to form teams (made up of people with disabilities and their respective coaches) for labour enclaves. Preferences are expressed in certain affinity/versatility matrices. Each person’s personal conditions and availability are expressed in availability tables and work information tables. In this way, the model contemplates two affinity tables: one that focuses on the relationship between workers and labour enclaves (it can be for their skills and training in the specific job and a company requesting a given worker works, or not, in a certain labour enclave); another describes the affinity between workers because some cannot or must work together on the same shift and in the same labour enclave to avoid potential conflicts.

It should be noted that some workers can only work in certain labour enclaves as clerks, cooks or cleaners because they have been hired for this sole purpose. These data are contemplated in the model by giving different values to the worker-labour enclave affinity matrix. In this way, the workers with a score of 0 are those trained to work in that labour enclave, which forces their assignment. However, the workers not trained or untrained to occupy a given job post have a negative score of − 1000, and some are trained to perform tasks and can, therefore, be assigned to a specific work enclave. They have intermediate scores (− 5 or − 2) depending on the convenience, or not, of the assignment. A worker-to-customer affinity matrix has been preferred by the stakeholders in order to reduce the quantity of data management required. This decision is logical because few customers manage different labour enclaves at this time. Table 6 is an example of the worker-to-customer affinity matrix.

Table 6 The worker-to-customer affinity matrix \({\Phi }_{w,s}\).

Finally, the model is based on another matrix that indicates workers’ compatibility, which is the worker-worker affinity matrix. These data are contemplated by different matrix values so that the workers with a value of X are those who should not work together due to some kind of incompatibility. The workers who can coincide in the same work enclave and on the same shift take a value of A or B depending on the greater or lesser convenience (A denotes more affinity than B). Table 7 is an example of the worker-worker affinity matrix. In practice, A implies that \(\Psi =0\) (ideal pair), nothing denotes that \(\Psi =-2\) and B refers to \(\Psi =-5\).

Table 7 The worker-to-worker affinity matrix \({\Psi }_{{w}_{1},{w}_{2}}\).

Table 8 depicts the daily demand for some of the active labour enclaves.

Table 8 Customers’ requirement \({\mathrm{D}}_{j,t}\).

5.3 Experimental design

This section deals with the validation of the proposed model. The model was implemented by Python 3.9. Experiments were run on an Intel(R) Core(TM) i7-10700 CPU @ 2.90 GHz processor with 16 GB RAM in a Windows 11–64 bit environment. The Gurobi 9.5 solver was used.

For time-computing reasons, a time limit had to be set because it was noted in a preliminary stage that optimality generally depended on the size of instances, and on the quantity and size of the objectives included in the objective function.

For this reason, a plan was designed for the experiment by considering the same input instance, but by varying the quantity of the components (\(\pi\)) to be included in the objective function. The employed nomenclature was X–Y, where X denotes the number of components included in the objective function and Y indicates the experiment’s number. Each experiment was run by considering three different time limits (60 s, 300 s and 3600 s).

For each run, the objective function value of the best found solution, the gap, the time to the best one when the optimum solution was found, and the value of the different components (\({P}_{\mathrm{\varphi }},{P}_{\Phi }, \dots ,{P}_{\omega })\) of the objective function and its summation, (Z), were recorded. The value of the best found solution was also calculated and deviation in the percentage was compared to the best found value. Seventy-five scenarios were run. Table 9 presents the set of scenarios.

Table 9 Set of scenarios used in the experimental design.

5.4 Experimental results

The experimental results (Tables 10, 11 and 12) demonstrate that a commercial solver can solve the problem in most cases and in reasonable times when the objective function has a single simple component (Scenarios SC1_XX). But this is not the case when the objective is to maximize total worker-to-coach affinity and total worker-to-worker affinity. In the specific scenario Sc1_03, when time limit is 60 s, an MIP GAP value of 100% is obtained and after 1 h, it decreases to 68%. In the specific scenario Sc1_04, no feasible solution is found within 60 s, and an MIP GAP value of 92% is obtained after 1 h. Maximising worker-worker affinity is definitely the objective function component that required most computational effort because of the number of variables that it implies.

Table 10 Results with time limit = 60 s.
Table 11 Results with time limit = 300 s.
Table 12 Results with time limit = 3600 s.

It is also observed that in the scenarios Sc4_01, Sc5_01, when all of the affinities are considered in the objective function, obtaining a feasible solution takes more than 10 min. In the specific scenario Sc6_01 which is the desirable objective function, more than 2 h are necessary to obtain the first feasible solution and 12 h are necessary to achieve a MIP GAP value of 88.9%.

In the validation stage, checks were made to see which objective function components could be removed, such as excess capacity. Minimizing the excess delivered capacity (\({P}_{\mathrm{D}}\)) is correlated with maximizing the total days off (\({P}_{\mathrm{\varphi }}\)). However, total affinities (\({P}_{\Phi },{P}_{\mathrm{\rm X}}, {P}_{\Psi } )\) can be contradictory objective components with\({P}_{\mathrm{\varphi }}\), \({P}_{\omega }\) and between themselves.

6 The decision support system tool

6.1 Description of the front-end DSS

As previously mentioned, three affinity matrices were employed to implement the tool: a worker-to-labour enclave affinity matrix, a worker-to-worker affinity matrix and a coach-to-worker affinity matrix. When processing the model’s data, the last two matrices were combined to form a single employee-to-employee affinity matrix. A decision was made not to combine the matrix at the operational level given matrices’ different natures because they corresponded to distinct decision-making spheres. The coach-to-worker affinity matrix had to do with synergies and productivity, while the worker-to-worker affinity matrix sometimes corresponded to the decisions made by SEC’s team of therapists to help to avoid workers’ dysfunctional behaviour.

To facilitate inputting the data (and for everyone to understand them), matrices were filled in on the web platform with letters moved to the model in affinity values (see Fig. 1).

Fig. 1
figure 1

Source: Espurna

The worker-to-coach affinity screen.

Figure 2 is a screen showing the way that data were inputted into the model. It graphically presents each labour enclave with workers assigned on one day in particular. Coaches appear in another colour. This screen with the results allows a quick glimpse to check the initial assignment and if managers see if it is suitable.

Fig. 2
figure 2

Source: Espurna

An example of a daily assignment.

To facilitate the daily assignment tasks and making amendments due to sudden changes in demand (company’s requirements) or changes in capacity (illnesses of other reasons for being off work), the tool allows workers’ assignment to be changed to reschedule teams. These manual changes allow one worker to be assigned, if necessary, to two different enclaves by skipping the model’s restrictions should this be necessary at some point as an exception. This allows SEC the liberty to sort out any undesired model results. The designed tool also allows data on worked hours and workers’ job posts to be saved. This helps to control annually worked hours.

Finally, a screen was created (Fig. 3) showing the different enclaves that each worker goes to over time. This screen allows results and possible anomalies to be viewed over time that would not be seen with only numerical data.

Fig. 3
figure 3

Source: Espurna

An example of a daily assignment of the set of coaches.

6.2 Managerial insights

To set up the SEC model, it was necessary to update the basic data for the model. Essentially, the affinity matrices had to be designed and valued according to SEC’s many dimensions and the different stakeholders. Although the company had these matrices, they were completely out-of-date. The enormous task of manually distributing 90 employees in different labour enclaves was complex enough without ignoring the information in matrices. Only the most obvious data had to be taken into account: not being able to or having to go to an enclave. Matrices were not very useful because of the state they were in.

Regarding the demand of enclaves, the company had to standardise the way data were collected which, with time, has become an excellent benefit obtained by including the model.

The tool is presently being used and has proven very useful for starting to employ the useful data that could not be managed with the number of workers that SEC has today. As data are managed in the different affinity matrices, the tool is now being used to manage therapeutic-type training or rotations.

Weekend rest periods are also better managed. Previously, these rest periods had to be often taken on separate days, which affected workers’ motivation.

Some aspects are stressed as future work lines. The first one deals with the workers who cannot be assigned for being on sick leave or holiday. To manage them in the model, fictitious labour enclaves were created (holidays and sick leaves) and the affinity tables were modified so that the model could assign a worker to these fictitious enclaves. Although the model properly works in this way, it implies making major changes in the affinity tables that might cause problems in the mid/long terms. Moreover, these assignments have to be ruled out in relation to computing working hours.

A desirable future work line is for the model to include the presence of coaches in two labour enclaves on the same day. Sometimes if demand in hours at one enclave is low, a coach can go and support other enclaves. This situation occurs more frequently than expected, but modelling this situation is a complex matter.

Another future work line is to consider the drivers who take workers to their destinations. Drivers are necessary because some workers need to be transported to labour enclaves. In this specific case, they can join the labour enclave when they stop their routes, work at the foundation’s headquarters or go back to its facilities in the town of Gandia. As with coaches, drivers should arrive at two different labour enclaves on the same day.

From a longer term point of view, the model should be developed to be included in annual management models. For SEC it is essential to manage holidays and training in the long term (Lorenzo-Espejo et al. 2021) to avoid workers still having holidays pending or having worked too many hours at the end of the year, which makes team management complicated when a year ends. The tool should be able to manage to plan multifaceted aspects, including contracts and dismissals when capacity and demand do not match.

7 Conclusion

This paper proposes an MILP model to solve a shift assignment problem in a SEC on a fortnightly time horizon. The proposed model was designed for a specific protected SEC in the Valencian Community and was implemented in a Python application using Gurobi®. A very interesting issue to include in research is the work performance of people with different abilities because their inclusion in production has barely been addressed by scientists in the business and industry sectors.

This paper presents a real case study: the Espurna Foundation. The structure of the employed data is included and the design of experiments to validate the proposed model is put forward. The proposed model needs to consider many aspects in its objective function, such as workers’ availability, rest periods set out by law and collective agreements, demand variability and other characteristics, such as affinity among workers, affinity of jobs with customers, employee training, certain incompatibilities, among others. To obtain an acceptable solution for stakeholders, this work demonstrates that many factors must be included in the objective function, but objective function complexity makes finding a feasible optimum solution difficult in reasonable computing times.

The decision support system is also included. It was designed and set up at Espurna with the implemented MILP model. Different managerial insights are presented to reflect the difficulties and the necessary requirements for the decision-making tool to be used for the company’s daily activity.

The following are indicated as future work lines: although the computing times obtained with a commercial solver are satisfactory with small models, we found that as SEC grew, computing times became significantly longer, to the extent that no feasible solutions were found in reasonable times; hence the need to resort to heuristics and metaheuristics to overcome this problem. For another work line, it would be interesting to contemplate the productivity of the work teams in different labour enclaves. The affinity matrices consider dimensions like employee trainings and the effect of workers interaction. Some workers are encouraged and can be more productive if they work together, and some could be less productive. Incorporating this factor and the expected production level into each enclave would allow assignments to be better matched to meet not only the necessary human resources, but also the output level expected for each labour enclave.