Envy-Free Allocation by Sperner’s Lemma Adapted to Rotation Shifts in a Company

This article discusses a theoretical construction based on the graph theory to rework the space of potential partitions in envy-free distribution. This work has the objective of applying Sperner’s lemma to the distribution of three rotating shifts for three workers who are to cover a 24 h job position in a company. As a novel feature, worker’s preferences have been modeled as functions of probability for the three shifts, according to salary offers for said shifts. Envy-free allocation was achieved, since each worker received their preferred shift without the need for negotiation between agents in conflict. Adaptation to the type of dynamic situations that arise with rotating shifts, as well as the consideration of probabilistic preferences by workers are some of the main novelties of


Introduction
The application of Sperner's lemma to the field of asset distribution is considered in the most extensive set of strategies to ensure "fair" or "envy-free" division. In these divisions of a good, the assigned part to each player is considered the best among all the parts according to that player's preference function. This type of problem has become more frequent lately. The classic problem is the distribution of a cake, presented by Steinhaus [1] and later developed and applied to distinct areas by authors such as Robertson and Webb, Barbanel, Thomson, or Cohler et al. [2][3][4][5]. This problem attempts to fairly distribute an infinitely divisible resource, such as a cake, between various individuals, that is, how to cut the cake and distribute its pieces so that everyone is happy with said distribution.

Literature Review
The problem was initially developed for two agents. Then in the 1990s, it was extended to more than two individuals (k) by Brams and Taylor [6,7], who developed resolution algorithms. These strategies become notably more complicated as k increases. For this reason, a research line has been created, based on the results of combinatorial topology, such as Sperner's lemma [8] or Tucker's lemma [9], in order to find algorithms for the easy distribution of the cake that may be standardized for a larger k [10,11].
The main interest in the application of these results is that the solution obtained through Sperner's lemma is determined based on the priorities of the distinct subjects, considering all of these and eliminating the need for negotiation, that is, it is done in a democratic manner. Therefore, Sperner's lemma may be a valuable mechanism for objective decision-making. Another application of Sperner's lemma is rental harmony as a means to achieve a fair distribution of prices and rooms in a shared apartment. This proposal was created and dealt with for the first time by Su [12]. Subsequent variations of the same problem have appeared, such as the consideration of the preferences of only k − 1 roommates out of the total k individuals [13].
Furthermore, Sperner's lemma can be used also in a more theoretical context, such as to give an alternative proof of the Brouwer fixed-point theorem [14,15]. Another interesting work about this topic is a survey on the applications of Sperner's lemma developed by Huang [16].

The Presented Problem
The objective of this article is to extend the spectrum on the potential uses of Sperner's lemma and to offer tools and conditions that are necessary to extrapolate its application to other real-life problems.
In this work, a novel form of carrying out envy-free asset distribution is proposed, in which the functions of elector preference in the solution vertices are not deterministic, but rather, are the result of a probability distribution over the potential choices. In particular, each agent gives a probability (preference degree) to each alternative in the proposal. The motivation of these probabilistic preferences comes from the different requirements that can be found in real applications in rotating shifts. For instance, in some countries, there are some legal assumptions about the maximum number of consecutive shifts that illustrate the necessity of the probabilistic model. This approach generalizes the work performed by Su [12] and Mirzakhani and Vondrák [17], in the sense, that the deterministic preferences can be considered as a particular case of the probabilistic model.
As another novelty, due to the nature of the problem treated in this work, the consideration of these preference degrees carries out an external restriction independent of the agents.
This approach models certain real-life situations in which the final distribution, by nature, may experience modifications over time.
In this paper, we are concerned with the distribution of three shifts for three workers of a company. Throughout the article, as a research hypothesis, we consider that these three agents will give their preferences over the three alternatives of shifts and salaries.
Once the preferences of the agents are collected, an envy-free solution is found through the proposed algorithm based on Sperner's lemma.
Finally, a correction is made to the solution that guarantees that the three shifts will be covered according to the needs of the company.
The work is structured as follows: • Section 2 contains all the necessary definitions and basic results to follow the paper. • Section 3 presents the theoretical development. A triangulation is developed for the work region, which is found to be equivalent to that presented in Mirzakhani and Vondrák [17], see also [18,19]. In this section, we show the algorithm that assigns every vertex to a worker, demonstrating the uniqueness of the resulting distribution up to permutation. In addition, we propose and develop a correction to the solution.

