PRACTICAL APPLICATION OF MATCHING ALGORITHMS IN CASE OF A TASK ALLOCATION PROBLEM

Conflicts between individuals or even groups of people are part of everyday social life. However, when handling conflict situations successfully, conflicts are actually solved. In order to achieve such resolution, parties should separate the conflict from the involved people and try to create a cooperative, nonzero-sum mind set concentrating on interests and not on positions agreeing on principles like using a fair standard and a fair procedure. In present paper such impartial standards and procedures namely matching theory algorithms that concentrate on factual controversies are


INTRODUCTION
In everyday life there are various situations, where the interests of two or more parties collude.These conditions are usually labelled as conflict situations.Conflicts are issues, where not only rational facts, but psychological features, such as values, attitudes and beliefs and emotional characteristics collude.Such problem is the organisation of holidays or that of shifts in a company working 24/7.
There are high seasons for going on longer holidays (summer or winter), and there are shifts that are always least preferred when working 24/7.Present article addresses the question of allocating shifts of the Christmas Holiday between employees, which usually would give birth to immense conflicts and lasting hurt.

CONFLICT AND THE MEANS OF RESOLUTION
Conflict is a situation of competition in which the involved parties possess incompatible future positions and in which the parties wish to occupy positions that are incompatible with the wishes of the other parties (Tedeschi et al., 1973).Hence, conflicts between individuals or even groups of people are part of everyday social life.
Conflicts may be evaluated along the continuum of cooperative to competitive.In cooperative conflicts ("positive-sum games" or "conflicts of coordination") the point of conflict is that without the help or contribution of the other party the individual is not able to reach his/her personal optimum.On the other hand, in some cases conflict are purely competitive("zero-sum games" or "negative-sum games") where the gain of one party is the (or generates an even bigger) loss for the other party.Nonetheless, most everyday situations do not represent any of the two extremes but lay somewhere in the middle-ground and may be characterised by both cooperative and competitive aspects ("nonzero-sum games" or "mixed-motive conflicts").
However, it is important to note that conflictsonly arise when the parties become aware of the incompatibility and wish to interfere with the realisation of each other's goals.This perceived nature of conflicts is emphasised well in Wilmot and Hocker's (2007) definition, where "conflict is an expressed struggle between at least two interdependent parties who perceive incompatible goals, scarce resources, and interference from others in achieving their goals".
Conflicts may arise on various grounds.The clash of aims (different goals), ideas (different interpretations), attitudes (different opinions) and behaviours (different actions are deemed unacceptable) produces various kinds of conflict situations.Conflictsaccording to Coser (1956) -can be realistic and non-realistic.Situations where specific demands and the estimations of the potential gains of the involved parties are clashing are labelled realistic conflicts.
Nonrealisticconflicts, onthe otherhand, are not caused by the fight for scarce resources or certain benefits, butbythe needfor tension release of one or more of the parties.
In line with Lewis Coser's (1957) approach conflicts are functional, or at least may be regarded as such.Since conflicts are inevitable when creating new ideas and solutions, it triggers and/or stimulates innovation, and hence may lead to technical or social change.The very example is the technological improvement that has resulted from the trade union's intent on raising the wage levels and hence inducing investment in R&D activities.Conflicts arealso essential parts of relationships and are not necessarily signs of instability.
However in some cases conflicts are especially damaging.In worst case conflicts are closed with destructive agreements that do not really solve the underlying problems just transpose and escalate them.Agreements, whose outcomes are oppressive to one side and/or imposed unilaterally while promoting inequality and power imbalance damage relationships and often require redress or revenge.
In order to prevent a damaging conflict Dudley D. Cahn and Ruth A. Abigail (2013) recommend the participants to recognise and understand that the perception of each and every situation is coloured by personal experiences, beliefs, fear and prejudices.They recommend the parties to try to be neutral and if not forget about their own psychological determinants (values, beliefs …) at least try to be aware of them and deliberately reflect on them when facing a conflict situation.Their other recommendation is to carefully plan and decide on the timing and place of the conversation, since external interruptionsand outside stress may add to the intensity of the confrontation.
When handling conflict situations successfully, conflicts are actually solved.That means that a mutually acceptable solution has been found, which could restore equality of the partners and hence strengthen the relationship of the involved parties and foster future collaboration of them (Keith, 1989).In order to achieve such resolution, parties should separate the conflict from the involved people and try to create a cooperative, nonzero-sum mind set (Deutsch, 1977).By doing so, those involved should concentrate oninterests and not on positions (Positions are what you're demanding as a solution, while interests are why you perceive a certain situation as a conflict).Parties should also agree on principles like using a fair standard and a fair procedure.Impartial standards and procedures that concentrate on factual controversies (i.e.realistic conflicts) are provided by applied mathematics, especially game and matching theory.

CONFLICTS AS MATHEMATICAL PROBLEMS
From a problem oriented point of view every conflict situation is a problem to be solved.Hence conflict resolution is a process, where the first step is to realise that the current situation does not conform to the ideal one (perception).The second phase of problem solving would be to generate alternative solutions with the help of the available information; while the termination of the process is the decision made on any of the alternative solutions and the implementation of it.March and Simon (1958) consider conflict as a breakdown in the standard mechanisms of decision making, where an individual or group experiences difficulty in selecting the mutually optimal alternative.Game theory and especially matching theory provides just (impartial) solutions for such problems.
While most organisational conflicts are resource or task allocation problems, by selecting and introducing an adequate algorithm that employs fair standards and a fair procedure the disruptive nature of the conflict can be negated.
The everyday algorithm employed in case of resource/task allocation is the first come first served (or in mathematical language the greedy algorithm).The first employee, who makes his/her choice is offered the widest variety of choices, and the second, or later coming ones can only select from the remaining options.Hence, the first actor is favoured to any other, and those after him/her are favoured compared to the upcoming parties.The solution generated by such an algorithm is rarely just or optimal.The problem is not solved on a cognitive level, and those experiencing inequality of choice might be disheartened, demotivated, irritated or frustrated by the result.
Therefore a lot of effort has been dedicated at designing algorithms that are stable, resulting in upshots (matchings) that cannot be dominated by any other.Stable matching algorithms, such as the Gale-Shapley algorithm (Gale & Shapley, 1962) or the Boston algorithm (Abdulkadiroğlu & Sönmez, 2003) assign resources/tasks to actors in a way, in which none of the participants could end up in a better position without harming the interests of another involved party.When the algorithms are run in an emotionally non-manipulative environment, for example as a computer program on the local intranet, and everyone is aware of the underlying principles of the algorithm, the process of problem solving satisfies the criteria of constructive conflict resolution.

RESEARCH METHOD
In order to demonstrate the operation of such a system, a fictive problem of disseminating 10 shifts of a company working 24/7 during Christmas to 10 employees has been modelled.The 10 shifts that were examined are displayed on Table 1.
In order to create a matching that would simulate the normal first come-first served (greedy) algorithm and other stable matching algorithms 10 random preference lists have been generated for 10 employees (labelled E n ).Values were generated in a way, where maximum 110 points (from now on utility points) have been disseminated among the 10 shifts -more points given tomore preferred alternatives.The only additional rule has been that each shift had to receive at least one point.
It was important to create an environment that is easily accessible and does not require much informatics knowledge to operate.Hence a webpage has been created by php programming, which is independent form the platform it is running on.The data can be collected from simple csv files and are stored on a MySQL database server.The results of the matching algorithms are displayed in table and graphic format (as it will be presented in the coming part of the paper).

RESULTS
If we regard an utopistic situation, where every employee could work in the most preferred shift, the total utility would be 391utility points, that would mean adding up the utility points of the most preferred shifts (Table 2 -second column), however, in this case S1, S2, S3, S4, S5, S6, S9 would not have any employees, and E1, E3, E5, E6, E7, E8, E9, E10 would work in the same shift.To create a solution, where all the shifts are staffed, organisations usually use the first come, first served logic and let their employees decide on who works in which shift.

Greedy algorithm
In order to simulate the greedy algorithm, E 1 (the first employee) was given his/her first choice, while E 2 and employees after him/her (E 3 , E 4 , …, E 12 ) could only be matched with the remaining shifts, namely with the most preferred still unoccupied shift.Since every employee had to rank each and every shift, there was no employee or shift by the end of the process unmatched.The shifts have been disseminated as the results of such an algorithm are displayed in Table 3.The preference ranking of the given shift and the assigned value is also displayed below.
As it can be easily calculated, the perceived utility (value) of such a matching is 144 utility points.It is less optimal from E3, E5, E6, E7, E8, E9, E10 point of view than when they would get their mostpreferred choice.What is more, if E1 and E7 would swap their shifts, the matching would be a more preferred one from the value point of view.

Boston algorithm
To prove the hypothesis of stable matchings providing a better solution to realistic conflicts first the Boston mechanism has been applied.An algorithm which first has been used in Boston in 1999 for simulating and solving the problem of high school admissions (Ergin & Sönmez, 2006;Abdulkadiroğlu et al., 2005;Abdulkadiroğlu & Sönmez, 2003).The algorithm runs as following: 1.In the first step each employee designates the shift with the highest preference ranking.
2. When more employees designate the same shift, the one with the highest preference value gets it.No other employees are Employees, who are already matched with a certain shift cannot lose their right to the shift.
3. Employees, who did not end up with a shift of their choice apply for their next choice (the second highest ranking shift) and the second step is repeated again. 4.
Step 3 is repeated till each employee finds a shift.
The mechanism is Pareto-optimal on the basis of the given preferences.The biggest deficiency of the system is that employees have to think strategically and use tactics, hence it is of high risk to designate a shift that might be too popular, since if one does not succeed in getting the shift he/she might end up with his second and third choice shifts being already taken before the second round starts (Glazerman & Meyer, 1994).
The result of the Boston algorithm applied on the sample at hand is displayed on Figure 1.
As it can be seen each shift and each employee is matched.The total value generated by the algorithm is 180 utility points -significantly higher than that of the greedy algorithm.The shifts have been disseminated as the results of such an algorithm and displayed in Table 4.The preference ranking of the given shift and the assigned value is also displayed.Since the matching is stable, there are no two employees, who could end up with more referred shifts than their present ones by swapping their shifts.

Gale-Shapeley algorithm
There is another, even more widely spread matching algorithm that provides stable matching, namely the Gale-Shapley algorithm (Gale & Shapley, 1962).This algorithm is especially adequate to solving resource or task allocation problems, since it does not only aim at providing a stable matching, but also tries to maximise the value on both sides of the equation, namely that of the organisation and its employees (Balinski & Sönmez, 1999;Abdulkadiroğlu & Sönmez, 2003).The method is in some way similar to the Boston mechanism introduced previously.
1.In the first step each employee designates the shift with the highest preference ranking.
2. When more employees designate the same shift, the one with the highest preference value gets it.No other employees are accepted for that shift.
3. Employees, who did not end up with a shift of their choice apply for their next choice (the second highest ranking shift) and the second step is repeated again. 4.
Step 3 is repeated till each employee finds a shift.
The difference between the two algorithms is that while in the Boston mechanism employees, who are already matched with a certain shift, cannot lose their right to the shift.In case of the Gale-Shapeley mechanism if an employee with higher preference ranking occurs than the previously accepted one, he/she can take the place of the employee accepted in the previousround.Hence the total value of the matching is significantly higher than that of the matching generated by the Boston algorithm.
The result of the Gale-Shapeley algorithm applied on the sample at hand is displayed on Figure 2.
The total value in this case was 185 utility points.The shifts have been disseminated as the results of such an algorithm are displayed in Table 5.The preference ranking of the given shift and the assigned value is also displayed.Yet again, Gale-Shapley being a stable matching is a guarantee that there will  be no two employees who could swap their shifts and both end up with more preferred positions.

CONCLUSION
In conflicts values, attitudes, beliefs and emotional characteristics collude.Such problems arethe high seasons for going on longer holidays (summer or winter), and shifts that are most/least preferred.Present article addresses a specific problem of allocating shifts of the Christmas Holiday between employees, which usually would give birth to immense conflicts and lasting hurt.As presented above, the impartial standards and procedures such as matching theory algorithms -namely the Boston and the Gale-Shapeley algorithm -that concentrate on factual controversies are better than techniques applied in everyday conflict situations such as resource or task allocation.Not only the value generated with the help of such mechanisms is higher than that gained with the usually applied first  come first served methodology, but the equality of opportunities and the fairness ofthe underlying principles (like using a fair standard and a fair procedure) is also granted.
In this sense the Gale-Shapeley algorithm is more recommended than the Boston mechanism, since it does not give way to speculation and tactics and therefore does not favour employees with a better understanding of the system's internal logic.
Nonetheless, with both algorithms presented in this paper providing stable matchings the problems are solved on a cognitive level, and parties involved may experience higher level of satisfaction and wellbeing owing to the clear, rational and just nature of the process.
Since the software is online and can be made accessible for all kinds of organisations, the use and recognition of matching algorithms can be increased, hence new type of conflict resolution can enter the sphere of problem management.

Figure 1 .
Figure 1.The result of the Boston algorithm Figure 2. The result of the Gale-Shapeley algorithm

Table 1 .
List of shifts at Christmas

Table 2 .
Randomly generated preferences of employees

Table 3 .
Distribution of shifts at Christmas with the help of the Greedy algorithm

Table 4 .
Distribution of shifts at Christmas with the help of the Boston mechanism

Table 5 .
Distribution of shifts at Christmas with the help of the Gale-Shapley algorithm