• No se han encontrado resultados

C APÍTULO 3 M ARCO C ONCEPTUAL SOBRE EL D UELO

3.4 Tipos de duelo

3.4.1 Duelo anticipado

A country in south-east Asia is experiencing widespread flooding. The government, with international help, decides to establish a system of supply by air. Unfortunately, only seven runways are still in a usable state, among which is the one in the capital.

The government decides to make the planes leave from the capital, have them visit all the other six airports and then come back to the capital. The following table lists the distances between the airports. Airport A1 is the one in the capital. In which order should the airports be visited to minimize the total distance covered?

Table 11.9:Distance matrix between airports (in km)

A2 A3 A4 A5 A6 A7 A1 786 549 657 331 559 250 A2 668 979 593 224 905 A3 316 607 472 467 A4 890 769 400 A5 386 559 A6 681

11.5.1

Model formulation

To model this problem, we denote by CITIES = {1, . . . , 7} the set of airports to be served and DISTij the distance between the airports Ai and Aj. Since the journey is carried out by plane, the distance matrix is symmetric. We use binary variables flyijthat take the value 1 if the plane flies from i to j. The tour we are looking for is a cycle that visits every airport once and once only. At every airport i, the cycle comes from a single predecessor and continues to a single successor airport. The constraints (11.5.1) and (11.5.2) express these conditions.

∀j ∈ CITIES : X i∈CITIES,i6=j flyij= 1 (11.5.1) ∀i ∈ CITIES : X j∈CITIES,i6=j flyij= 1 (11.5.2)

If we only use the constraints (11.5.1) and (11.5.2), the cycle may be fragmented into several sub-cycles, for instance going from airport 1 to airport 2 and from there back to 1. This sub-cycle satisfies these two constraints but does not lead to a valid solution. It is therefore necessary to prevent the forming of sub-cycles from occurring. This is the aim of the constraints (11.5.3): every sub-cycle that appears in a subset S of airports is ‘broken’ by requiring that the number of arcs in S must be strictly less than the cardinality of S.

If N is the number of cities, for even a relatively small N it is simply impossible to test all sub-cycles that may be formed (their number is in the order of 2N). To start with, we are therefore going to solve the problem without the constraints (11.5.3), which usually leads to a solution comprising sub-cycles, and then one by one add constraints that render the forming of the sub-cycles impossible. This procedure will be described in more detail in the next section.

∀S : X (i,j)∈S

flyij≤ |S| − 1 (11.5.3)

The objective function (11.5.4) is the total length of the cycle passing through all cities, that is the length of all arcs that are used.

minimize X i∈CITIES X j∈CITIES DISTij· flyij (11.5.4) ∀j ∈ CITIES : X i∈CITIES,i6=j flyij= 1 (11.5.5) ∀i ∈ CITIES : X j∈CITIES,i6=j flyij= 1 (11.5.6)

∀S : X (i,j)∈S

flyij≤ |S| − 1 (11.5.7)

∀i, j ∈ CITIES : flyij∈ {0, 1} (11.5.8)

11.5.2

Implementation and results

The following Mosel program corresponds to the mathematical model without the constraints (11.5.3). Since the distance matrix is symmetric, the data file only contains the upper triangle (distance from i to j for which i < j); the other half is completed after reading in the data.

model "F-5 Tour planning" uses "mmxprs"

declarations NCITIES = 7

CITIES = 1..NCITIES ! Cities

DIST: array(CITIES,CITIES) of integer ! Distance between cities

NEXTC: array(CITIES) of integer ! Next city after i in the solution fly: array(CITIES,CITIES) of mpvar ! 1 if flight from i to j

end-declarations

initializations from ’f5tour.dat’ DIST

end-initializations

forall(i,j in CITIES | i<j) DIST(j,i):=DIST(i,j) ! Objective: total distance

TotalDist:= sum(i,j in CITIES | i<>j) DIST(i,j)*fly(i,j) ! Visit every city once