•
In Section 4, the developed theory is applied to a practical situation of work shift distribution. • Section 5 contains the computational study of three simulated examples of shift distribution. • Section 6 gives some concluding remarks.

Definitions
In this section, we will give some definitions and known results that will help the reader follow the rest of the article. Note that, given that the dimension considered through-out the work is k = 3, the definitions in this section are adapted to the aforementioned dimension, being able to find the k-dimensional case in the following references: [8,11,17]. Definition 1. Triangular subdivision. A triangular subdivision, Tr, of the workspace, T, is a collection of triangles (cells) such that:

•
The union of the triangles of Tr is equal to T. • For any two triangles, T 1 , T 2 ∈ Tr, T 1 ∩ T 2 is either empty or a common face.

Remark 1.
Notice that, in this paper, we consider the following workspace, given by barycentric coordinates:

Definition 3.
Probabilistic preference function. The probabilistic preference function of the agent i is a function p i : The element α i j describes the degree of preference of the coordinate j for the agent i. For each vertex v ∈ V i , p i (v) is considered as a probability distribution over the coordinates.

Definition 4. Envy-free solution. Given
is an envy-free solution if different agents prefer different coordinates of (x 1 , x 2 , x 3 ), that is to say, for each agent their assigned coordinate is considered better than or equal to the other two coordinates according to their own preference function.

Lemma 1.
Sperner's lemma. For a triangular subdivision, Tr of T, that is colored by a Sperneradmissible coloring, the number of triangles in Tr with their vertices all colored differently is odd, that is, in particular, there always exists at least one triangle with this characteristic. We call those triangles: solution triangles.

Theoretical Development
This section considers the mathematical tools necessary for the creation of the problem at hand: distributing an asset between three electors who provide their probabilistic preferences for three choices.
It is based on a two-dimensional triangle, T, immersed in R 3 and a triangular subdivision for T, the Kuhn triangulation used by Deng et al. [11] and Mirzakhani and Vondrák [17]. Below, the assignation appears for the vertices of T to the electors by means of an admissible labeling of those vertices through which a novel preference function was established for the electors with probabilistic outputs.
The structure of the section is the following: • Simplicial subdivision of the triangle.

