• No se han encontrado resultados

AUTORIDAD REGULADORA DE LOS SERVICIOS PÚBLICOS

In this subsection we present heuristics for max spa-pl (given the NP-hardness of the problem). As stated above, in a given matching, each project must either meet its lower quota (be open) or have no student matched to it (be closed ). We have shown above that the problem is NP-hard to solve or approximate. To deal with this hardness we can relax the requirement that the matching must be maximum in order to produce heuristics that find “good” matchings both in terms of size and profile. Although the final matchings obtained need not be optimal with respect to size, we seek to find matchings that are as large as possible and subject to that, we seek to optimise these matchings with respect to some profile-based optimality criterion.

Let I be a max spa-pl instance. Also let I0 be the underlying spa instance (i.e. without considering lower quotas) and let M be a matching in I0. Since M may not be a feasible matching in I, we define P0(M ) = {pj : M (pj) < c−j(I)} to be the set of

violating projects that do not meet their lower quotas in M with respect to I. Projects in P0(M ) can potentially receive more students in order to meet their lower quotas and become open, or they can give up their assigned students and become closed. Let N = N (I0) be the network derived from I0. Then f = f (M ) is a flow in N . A violating project pj ∈ P0(M ) can be closed by setting f (si, pj) = c(si, pj) = 0 for

all students si such that pj ∈ Ai, setting f (vs, si) = 0 for all students si ∈ M (pj),

setting f (pj, lk) = c(pj, lk) = 0 and setting f (lk, vt) = f (lk, vt) − |M (pj)| where lecturer

lk= l(pj). The resulting flow is thus reduced by |M (pj)|. A previously closed project pj

can be reactivated by setting the capacities of its incident edges to their original values in N . Thus c(si, pj) = 1 for all students si such that pj ∈ Ai and c(pj, lk) = c+j (I)

where lk = l(pj).

The heuristics presented in Sections 7.3.3.2 and 7.3.3.3 involve steps in which projects may be closed or reactivated. Both heuristics start by finding a profile-based optimal matching M in I0 that admits a set of violating projects P0(M ) in I. Violating projects are then handled serially by either assigning more students to them or closing them. Both heuristics handle projects in P0(M ) in different ways in order to arrive at a valid matching in I (one in which all projects are either open or closed). In the following

7.3. Project lower quotas 146

Algorithm 7.3 Heuristic-cps Require: spa-pl instance I; Ensure: return matching M ;

1: Generate I0 from I by dropping project lower quotas;

2: N := N (I0); 3: loop 4: M := Greedy-max-spa(I0); 5: P0(M ) := {p j : |M (pj)|< c−j(I)}; 6: if |P0(M )|> 0 then

7: close some project pj ∈ P0(M ) in N ;

8: else

9: return M ;

sections we present both heuristics and in Section 7.5.4 we show results obtained from evaluating them empirically.

7.3.3.2 Close projects serially (Heuristic-cps)

In this heuristic, violating projects are handled by closing them one after the other (in a serial manner). After each project is closed, the augmenting path algorithm (say Greedy-max-spa) is re-executed on the resulting instance. This process continues until there are no violating projects remaining.

Given a max spa-pl instance I, we start by forming I0 (i.e., relaxing the project lower quotas). We then find a greedy maximum matching M in I0 by calling the Greedy-max-spa algorithm. Next we consider all the projects in P0(M ) and begin to close them one after the other. After each project in P0(M ) is closed, we re-execute the Greedy-max-spa algorithm on the resulting instance. Although this may cause other projects that were previously open to violate their lower quotas (thus adding to P0(M )), it is expected that a greater number of violating projects will gain enough

students to become open. Once a project is closed it is not reactivated and will remain closed in the final matching obtained. The process continues until P0(M ) is empty (it must terminate because every time the main loop iterates, either we return a matching or we close exactly one project). Algorithm 7.3 describes the entire process.

Although projects are closed randomly in Algorithm 7.3, the order may affect the size of the final matching obtained. There are various ways of ordering the violating projects to be closed. One approach is to order violating projects based on the number of extra students required for them to achieve their lower quotas (i.e., c−j − |M (pj)|)).

The higher the number of extra students required, the earlier the project is closed. This will allow projects with a greater potential of achieving their lower quotas to have more opportunities to do so. Another idea is to close projects that are less popular

7.3. Project lower quotas 147

as they are less likely to improve (and become open) during the process. If the most popular projects are given more opportunities (i.e., are not closed early on) they have a better chance of achieving their lower quotas. Finally we may order the violating projects based on the number of students they have assigned to them at that time (i.e., |M (pj)| for project pj). The idea is that projects with a large number of students

assigned to them will contribute more to the final matching than those with a smaller number of assigned students and so should not be closed early on. These orderings can be evaluated empirically in order to determine how well they perform in practice. Since no previously closed projects are reactivated and the number of projects is finite, the algorithm is bound to terminate. In the worst case, all of the n2 projects will need

to be closed thus leading to a time complexity of O(n21n2Rm2).

7.3.3.3 Open projects serially (Heuristic-ops)

In this heuristic all violating projects are initially closed. They are then reactivated one after the other (in a serial manner). Given a max spa-pl instance I, as in the case of Heuristic-cps, we start by finding I0(i.e. relaxing the project lower quotas). We then find a greedy maximum matching M in I0 by calling the Greedy-max-spa algorithm. Next, we close all the projects in P0(M ) and begin to reactivate them one after the other. After each project in P0(M ) is reactivated, we re-execute the Greedy-max-spa algorithm on the resulting instance. Although this may cause other projects that were previously open to violate their lower quotas (as P0(M ) can change at each iteration with some projects leaving and others arriving), once again, it is expected that a greater number of violating projects will gain enough students to become open (i.e. leave P0(M )). Each project can only be reactivated once. If a previously reactivated project remains or becomes a violating project, it is permanently closed and will remain closed in the resulting matching. Algorithm 7.4 details the entire process.

Once again the order in which projects are reactivated may affect the size of the final matching obtained. As suggested in the Heuristic-cps case, we may choose to reactivate popular projects first or projects needing the fewest number of extra students to meet their lower quotas. We may also choose to reactivate projects with a larger number of assigned students first. The algorithm is bound to terminate (as we reactivate a project at most once) and has a time complexity of O(n2

7.4. Extending the spa IP model 148

Documento similar