forall(i in CITIES) sum(j in CITIES | i<>j) fly(i,j) = 1 forall(j in CITIES) sum(i in CITIES | i<>j) fly(i,j) = 1 forall(i,j in CITIES | i<>j) fly(i,j) is_binary

! Solve the problem minimize(TotalDist) end-model

The solution to this problem is represented in Figure11.3. It contains three subcycles that we need to exclude. The strategy to adopt suppresses one sub-cycle at a time, starting with the smallest one. We have implemented the following procedure break_subtourthat is added to the Mosel program above and called after the solution of the initial problem. The procedure first saves the successor of every city into the arrayNEXTC. It then calculates the set of cities that are on the tour starting from city 1: if the size of the set corresponds to the total number of citiesNCITIES, we have found the optimal solution and the algorithm stops, otherwise there are subtours.

The algorithm then enumerates all subtours to find the smallest one: if a subtour with two cities is found we can stop (there are no subtours of length 1), otherwise the tour starting from the next city that has not yet been enumerated as part of a tour (setALLCITIES) is calculated. When the smallest subtour has been found, we add a constraint of type (11.5.3) for this set and re-solve the problem.

procedure break_subtour declarations

TOUR,SMALLEST,ALLCITIES: set of integer end-declarations

forall(i in CITIES)

NEXTC(i):= integer(round(getsol(sum(j in CITIES) j*fly(i,j) ))) ! Get (sub)tour containing city 1

TOUR:={} first:=1 repeat

A4 A3 A6 A5 A1 A7 A2

Figure 11.3:Initial solution with three sub-cycles

TOUR+={first} first:=NEXTC(first) until first=1

size:=getsize(TOUR) ! Find smallest subtour

if size < NCITIES then SMALLEST:=TOUR if size>2 then

ALLCITIES:=TOUR forall(i in CITIES) do

if(i not in ALLCITIES) then TOUR:={} first:=i repeat TOUR+={first} first:=NEXTC(first) until first=i ALLCITIES+=TOUR if getsize(TOUR)<size then SMALLEST:=TOUR size:=getsize(SMALLEST) end-if if size=2 then break end-if end-if end-do end-if

! Add a subtour breaking constraint

sum(i in SMALLEST) fly(i,NEXTC(i)) <= getsize(SMALLEST) - 1 ! Re-solve the problem

minimize(TotalDist)

! New round of subtour elimination break_subtour

end-if end-procedure

During its first execution the subtour elimination procedure adds the following constraint to the model to eliminate the subtour (2,6,2):

fly(2,6) + fly(6,2) <= 1

With this additional constraint we obtain the solution represented in the following figure: it still consists of three (different) subtours.

A4 A3 A6 A5 A1 A7 A2

Figure 11.4: Second solution

When the subtour elimination procedure is called again, it adds a constraint to exclude the subcycle (1,7,1):

fly(1,7) + fly(7,1) <= 1

After this second execution, we finally obtain a single tour with a total length of 2575 km. The arcs that are directed in the model may be replaced by undirected arcs (edges) without any consequence for the solution since the distance matrix is symmetric.

A4 A3 A6 A5 A1 A7 A2

Figure 11.5:Optimal solution

The Mosel implementation of the subtour elimination procedure uses a certain number of set operators and other functionality related to sets: the functiongetsizereturns the size (= number of elements) of a set or array.{}denotes the empty set. A set may be assigned using the usual assignment operator:=,

11.6

References and further material

The problem of flight connections in Section11.1is a classical assignment problem. This problem is well solved by the Hungarian algorithm described, for instance, by Papadimitriou [PS98] or by techniques searching for the maximum flow in a transport network [Pri94a].

The composition of flight crews in Section11.2is a problem of matching in an arbitrary graph whilst the assignment of personnel to workposts in Chapter14is a matching problem in a bipartite graph: the edges connect nodes of two types, the persons and the workposts. The matrix of the linear program is totally unimodular in the bipartite case, which means that the variables automatically take the values 0 or 1 at the optimum. In the non-bipartite case of the flight crew, the simplex algorithm may find solutions with variables at 0.5 in the optimum. The problems of maximum cardinality or maximum weight matching in an arbitrary graph (bipartite or not) are all polynomial. An algorithm in O(n3) (with n the number of nodes) with a Fortran code is given in Minoux et al. [MB86]. A simpler algorithm for maximum cardinality matching, but still of complexity O(n3) is given by Syslo [SDK83] with a Pascal source code.