Simplicial Subdivision of the Triangle
As stated in Section 2, the initial triangle, T, is defined as is the number of divisions of each side of T in the triangulation of T that we make and in which each (x 1 , which represents the partitions of q where the electors reveal their preferences.
We use, as usual in the literature, the Kuhn triangulation as a triangular subdivision for T.

Assignment of the Vertices to the Electors
The vertices of G are distributed amongst the three electors by means of three subsets so they may declare their preferences regarding those vertices. For this, an admissible labeling is done on the vertices.
Each elector is identified with a label, ensuring that in the vertices of each triangle, the three electors are represented.
We will use the admissible labeling presented in [11], for k = 3. This labeling assigns We will call it the labeling by residues.
To ensure that the three electors have the same number of assigned vertices with this labeling, it is necessary that 3 divides |V|. We apply a condition to ensure this.

Finding an Initial Envy-Free Solution through Sperner's Lemma
In order to rescale T to make use of the Sperner's lemma, we call the asset to be distributed q and the minimum part of q' that is considered acceptable due to the specific problem m. Notice that we adapt definition 6 in the following way: v i = m implies that c(v) = i. This gives us M = q − 2 m as the maximum part of q' to choose. T is mapped to the triangle T defined by x + y + z = q , x , y , z ≥ m, with vertices v 1 = (M, m, m), v 2 = (m, M, m), and v 3 = (m, m, M), through the bijective linear application s(x, y, z) = x q v 1 + y q v 2 + z q v 3 , which transforms Tr into a triangulation of T whose vertices have the coordinate i for the part of q' that is assigned to shift i in said vertex. The application s also transfers the assignment of the vertices of Tr to an assignment of the vertices of the triangulation of T to the agents.
Each agent is asked in each of their assigned vertices: which one would be their preferred coordinate, according to the parts of q' that resemble the salaries of each shift. In order to ensure that the coloring is Sperner admissible, the elector cannot select a favorite shift that has been assigned the minimum part of q', m (hungry assumption in the cake model, see [12]).
Each vertex, v, is colored with i if the coordinate i is the one preferred by the elector who has been assigned to said vertex.
Having achieved a Sperner-admissible coloring, it is possible to apply Sperner's lemma and obtain solution triangles, T l , with the three colors, ensuring an envy-free distribution of shifts according to electors' preferences. The color associated with each vertex of a solution triangle marks the preferred shift of the elector who was assigned said vertex.
In the case of more than one solution triangle, in order to decide which is to be selected, the following criteria shall be followed: with t i being the number of times that coordinate i was preferred and k = q 1 In order to balance the preferences, one of the triangles whose barycenter is the closest to b p from the solution triangles T l is selected (T l 0 ). If the size of the solution triangle selected is good enough for the needs of the problem, we continue with stage 2, otherwise we repeat the process starting from the selected triangle until the solution triangle has the desired size. Thus, the iterated application of Sperner's lemma over the obtained triangles gives a sequence of solution triangles T l i , i ∈ N, with T l 1 ⊃ T l 2 ⊃ . . . that approaches an envy-free solution to the accurate level we desire. This way, the barycenter of T l i for a large enough i is an approximated envy-free solution.

Finding a Final Solution by Probabilistic Preference Functions
Having selected an initial solution triangle, T l 0 , in stage 1, the following refinement should be made to reach a final solution triangle: • A triangulation of T is found for a value of q (preferably lower than the initial one to reduce the number of choices in the second stage), and the vertices of this triangulation are assigned to the electors by means of function f.

•
Since the vertices of T l 0 have the three colors (1, 2, and 3) we label them as v 1 , v 2 , and v 3 respectively. In this way, T shall be mapped to T l 0 through the application s(x, y, z). • Some new probabilistic preferences are defined for each elector over the vertices of Tr l 0 (triangulation of T l 0 obtained as the image of the triangulation of T by s(x, y, z)) as follows: elector i declares their preferences in the vertices that have been assigned to them in Tr l 0 : The following Sperner-admissible coloring is defined: assign to each vertex v of Tr l 0 , corresponding to elector i, the color j if the shift j is the elector's most preferred admissible shift (the shift with highest α i j among the admissible elections. In case there is more than one shift with highest α i j , we choose the lowest index j.). Once again applying Sperner's lemma, other solution triangles, T * l , are found. In order to select the optimal choice from the solution triangles, T * l , the following criteria are used: Considering that each shift should always be covered, distributions are sought out that comply with this condition and that are the closest, in the least-square sense, to the elector preferences. Therefore, the following adjustment to minimize errors is made:

•
For distributions corresponding to the vertices of T * l : α i 1 , α i 2 , α i 3 , seek β i 1 , β i 2 , β i 3 with i = 1, 2, 3 so as to minimize the objective function g(β 1 1 , β 1 2 , β 1 3 , β 2 1 , β 2 2 , β 2 3 , β 3 1 , For the final solution triangle, select the T * l 0 in which the minimum of the m T * l values is achieved from all of the solution triangles, T * l . The barycenter of T * l0 provides an approximated envy-free solution, whose coordinates represent the salary for each shift. The final salary for each worker can be obtained by calculating the weighted average of the shift salaries with β i 1 , β i 2 , β i 3 as weights.

Application
The theory developed in Section 3 is put into practice in this section. To do so, we consider that the three electors are three workers in a company that needs to cover three rotating work shifts.
According to the model, each worker selects one shift preference per salary proposal. Having obtained the solutions to this first stage, one of these is selected and is refined, requesting that the workers assign a probability distribution over the shifts (see Definition 3) according to the new proposed salaries. Finally, a frequency of shifts is determined for each worker and a definitive distribution of salaries based on shift, as detailed in Section 3.3.
Below we present the details of the planning of the work shifts in a company; to see literature about planning shifts refer to [21,22].

Planning the Work Shift Assignment Problem
Work in shifts is an organizational team work method in which the workers successively carry out the same work positions, according to a specific rhythm, continuous or discontinuous. This may imply the need for the worker to offer their services during distinct hours over a specific period of days or weeks. Due to different legal requirements for the night shift (or, more in general, the shift rotation), it could be necessary to impose some restrictions that make impossible to assign the shifts in a deterministic way, which leads us to model the problem in a probabilistic manner.
Improving shift work conditions means the updating of the organizational level, and while there is no ideal design of shift organization, certain criteria may be considered to ensure more favorable conditions. Actions should be based, mainly, on an attempt to respect worker preferences to the utmost.
The basic recommendations in terms of shift work are as follows: • Rely on worker participation to ensure a balance between the needs of the work site and the worker's preferences. Worker participation is necessary in the phases of analysis, planning, and design of the shifts, both in the distribution and configuration of the shifts as well as in the determination of the teams.

•
It is important to know, beforehand, the calendar of the shift organization, so that workers may plan their outside lives accordingly.
Given all of this, our proposal is relevant, since it suggests taking into account worker preferences and relying on adequate planning.

Adaptation of the Theoretical Model to the Proposed Problem
In order to adapt the model to this type of problem, it should be considered that the three coordinates represent the three work shifts (morning, afternoon, and night) about which the workers are to be questioned. The vertices of the triangulation of T have the coordinate i for the monthly salary that is assigned to shift i in said vertex.
Triangulation, Tr, of T and the assignment of the vertices to the workers are both carried out. We do the following interpretation of the notations and procedures of Section 3.3.
The total money that the company has to distribute for its monthly salaries is considered q (the asset to distribute), m is the minimum salary, and M = q − 2 m is the maximum salary that a shift can reach.
The solution triangles, T l , with the three colors obtained in the first stage, ensure an approximated envy-free distribution of shifts according to workers' preferences. The color associated with each vertex of a solution triangle marks the preferred shift of the worker who was assigned the vertex.
The selection criteria of a solution triangle in the first stage (b p ) attempts to offer better salaries for less-desired shifts.
The value of q used for the stage 2 refinement of the selected solution triangle, T l 0 , should preferably be lower than the initial one to reduce the number of choices in the second stage. It should not be divisible by three in order to make possible a new assignment of the vertices of Tr l 0 to the electors, compatible with the previous assignment of the vertices of T l 0 (see Remark 3) and to make possible that the workers have the same number of assigned vertices (Proposition 1).
The values α i j in the probabilistic preference functions represent, in this case, the degree of preference of worker i with respect to shift j.
In the solution triangles, T * l , found in the second stage, each worker will have their preferred shift as the most probable shift.
The selection criteria of a solution triangle in the second stage considers the fact that each shift should always be covered. Thus, it manages the distributions that comply with this condition and that are the closest, in the least-square sense, to the workers preferences in each solution triangle and selects the solution triangle, T * l 0 , that minimizes this deviation.
The vector β i 1 , β i 2 , β i 3 corresponding to the vertices of T * l 0 , provides the frequencies with which each worker will cover each shift, and the coordinates of the barycenter of T * l 0 provide the salaries assigned to said shifts in the approximated envy-free solution.

Computational Experiments
The obtained method is implemented for application to the simulation of three examples of rotating shifts and salaries in a company. In these three scenarios, we first select q = 10. This is not an arbitrary selection. Note that a lower value of q offers less precision and a higher value of q extends the process a great deal. In all, 66 vertices are obtained, 22 per elector, with a minimum difference of EUR 150 in the salaries with this value of q. We create the Tr triangulation of T for 66 vertices, which are shared, according to function f, amongst workers R, J, and S.
The total monthly budget for the three shifts is q = 4000 €, with the minimum wage per shift being m = 700 €, thus the maximum wage per shift would be: Applying the function s with these data, we reach an analog triangulation of T and an assignment of vertices to the three workers. The workers select their favorite shift in the salary conditions marked in their vertices resulting in a solution triangle.
In these conditions, it is not necessary to refine the obtained triangle because the size of said triangle is good enough for our purposes.
In the second stage, for the refinement of the solution triangle, in order to be accurate enough, we choose q = 4. This is because the difference between the options is fine enough (EUR 45) and it generates an acceptable number of questions (five for each worker), which answer is a more complex distribution not just a selection, as previously.
We have designed three different scenarios to check the limitations and scope of the method. In the first scenario, each worker would have a main preference for a distinct shift; in the second, the three workers would have it for the same shift and in the third, only two workers would coincide in the shift preference. Figure 1 shows each solution triangle in the first stage (the blue-shadowed ones) and the selected solution triangle (T l 0 shadowed in yellow). The colors of the vertices represent the three shifts (yellow/blue/black, indicating morning/evening/night); b p is marked in red. The forms indicate the distribution of the vertices amongst the electors (labels). Notice that in the first scenario (Figure 1a) there are 13 solution triangles, 1 in the second scenario (Figure 1b), and 3 in the third one (Figure 1c). worker), which answer is a more complex distribution not just a selection, as previously.

Scenarios
We have designed three different scenarios to check the limitations and scope of the method. In the first scenario, each worker would have a main preference for a distinct shift; in the second, the three workers would have it for the same shift and in the third, only two workers would coincide in the shift preference. Figure 1 shows each solution triangle in the first stage (the blue-shadowed ones) and the selected solution triangle ( shadowed in yellow). The colors of the vertices represent the three shifts (yellow/blue/black, indicating morning/evening/night); is marked in red. The forms indicate the distribution of the vertices amongst the electors (labels). Notice that in the first scenario (Figure 1a) there are 13 solution triangles, 1 in the second scenario (Figure 1b), and 3 in the third one (Figure 1c). In Figure 2, one can see the second stage of the procedure: solution triangles in the refinement of each scenario (seven in scenario 1 and three in scenarios 2 and 3) with the same color criteria as Figure 1. In Figure 2, one can see the second stage of the procedure: solution triangles in the refinement of each scenario (seven in scenario 1 and three in scenarios 2 and 3) with the same color criteria as Figure 1.

Scenarios
Finally, in Table 1, one can observe the summary of results of the algorithm used to obtain the solutions in the three different scenarios. Each of these scenarios has its own associated sub-table merged in Table 1, constituted by four columns; the first three columns are related to the shifts, and the fourth one is divided in two different blocks. All the used notation is detailed in Section 3.3. Finally, in Table 1, one can observe the summary of results of the algorithm used to obtain the solutions in the three different scenarios. Each of these scenarios has its own associated sub-table merged in Table 1, constituted by four columns; the first three columns are related to the shifts, and the fourth one is divided in two different blocks. All the used notation is detailed in Section 3.3. Each sub-table has, in the first three columns, the weighed barycenter in the first row, in the second row we find the barycenter of the triangle (the approximated solution found in the first stage). The third row in each sub-table is the final salary associated with each shift ( * barycenter). The last three rows are the corrected percentages, , for the worker i in the shift j. The first block of the fourth column is the minimum of the * ( for the scenario i) of each scenario and represents the global deviation between the preferences of the workers and the corrected final distribution. The second block is the final salary for each worker.  Each sub-table has, in the first three columns, the weighed barycenter b p in the first row, in the second row we find the barycenter of the triangle T l 0 (the approximated solution found in the first stage). The third row in each sub-table is the final salary associated with each shift (T * l 0 barycenter). The last three rows are the corrected percentages, β i j , for the worker i in the shift j. The first block of the fourth column is the minimum of the m T * l (m i for the scenario i) of each scenario and represents the global deviation between the preferences of the workers and the corrected final distribution. The second block is the final salary for each worker.

Analysis of the Results
It is important to highlight that in scenario 1 worker 1 prefers night shift, worker 2 prefers evening shift, and worker 3 prefers the morning one, and consequently, due to the lack of competition between workers, m 1 is a very low value compared to the other scenarios. On the other hand, m 2 is more than 40 times greater than m 1 because in the second scenario the three workers have the same preferred shift (morning). Thus, more correction error is made in order to ensure that the three shifts are always covered. Furthermore, in scenario 3, there is some competition (worker 1 and worker 2 both prefer evening shift, whereas worker 3 prefers morning), resulting in m 3 being an intermediate value between m 1 and m 2 .
Notice that the number of solution triangles is much bigger in the first scenario (13) than in scenario 2 (1) and in scenario 3 (3), as we can expect due to lack of competition resulting in less conflict. This results in more acceptable solutions, whereas any kind of competition reduces the number of available solutions.
Since we have to choose just one of those triangles, we introduced the weighed barycenter criteria earlier, assigning higher salaries to the less-desired shift. It is worthy to point out that, in the three scenarios, b p lies very close to the T l 0 barycenter and, consequently, to the final solution, T * l 0 barycenter. This indicates the adequacy of this criteria. The difference between the three scenarios in terms of competition has another implication in the resulting shift salaries. When there is no competition (scenario 1), the difference between these salaries is smaller than EUR 570, while with hard competition (scenario 2) this difference exceeds EUR 1092. As in the case of m 3 , in scenario 3 the difference is EUR 855, an intermediate value with respect to the other scenarios. Looking into each one of the individual shift salaries, it can be noted that this value reflects, in some way, the desirability of that shift for this set of workers.
Analyzing the corrected percentages, β i j , we can observe some correlation with the competition degree of these scenarios. When the agreement is easily attained (scenario 1) the preferred shift of each worker is rewarded with a high value of the correspondent percentage (β i j > 0.6). Looking into the data, we only find another value over 0.6, which is β 3 1 , exactly the only case free of competition in scenarios 2 and 3. This pattern is mainly due to the need of a bigger correction in the cases with higher competition.

Discussion and Conclusions
The assignment of shifts in a company is a classical management problem that is usually referred to as the "nurse scheduling problem". It has been treated in different ways, for instance through the application of constraint logic programming [23]. Another example of this kind of study of management problems can be seen in [24], in which the authors deal with some non-standard shift types by means of a redundant modeling approach.
It is worthy to point out that, in these methods, workers are asked about their wishes about days off or vacation periods, but their preferences about the shifts are not taken into account.
Nevertheless, it seems that there is no precedent for the application of Sperner's lemma to solve this type of problem.
In this paper, a procedure has been carried out using Sperner's lemma to find a solution to a problem of dynamic distribution of shifts in a company. To do so, first, a reformulation of classic triangulation of the bi-dimensional work space was performed using tools of the graph theory. This permitted the assignment of salary partitions to the workers in a systematic manner. It has also been verified that this assignment is essentially unique and an algorithm has been provided to carry it out.
The greatest novelty of this article is the consideration of functions of probabilistic preference of electors as a way of adapting to the rotating nature of the 24 h work shifts of a company, enabling cases in which not every worker always has the same shift assigned. Sperner's lemma, in this scenario, permits the distribution of the work shifts and of the common asset (the total money that the company has for salaries) such that each worker covers their favorite shifts with the greatest frequency, thereby respecting the priorities of the involved agents.
Although there has been past work on admissible fractional Sperner colorings in which each vertex is not assigned a specific color, but rather a probability distribution over the set of admissible colors [25], there are no cases using fractional preferences over said vertices. In fact, the previously cited approximation is, in some ways, the opposite of the one developed in this work: they propose fractional colorings giving subsequent deterministic valuations in the vertices. In the work carried out here, the electors give their probabilistic preferences under the vertex conditions, with which a deterministic coloring is defined from the same, offering a fair distribution. This paper also considers the problem of ensuring the suitability of the worker shift preferences to the needs of the company in order to cover all of the daily shifts. To do so, a correction was carried out that minimizes the overall deviation between the worker's proposal and the company needs, thereby ensuring maximum general satisfaction. One interesting result is that, at least in the considered case of three workers, the correction that minimizes the overall error "penalizes" all workers equally, that is, it assigns the same error to each worker's election, except in the extreme case in which a worker never covers a shift. In this way, individual satisfaction is ensured.
Furthermore, the developed method has been implemented and its soundness in some practical examples of fair shift distribution has been validated.
As a complement to this work, it would be possible to develop and implement a means of carrying out monthly hour distribution that respects the shift frequencies established in this model.
Another line of work could be the distribution of the different tasks to be assumed by the workers in the manufacturing process of a company. We expect that Sperner's lemma would also be helpful in order to address these kinds of problems.
A future goal would be to generalize the model upon exposure to k dimensions. The theoretical development seems to have a direct generalization from 3 to k dimensions. The k dimensional model will fit a broad spectrum of real situations for companies with k shifts to be covered by k workers in an envy-free way. However, for large values of k, the combinatorial nature of the problem makes it unfeasible to compute completely, so solution-search algorithms could be used to find, maybe not every, but at least, one solution.