1. Introduction
In the context of education, it is increasingly common that students spend some time doing practical work in a company as part of their curriculum. This work is sometimes remunerated: companies benefit from this program as they get motivated students that will work for reduced wages, and students benefit from a first contact with the labour market. It has been found that the employability of students at the end of their studies increases thanks to these internships. Nowadays, education authorities match students with companies mostly by hand. This paper formalises this matching process as a combinatorial optimization problem, proposes some heuristic algorithms and studies their computational complexity.
Team formation with respect to skills/expertise is a well studied topic of interest within the AI and MAS community AndrejczukBRSM18. inproceedings tackle the problem of team formation considering skills, communication costs, and tasks that progressively arrive in time. In the same direction, 10.1007/9783642334863_31 propose a heuristic algorithm for forming one team of experts for a specific task. 10.1007/9783319468822_2 propose several heuristic algorithms for forming a single robust team in order to compete a given set of tasks. The authors in 56283 target the problem of partitioning a group of individuals into equalsized teams so that each one will resolve the same task. Here we consider the problem of allocating individuals into teams of different sizes in order to resolve different tasks. In fact, our problem can be viewed as a generalization of 56283.
In this work, we present and formalise an actualworld problem, the socalled Team Allocation for Internship Programs (TAIPP)
. We characterise the complexity of the TAIPP and the search space that an algorithm that solves it must cope with. We propose how to encode the TAIPP as a linear program so that it can be solved by a general purpose LP solver. Furthermore, we propose a novel, anytime heuristic algorithm that exploits the structure of the TAIPP. As we will show, our proposed algorithm outperforms the general purpose optimizer IBM CPLEX in terms of time: it always reaches the optimal solution at least 55% faster than CPLEX, and reaches a quality of 80% in less than 20% of the time we need to construct the input for CPLEX.
As such, in what follows, in Sec 2 we formally describe the TAIPP, provide formal definitions of the problem’s components, and study the complexity of the problem. In Sec 3 we provide the encoding for a linear program solver. In Sec 4 we propose our heuristic algorithm; while in Sec 5 we conduct a systematic evaluation and show the effectiveness of our algorithm.
2. Problem Formalization
In this section we present the individual components of the problem, discuss their intuition, and provide formal definitions. We begin with the formalization of internship programs and students, along with a thorough discussion on the essential notion of competencies. Then we proceed on presenting our notion of competence coverage, and show how to compute it.
2.1. Basic elements of the allocation problem
An internship program is characterised by a set of requirements on student competencies and team size constraints. For instance, think of an internship program in a computer tech company: there are 4 competence requirements (a)machine learning principles, (b) coding in python, (c) web development, and (d) fluency in Spanish language, while the required team size is 3 members; as such, for this program we need a team of three students that as a team possesses the four required competencies.
In general we can have a large variety of other constraints, such as temporal or spatial constraints, i.e., when and where the internship can be realised. However, within the scope of this paper, we only focus on team size constraints. The required competencies are often accompanied by their level and importance. Formally, an internship program is a tuple , where is the set of required competencies, is a required competence level function, is a function that weighs the importance of competences, and is the team size required. The set of all internship programs is denoted with , with .
A student is characterised by their competencies, and their competence levels. Formally, a student is represented as a tuple , where is the set of already acquired competencies, and is a competence level function, and hence is the student’s competence level for competence . The set of all students is denoted with , with . Given , we denote the set of all sizecompliant teams for as .^{1}^{1}1Note: we use the subscript to refer to the set of competencies, competence level function, etc. of a student , and the subscript to refer to the same elements of the internship’s .
But size is not enough, we need that the members of a team are suitable for the competencies requested by a company. We assume that there is a predefined ontology that provides a fixed and finite set of competencies along with relations among them. We further assume that the ontology is a tree graph, where children denote more specific competencies than those of their parents. Formally, an ontology is a tuple with being the competenciesnodes and the edges. The metric over ontologies that we will use next is the semantic similarity. The semantic similarity is given by
(1) 
where is the shortest path in the tree between and , is the depth of the deepest competence subsuming both and , and are parameters regulating the influence of and to the similarity metric. This is a variation of the metric introduced in 1209005, which guarantees the reflexive property of similarity, that is, a node is maximally similar to itself, independently of its depth. In other words, nodes at zero distance () have maximum similarity. Similarly to Osman:2014:TMA:2542182.2542198, the semantic similarity between two competence lies in .
2.2. Computing competence coverage for students and teams
In order to evaluate how well a student fits with an internship we need some notion of coverage for each competence required by an internship by the actual competencies of a student. Thus, we define the student coverage of competence by a set of competencies as .
And then, naturally, given a program with required competencies and a student with acquired competencies the competence coverage of program by student is:
(2) 
Moving now from a single student to a team of students , we need first to solve a competence assignment problem. That is, we need to assign to each student a subset of competencies of , and assume that student is responsible for (in charge of) their assigned competencies. According to 56283 we have that:
Definition (Competence Assignment Function (CAF)).
Given a program , and a team of students , a competence assignment is a function , satisfying .
The set of competence assignments functions for program and team is noted by . The inverse function provides us with the set of students in that are assigned to competence .
However, not all competence assignments are equally accepted. For example, consider a program (with ), and a team . An assignment such that and seems to be unfair—assigning all competencies as student ’s responsibility—,while assignment such that , and is more fair, in terms of allocating responsibilities. In the setting of internship programs, we prefer assignments such that all students are actively participating, i.e., assignments such that for each student (the socalled inclusive assignments in ewaThesis). At the same time, we would prefer not to ‘overload’ a few students with excessive responsibilities, but selecting fair competence assignments. This is captured by the following definition:
Definition (Fair Competence Assignment Function (FCAF)).
Given a program , and a team of students , a fair competence assignment is a function , satisfying , , and .
Now, given a competence assignment , we define the competence proximity of a student wrt a program . To do so we take into consideration the importance of each competence and the students coverage of the assigned competencies. In the competence proximity we want to encode the following scenarios:

the competence proximity should be as high as possible when the coverage of a competence by a student is maximum;

the competence proximity should be as high as possible when the competence is not important;

the competence proximity should be as low as possible when the coverage of a competence by all students is minimum.
For a competence and a student , we can visualise the above properties in the truth table in Table 1.
If we think and , the importance of competence c in program p, as Boolean variables, we can interpret this table as a logical formula
However, and are continuous variables in , so we model the ‘or’ condition of the above logical formula as the ‘maximum’ between the two variables. As such, we define the competence proximity of a student for an internship program as:
Definition (Student’s Competence Proximity).
Given a student , an internship program , and a competence assignment , the competence proximity of for with respect to is:
(3) 
Moving to the competence proximity of a team of students for program , we use the Nash product of the competence proximity of the individuals in for , with respect to some FCAF . The Nash product assigns a larger value to teams where all students equally contribute to their program, rather than to teams where some students have a small contribution.
Definition (Team’s Competence Proximity).
Give a team a program , and a competence assignment , the competence proximity of team for program is:
(4) 
For a team and a program its competence proximity varies depending on the competence assignment at hand. We define the best competence assignment as the fair one (Definition 2.2) that maximizes the competence proximity: equationparentequation
Finding the best competence assignment is optimization problem itself. Even though the above is not a linear optimization problem, it can be easily linearized by considering the logarithm of : equationparentequation
2.3. The team allocation problem as an optimisation problem
Finding a good allocation of students to a collection of internship programs is yet another optimization problem that tries to maximize the overall competence proximity of all teams for their assigned internship program. That is, for a single program , the best candidate team is the one that maximizes the competence proximity: . is the best candidate when a single program is at hand. For a set of programs , with , we need to maximize the competence proximity of all candidate teams with their corresponding programs. Suppose we have a team assignment function , which maps each with a team of students . We assume that for two programs and it holds that . In the setting of matching internship programs with teams of students we should consider only team assignment functions such that assigns each student to at most one program. As such, we can define feasible team assignment functions:
Definition (Feasible Team Assignment Functions (FTAF)).
Given a set of programs and a set of students , a feasible team assignment function is such that for each pair of programs with , it holds that ; and for all it holds that .
The family of all feasible team assignments is denoted with . Now we are ready to formalise our team allocation problem as follows:
Definition (Team Allocation for Internship Programs Problem (TAIPP)).
Give a set of internship programs , and a set of students , the team allocation for internship programs problem is to select the team assignment function that maximizes the overall competence proximity:
(7) 
The following result establishes that the TAIPP is by reduction to a wellknown problem in the MAS literature.
The TAIPP, with more than one program at hand, is .
Proof.
The problem is in since we can decide whether a given solution is feasible in polynomial time (). We show that the problem is by using a reduction from Single Unit Auctions with XOR Constraints and Free Disposals (referred to as BCAWDP with XOR Constraints) which is shown to be 10.1145/544741.544760. In the BCAWDP with XOR Constraints, the auctioneer has items to sell, the bidders place their bids with be a subset of items and the price. Between two bids can exist an XOR constraint–not necessarily to every pair of bids. The auctioneer allows free disposals, i.e., items can remain unsold. Given an instance of BCAWDP with XOR Constraints, we construct an instance of studentteams allocation to internship programs problem as follows: “For each item we create a student . For each program of size we create different bids , where is the number of items, , and . All bids created for program are XORconstrained bids. Moreover, each pair of bids such that are also XORconstrained.” Now the team allocation for internship programs problem has a feasible solution if and only if BCAWDP with XOR constraints has a solution. ∎
Typically, the winner determination problem for combinatorial auctions can be cast and solved as a linear program. Along the same lines, we propose how to solve the TAIPP by meas of LP in Sec 3. Before that, the following section characterises the search space with which an algorithm solving the TAIPP must cope.
2.4. Characterising the search space
The purpose of this section is to characterise the search space defined by the TAIPP. This amounts to quantifying the number of feasible team assignment functions in . For that, we start by splitting the programs in into buckets of programs, where the programs in the same bucket require teams of the same size. That is, we have buckets where and . For each bucket with , it holds that for all ; and , that characterise and respectively, for any . Next, we will distinguish three cases when counting the number of feasible teams in :