The problem of scheduling flight landings in Section11.3represents a class of scheduling problems with time windows and distance constraints between tasks. It has been studied by Beasley et al. [BKSA00] for the case of multiple runways. The authors describe a specialized tree search method for large size instances. They are able to solve realistic instances with 50 planes and four runways to optimality. Beasley has also published an interesting article [BC96] concerning crew scheduling. Based on a set of flights with given dates and durations this problem consists of defining the sequence of flights for the crews in order to cover all the flights but without exceeding a limited duration of work.

With the formulation presented in Section11.4for the hub location problem, the number of variables used may be very large. If it is possible to transform any city into a hub, the number of the variables

flowijkl is in the order of O(n4) (with n the number of cities). And hence, a problem with just over thirty cities would require a million variables. In Daskin [Das95] and Campbell [Cam96] several heuristics for this type of problem are given.

The problem in Section11.5is the famous Traveling Salesman Problem (TSP). It consists of organizing a tour that visits every node of a graph once and only once, whilst minimizing the total cost of the arcs used on the tour. The flight tour planning problem presented here is symmetrical because the cost matrix is a symmetrical distance matrix. The paint production problem in Chapter7is an asymmetrical TSP. It is solved via a direct formulation, that is, without progressively adding constraints. The TSP is such a well known NP-hard problem problem that it is used for testing new optimization techniques. The CD that comes with the book contains a data file with a distance matrix for several French cities and a slightly modified version of the Mosel program of Section11.5, adapted to the structure of this file.

The TSP is so hard that the MIP models of this book take a very long time to solve for more than twenty cities. Beyond this number, it becomes necessary to use specialized tree search methods [HK70]. Ped- agogical examples of such methods are given by Roseaux [Ros85] and Evans [EM92], and a Pascal code is given by Syslo [SDK83]. Certain Euclidean problems with hundreds of cities can be dealt with by the method called Branch and Cut [GH91]. Otherwise, one has to give up trying to find optimal solutions and use heuristic techniques, some of which, like tabu search or simulated annealing, are very efficient in practice. Such heuristics are described in detail with listings of Pascal code in the book about graphs by Prins [Pri94a].

Chapter 12

Telecommunication problems

In recent years, the domain of telecommunications has experienced an explosive growth. It is extraor- dinarily rich in original optimization problems, which explains the fact that this book devotes an entire chapter to this topic. The short term exploitation of telecom networks are problems of on-line control and problems tackled by the theory of telecommunication protocols. But design problems, the sizing or location of resources, and planning are well suited to optimization approaches. These are therefore described here.

The design of a network needs to satisfy the traffic forecasts between nodes, minimize the construction costs and fulfill conditions on its reliability. It starts with the choice of the location of nodes. Section12.6

deals with a mobile phone network in which transmitters need to be placed to cover the largest possible part of the population within given budget limits. Once the nodes are chosen, one needs to select the pairs of nodes that will be connected with direct lines for the transmission of data. In Section12.4, a cable network with a tree structure is constructed with the objective of minimizing the total cost. The problem in Section12.2studies the connection of cells to a main ring in a mobile phone network with capacity constraints. Reliability considerations demand multiple connections between every cell and the ring.

Other optimization problems arise in the analysis and the exploitation of existing networks. A natural question dealt with in the problem of Section12.3is to know the maximum traffic that a network with known capacity limits may support. The problem in Section12.1concerns the reliability of the data ex- change between two nodes of a given network. This reliability is measured by the number k of disjoint paths (that is, paths without any intermediate node in common) between two nodes. If k > 1, then com- munication is still possible even if k − 1 nodes break down. The problem in Section12.5is an example of traffic planning: the data packets in the repeater of a telecommunications satellite need to be scheduled.