• No se han encontrado resultados

Capítulo 4. Herramienta de ayuda al diseño

4.1 Objetivo y especificaciones

The first issue that we encountered in the design of an exact algorithm for this real world problem is the evaluation of the maximal area. In fact, it is not trivial to compute the area of a figure obtained by overlapping circles, as the number of the circles considered increases. There are some deterministic numerical methods which allow to solve this task with a good accuracy (see [9]). The method we adopted is a scan-line method [9]: it is able to solve problems with thousands of circles within several seconds. The first step of the algorithm is the computation of the maximal area Amax that the concentrators can cover. We did this by using a procedure that takes as an input the projected coordinates (xc, yc) of each concentrator c ∈ N, and gives as an output the value of the area covered by them. This function is indicated with DOUBLE AREA(SET OF CONCENTRATORS).

One simple property of the problem gives us the chance to reduce the size of the instances. In fact, a concentrator is necessarily put in the optimal solution if it is able to cover at least one point that is not covered by any other concentrator. We indicate the set of such concentrators as Nnecessary. How can we select such concentrators in an efficient way? The answer is relatively simple, we are going to use the AREA function. We scan the set of the concentrators N in an arbitrary order and we evaluate the value provided by the call AREA(N/ c) for each concentrator c ∈ N. If the value obtained is less than Amax, then the concentrator c covers a portion of the area which is not covered by any other concentrator in N. In this step, all the variables associated with the concentrators included in Nnecessaryare set to 1 without loss of optimality. Since the concentrators are scanned one by one, this operation can be performed in O(n). Note that we already have an initial lower bound to the optimal solution, given by the sum of the weights of the concentrators in Nnecessary. The computation of the necessary concentrators is done by the function SET OF CONCENTRATORS GET_NECESSARY(SET OF CONCENTRATORS). Generally speaking, it takes as an input a set of concentrators and it provides only the necessary ones to cover the whole area as an output.

Hence, we start a loop, where a set of λ points is generated at each iteration. These points are generated via simulation by means of a routine SET OF POINTS NEW_POINTS(SET OF CONCENTRATORS, SET OF CONCENTRATORS, INT). This routine

receives as an input two set of concentrators and the number of points to be gener- ated. It provides as an output a set of λ points that are covered by the first set of concentrators, but not by the second one. We define the set P as the set formed by all the points generated at the current iteration. We indicate with Ncurrent the set of concentrators which are currently selected, while Acurrent is the value of the area covered by concentrators in Ncurrent.

The points are generated in the area which is not covered by any concentrator in Ncurrent, in order to add as a constraint the coverage of points in A that were not cov- ered at the previous iterations. At this point, we solve the Weighted Set Cover model

6.4 -6.6 by setting A = P and fixing all the variables associated with the necessary concentrators to 1. The model can be solved by means of any ILP solver, this is performed in function FLOAT SOLVE_SET_COVER(SET OF CONCENTRATORS, SET OF CONCENTRATORS, SET OF POINTS). The inputs are the set of necessary concentra- tors, the set of the concentrators to use and the numbers of points to cover. The output is a floating point value which represents a lower bound for the original problem. A drawback in the use of the ILP model is that the time required for the solution can be too long if the number of variables and constraints of the model is too high. For this reason, we set a time limit to the solver and thus we may not solve model 6.4 - 6.6 to optimality. However, the solver will provide a feasible solution and a lower bound for model6.4 -6.6. The lower bound obtained in this way is also a lower bound for the original problem represented by formulation6.1 -6.3. On the contrary, the solution provided may not be feasible for the original problem and we need to modify it to make it feasible.

This goal can be reached by using different type of heuristics. Our purpose is “to fill the holes" in the overall area by using the minimal number of concentrators, so we keep all the concentrators in Ncurrent and we try to add new concentrators in order to achieve the maximal area as soon as possible. Here it is important to note that local search strategies can hardly be applied to search for better solutions. In fact, the computational cost due to the evaluation of the area is too high if we need O(n2)

computations. For this reason, we had to design a basic constructive heuristic that is able to obtain in O(n) a feasible solution. We adopted a greedy approach where at each iteration, only the concentrators which allow an increase of the coverage greater than or equal to a specific threshold, are added. This threshold is halved after each

iteration and the procedure ends as soon as the maximal coverage is achieved. This heuristic is implemented in the function SET OF CONCENTRATORS COMPUTE_UB(SET OF CONCENTRATORS, SET OF CONCENTRATORS) which takes as an input the initial set of concentrators and the set of concentrators which are currently fixed. It gives as an output the set of concentrators which determines a feasible solution covering all the area. Figure6.1 depicts the flowchart of the procedure.

Figure 6.1: Flowchart of the procedure COMPUTE_UB

The same heuristic can be applied to determine solutions that reach a partial coverage of the overall area. The only step that we need to change in the heuristic is the stopping criterion. In fact, we can stop adding new concentrators when a specific amount of area, for example a percentage of the maximal area Amax, is covered.

The function used to obtain partial coverage solutions is SETS OF CONCENTRATORS COMPUTE_PARTIAL_SOLUTIONS(SET OF CONCENTRATOR, SET OF CONCENTRATOR, VECTOR OF DOUBLE). Its inputs are the set of concentrators that we can use, the set of selected concentrators and a vector which represents the area values that we aim to cover. The output is formed by a sequence of concentrator sets, each set represents a solution which covers one of the input area values.

The algorithm keeps generating points and solving Set Covering Problems of increasing size. The termination criteria are two: we stop the algorithm when we find a solution which is optimal with tolerance up to  or when an overall time limit is reached. The pseudo-code of the algorithm is depicted in Algorithm 16, where all the functions defined above are used in order to clarify the structure of this approach.

Algorithm 16 Exact algorithm for the Multi-meter Covering Problem

Input: A set N of concentrators

Amax ← AREA(N )

Nnecessary ← GET_NECESSARY_CONCENTRATORS(N ) P ← ∅

Ncurrent ← ∅

while Amax− Acurrent <  anda time limit is not reached do P ← P ∪ NEW_POINTS(N ,Ncurrent, λ)

Ncurrent← SOLVE_SET_COVER(Nnecessary, N , P ) COMPUTE_UB(N , Ncurrent)

COMPUTE_PARTIAL_SOLUTIONS(N , Ncurrent, coverage values ) Acurrent ← AREA(Ncurrent)

end while

Output: The best upper/lower bounds, partial solutions

Documento similar