Case I : , we have exactly as many students as required by all programs in . In this case, we seek for partition functions over . The space of is according to Theorem 3.4.19 in Maddox:2002:isb0124649769.

Case II : , we have more students than the required ones by all programs in . Following the Example 3.4.20 in Maddox:2002:isb0124649769, we assume one more bucket containing exactly one auxiliary program, which requires a team of size . Now there are different feasible team assignment functions.

Case III: , we have less students than the required ones by all programs in . In this case, first we need to introduce as the set that contains all the subsets of programs such that leads to Case I or Case II, and by adding any in it will lead to Case III. The number of feasible team assignment functions is:
where variables and changes according to . The size of set depends on the total number of students, and the team sizes required by the programs in .
Note that the number of feasible team assignment functions quickly grows with the number of programs and students, hence leading to very large search spaces.
3. Solving The TAIPP as a linear program
In what follows we show how to solve the TAIPP in Definition 2.3 as an LP. First, for each time and program , we will consider a binary decision variable . The value of indicates whether team is assigned to program or not as part of the optimal solution of the TAIPP. Then, solving the TAIPP amounts to solving the following nonlinear program:
(8) 
subject to: equationparentequation
(9a)  
(9b)  
(9c) 
Constraint 9a ensures that a program is allocated a single team. Constraint 9b ensures that any two teams sharing some student cannot be assigned to programs at the same time. Notice that the objective function (see Eq 8) is nonlinear. Nevertheless, it is easy to linearise it by maximising the logarithm of . Thus, solving the nonlinear program above is equivalent to solving the following binary linear program:
(10) 
subject to: equations 9a, 9b, and 9c. Therefore, we can solve this LP and solve with the aid of an offtheshelf LP solver such as, for example, CPLEX, Gurobi, or GLPK. If given sufficient time, an LP solver will return an optimal solution to the TAIPP.
At this point, it is worth mentioning that computing the objective function in 10 to build the LP requires the precomputation of the values of , which amounts to solving an optimisation problem per each pair of team and program. This is bound to lead to large linear programs as the number of students and programs grow. Furthermore, an LP solver is a generalpurpose solver that does not exploit the structure of the problem. Thus, in the next section we introduce the TAIP algorithm, an anytime algorithm based on local search that yields approximate solutions to the TAIPP. Unlike an LP solver, TAIPP is a specialised algorithm does exploit the structure of TAIPP instances. Section 5 will show that TAIPP manages to outperform a generalpurpose LP solver.
4. A heuristic algorithm for TAIPP
The TAIP algorithm consists of two stages: (a) finding an initial feasible allocation of students to programs, and (b) continuously improving the best allocation at hand by means of swaps between team members.
4.1. Initial team allocation
During this stage the algorithm finds an initial feasible team allocation. The algorithm sequentially picks a team for each program, starting from the ‘hardest’ program to the ‘simplest’ one. Intuitively, ‘hard’ programs are more selective, i.e., there are a few students that can cover it; as such, picking teams for the harder programs first is easier as we have more options (students) available. In order to evaluate the hardness of a program we will be using the notion of fuzzy entropy.
To begin with, we first evaluate the required competences from all programs, as to how hard is for the students to cover them. Looking at the competence coverage metric, we can view it as a membership function ZADEH1965338, i.e., a function that indicates in what degree a competence lies in a set of competences. Thus, fuzzy entropy DELUCA197455; 1008855 indicates the difficulty of finding students to cover a competence. However we need to discern two extreme cases:

all students possess competence , i.e. ;

no student can cover competence , i.e. .
Although, the above two cases result with the same fuzzy entropy (), their intuitive interpretation is exactly the opposite. In the former case, finding a student for covering this competence within a team it is trivial since everyone can cover it. In the latter case, finding a student for covering this competence within a team it is trivial since noone can cover it. Thus, in our definition of competence hardness we exploit the notion of fuzzy entropy, but we also embrace the intuitive interpretations above. Formally:
Definition (Competence Hardness).
Given a set of students , the hardness of a competence is defined as
(11) 
where is a normalization factor,
,
and .
The hardness of a competence coincides with its fuzzy entropy when for all students the competence coverage is greater than . If for all students the competence coverage is less than the competence hardness is the constant minus the fuzzy entropy. The constant derives from the fuzzy entropy of point : coverage indicates that all students are neither good nor bad for this competence, as such hardness in point shall be the median, thus the maximum of the competence hardness is . Graphically, the competence hardness is shown in Fig 1.
The degree of hardness of a program is determined by the available set of students’ difficulty for covering the program’s competencies. We remind the reader that each required competence is accompanied by an importance weight (Sec 2.1). Thus, consider a program where its most important competence (i.e., the competence with the highest ) is very difficult to be covered , then this program is extremely hard. On the other hand, if a specific competence is somewhat difficult to be covered (), but it is not very important (), then the program is not that hard.
Definition (Program Hardness).
Given a set of students, the hardness of a program is defined as the aggregation of the hardness for the competences in the program weighted by the importance of each competence: , where is a normalization factor, and is a small positive constant.
In words, the more important and the more difficult a competence is to be covered, the more difficult is to find students with high competence proximity for the program, consequently the harder the program is considered to be. Note that both and are nonnegative, so the hardness of one competence cannot be counteracted by the nonhardness of another within the same program.
4.2. Improving team allocation
In the second stage we perform a number of random ‘movements’, until convergence to a local or global maximum. The second stage starts with the team assignment produced in the first stage. Thereafter, we iteratively improve the current team assignment either (i) by employing crossovers of students between two programs, and/or (ii) by swapping assigned students with available ones if they exist. Specifically, following Algorithm 2 within an iteration we randomly pick two programs (line 2) and attempt to improve the competence proximity of the pair by exhaustively searching of all possible crossovers of the students assigned to these programs (line 2). However, in order not to computationally overload our algorithm with repetitive exhaustive searches, we perform it only if the following two conditions hold:

the two programs share similar competencies; and

sine student in one of the teams improves the coverage of some competence of the other team.
In order to evaluate if two programs share similar competencies we exploit the Hausdorff distance conci2018distance. The Hausdorff distance between the required competencies of two programs and is defined as:
The above two conditions encode the potentiality of finding an improvement for these two programs, and whether it is worth performimg an exhaustive search. In the exhaustive search, given the students we produce all possible partitions that contain two teams of sizes and . For each of these partitions we compute the competence proximity of the pair of programs, and yield with the optimum one, i.e., with the partition that achieves the greater competence proximity.
In case we did not achieved any improvements from the previous step and there are available students, i.e. student that have not been assigned to any program, we attempt to swap assigned students with available ones (line 2). That is, we randomly pick a student from either of the two programs, and try to randomly swap them with a student in . If we achieve an improvement we keep this alteration, otherwise we repeat this process for a fixed number of attempts. In case we succeeded to imporove the competence proximity of the pair, we update the team assignement , the set of availble students , and the current overall competence proximity (lines 22).
In order to overcome the possibility of a series of unsuccessful attempts between random programs, we force a more ‘systematic’ search, which we call local search, on the programs. This local search is performed after a constant number of iterations (line 2). In the local search (line 2) we go through all programs in , swap all members, and check whether some swap improves the overall competence proximity–in the swaps we consider all students: both assigned and available.
Note that Algorithm 2 is anytime algorithm that can yield a result after any number of iterations indicated by the user. However, in its generality, we adopt a notion of convergence in order to terminate the algorithm. That is, we terminate the algorithm (line 2):

after a number of iterations without no improvements; or

if we reach an overall competence proximity close to .
Note that we added the latter termination condition in order to avoid unnecessary iterations until convergence, due to the fact that the maximum value the overall competence proximity can reach is . We remind the reader that the competence proximity is the Nash product of the individual competence proximity of the teams to their assigned program (Eq 8), and each individual competence proximity lies in (Def 2.2). However, we should make clear that the overall competence proximity does not always reach , but that it can never exceed .
5. Empirical analysis
The purpose of this section is to empirically evaluate the TAIP algorithm along four directions:

the quality of the solutions that it produces in terms of optimality;

the quality of the solutions produced by the initial stage;

the time required by TAIP to produce optimal solutions with respect to CPLEX, an offtheshelf linear programming solver; and

the time required by TAIP to yield optimal solutions as the number of students and programs grow.
Overall, our results indicate that TAIP significantly outperforms CPLEX, and hence it is the algorithm of choice to solve the Team Allocation for Internship Programs Problem introduced in this paper. Next, in Sec 5.1 we describe the settings employed in our experiments, whereas Sec 5.2 dissects our results.
5.1. Empirical settings
For our experimental evaluation we used an existing competence ontology provided by Fondazione Bruno Kessler (https://www.fbk.eu/en/); and generated synthetic data in the following way:
Internship program generation
For each program

select the required team size

select the number of required competences

randomly choose competences from the ontology

the required level function is set to

the weight function is bounded in for all .
Student generation
For each program

generate new students such that for each student : there are competences and such that is (i) identical to ; or (ii) a childnode of in the ontology; uniformly selected among the options.
With these generators we constructed 60 different TAIPP instances, which are shown in Table 2. We solve each problem instance with both TAIP and the IBM CPlex linear programming (LP) solver. The experiments were performed on a PC with Intel Core i7 (8th Gen) CPU, 8 cores, and 8Gib RAM. Moreover, we employed IBM ILOG CPLEX V12.10.0. For all implementations we used Python3.7.
5.2. Results
Quality analysis. Using the optimal solutions yielded by CPLEX as an anchor, we can evaluate the quality of the solutions computed by the TAIP algorithm. Notice that for all problem instances, TAIP reaches the optimal solution. More precisely, for every problem instance, TAIP achieved a solution whose value, in terms of competence proximity, is the same as the value of the optimal solution computed by CPLEX. Fig 2 shows the average quality ratio of TAIPP with respect to CPLEX along time for the problem instances in Table 2. We calculate the quality ratio by dividing the competence proximity computed by TAIP by the optimal value computed by CPLEX, and it is depicted as a percentage (%).
Runtime analysis. The greatest advantage of TAIP is that it is way much faster than CPLEX. As shown in Fig 3 TAIP reaches optimality in less than half of the time required by CPLEX. Specifically, for problem instances with 10 programs, TAIP requires on average of the time CPLEX needs, i.e., is faster. As to problem instances with 15 programs, TAIP requires on average of the time employed by CPLEX ( faster). Finally, for problem instances with 20 programs, TAIP requires on average of the time spent by CPLEX ( faster). Therefore, the larger the size of the problem instances, the larger the benefits for TAIP with respect to CPLEX. Here we should note that the time consuming task for CPLEX is the building of the LP encoding the problem, while solving the actual problem is done in seconds. This indicates that the problem instances under investigation are rather large than hard: as the number of programs increases, so does the number of students, resulting in large linear programs.
Anytime analysis. Last but not least we present our results on the anytime behavior of TAIP, as shown in Fig 4. We observe that after completing the initial stage described in Sec 4.1, the solution quality produced by TAIP reaches 80%, 70%, and 65% of the optimal solution, for problem instances with 10,15 and 20 programs respectively. Furthermore, TAIP reaches quality 80% in for 10 programs, 70% in for 15 programs, and 65% in for 20 programs, where is the time CPLEX needs to compute the optimal solution. Moreover, in all investigated settings we reached 80% quality in less than 20% of the time CPLEX needs: 0.1%, 20%, and 13.5% of CPLEX time for 10,15, and 20 programs.
6. Conclusions and future work
Here we formally defined the problem of Team Allocation for Internship Programs Problem. We first studied the problem’s complexity and characterised its search space.Thereafter, we provided an encoding to otimally solve the TAIPP by means of linear programming. Then, we proposed a novel, heuristic anytime algorithm, TAIP. Finally, we conducted a systematic comparison of TAIP versus the CPLEX LP solver when solving TAIPP problem instances. Our experimental evaluation showed that TAIP outperforms CPLEX in time, mainly because of the extremely large input that the latter requires. Moreover, TAIP always managed to reach the optimal solution for the problem instances under investigation. Specifically TAIP converged to the optimal in less than 40% of the time required by CPLEX, and achieved a quality of 80% in less than 20% of the time required by CPLEX. As future work, we itend to device more intelligent strategies during the second state of TAIPP, instead of our current randomized strategy. Furthermore, in the future we will study the performance of TAIP on actualworld data.



Comments
There are no comments yet.