7 algorithm of the branch and bound method Tasks that are reduced to integer ones. Tasks about indivisibility. The task of a traveling salesman. The problem of the distribution of investments.

Lecture



We formulate an algorithm for the branch and bound method. Suppose that the maximization problem is solved. Let us set the lower limit of the optimal value of the objective function z of the CPU problem equal to - 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. Put i = 0.

Step 1. (Probing and determining the boundary.) Select the i-th subtask of linear programming LPi for the study. Solve LPi and probe it, and one of three situations is possible:

a) The optimal value of the objective function of the LPi problem cannot improve the current lower bound.

b) LPi leads to a better valid integer solution than the current lower bound

c) LPi has no valid solutions.

Two options are possible:

a) If the LPi task is probed, the lower bound will change only if the best value of the CPU problem is found. If all subtasks are probed, it is necessary to finish the calculations: the optimal solution to the CPU problem is the one that corresponds to the current lower boundary, if one exists. Otherwise, put i = i + 1 and repeat Step 1.

b) If the LPi task is not probed, proceed to Step 2 to complete branching.

Step 2. (Branching) Select one of the integer variables x j , the optimal value x j * in the optimal solution of the LPi problem is not an integer. We exclude from the space of feasible solutions [x j *] j * <[x j *] + 1 by forming two LP subtasks that correspond to the constraints x j 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. [x j *] and x j 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. [x j *] + 1 ..

Set i = i + 1 and go to Step 1.

To solve the minimization problem in the algorithm, it is necessary to replace the lower boundary of the upper one (whose initial value is equal to 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. ).

Tasks that are integer.

Tasks about indivisibility.

1. Coverage problems of the set .

An example of a set covering problem is the problem of placing warehouses, in which the distance from the warehouse to each consumer does not exceed 100 km. Another example is the determination of the number and location of student dormitories, in which a student spends no more than 1 hour on the way to the university, the task of placing fire brigades, in which the distance to any point in the city is covered in 5 minutes.

The problem of covering a set can be formulated as follows:

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

under restrictions:

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

The quantities a ij are called coverage coefficients. They take values ​​equal to one if the consumer is within the j-th area (covered by the j-th area), and is equal to zero otherwise. Similarly, x j takes a value equal to one if an object is located in the j-th region and is equal to zero otherwise. Task constraints require that each of m consumers be “covered” with at least one of the n objects. The goal in this case is to “cover” consumers with minimal costs, with c j being the cost of placing an object in the j-th area. Since the task is integer, any method for solving CPU problems can be applied to it.

Example. The University establishes a helpline on the campus. It is advisable to set the minimum number of telephones so that at least one telephone is located on each of the streets of the town.

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

It is logical to arrange the phones at the intersections of the streets so that each telephone can serve at least two streets. The figure shows that this location requires no more than 8 phones.

Let the variable x j be 1 if the phone is located at j (j = 1..8) and 0 otherwise. The task requires placing at least one telephone on each of the 11 streets (from A to K). Therefore, the task is formed as follows: z = x 1 + x 2 + x 3 + x 4 + x 5 + x 6 + x 7 + x 8 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. min,

x 1 + x 2 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (A)

x 2 + x 3 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (B)

x 4 + x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (C)

x 7 + x 8 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (D)

x 6 + x 7 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (E)

x 2 + x 6 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (F)

x 1 + x 6 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (G)

x 4 + x 7 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (H)

x 2 + x 4 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (i)

x 5 + x 8 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (J)

x 3 + x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 1 (K)

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

As you can see, all model variables are binary. In this case, aij = 1 for all j. In general, they may be different. The task belongs to the combinatorial class.

The task of a traveling salesman.

In 1831 a book was published in Germany called “Who is a traveling salesman and what should he do for his prosperity?”. One of the recommendations of the book said: “It is important to visit as many places of possible sale as possible, without visiting any of them twice.” Apparently, this was the first formulation of the traveling salesman problem.

There are n cities. The distances between any pair of cities are known and constitute a ij (i, j = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. , i j). If there is no direct route between cities i and j, aa ij = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. . Distances between cities are conveniently written in the form of a matrix A = (a ij ) n 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. n , where a ij = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. .

j

i

one

2

...

n

one

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

a 12

...

a 1n

2

a 21

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

...

a 2n

...

...

...

...

...

n

a n1

a n2

...

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

In the general case, the matrix is ​​asymmetric.

When traveling from the source city, the traveling agent must visit each of the cities only once and return to the source city. It is necessary to determine the sequence of detour cities so that the length of the route was minimal.

If the task is defined in terms of graph theory, the cities correspond to the vertices of the graph, and the roads correspond to the arcs. The task is to determine the Hamiltonian contour of the minimum length. A Hamiltonian contour is a path that passes through all the vertices of the graph whose initial vertex coincides with the final one. Under the length of the contour understand the sum of the lengths of the arcs.

We define boolean variables as follows:

1, if a traveling salesman moves from city i to city j (i, j = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. )

x ij = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

0 otherwise.

Then the task is to describe the variables x ij :

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. (one)

with restrictions:

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. (entrance to the city j) (2)

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. (leaving town i) (3)

7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. (four)

In principle, the variables u i , i = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. can take arbitrary values, but without any damage they can be imposed condition of negativity and integerness.

Conditions a ij = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. in the optimal solution, the values ​​x ij = 1 are excluded, as having no meaning. Restrictions (2) require that the route include only one entrance to each city, and (3) - only one exit from each city. The objective function (1) is the length of the Hamiltonian contour.

The solution of the problem described only by conditions (1) - (3) is not necessarily a contour passing through all cities. In particular, by solving (1) - (3) two or more disconnected contours can be obtained. To eliminate the possibility of the formation of non-Hamiltonian circuits are limitations (4). We show that they really exclude all partial contours and do not exclude any Hamiltonian contours.

Consider a partial contour passing through the kth city (k ij = 1 for k variables. Adding all inequalities of the form (4) containing k variables x ij = 1, we obtain the inequality 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. which is unacceptable (differences u i -u j mutually destroyed). Consequently, (4) excludes the possibility of the formation of any partial contour.

Now we establish that there exist values ​​of the variables u i that satisfy constraints (4) for any Hamiltonian contour. Suppose that u i = p (p = 1,2, ... n), if the city i in the Hamiltonian circuit is visited in the order of Pm, and u 1 = 1 and u j = u i +1, j = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. ; j is the number of the city in the Hamiltonian circuit. So, for example, in the circuit 1-3-6-8- ... the values ​​of u i will be as follows: u 1 = 1, u 3 = 2, u 6 = 3, u 8 = 4, ... From this assumption it follows that for x ij = 0 the corresponding inequality (4) takes the form u i -u j n-1 and is always satisfied, since u i j > 1 with j1. When x ij = 1, these constraints are satisfied as equalities: u i + u j + nx ij = p- (p + 1) + n = n-1.

Thus it is proved that for any Hamiltonian contour there exist values ​​of the variables u i that satisfy the constraints (4).

When solving a traveling salesman problem, brute force requires (n-1)! options. Already with the number of cities 16-20, the time to solve the problem increases to astronomical numbers. Therefore, the task of a traveling salesman is solved by ILP methods.

The task of the traveling salesman is reduced to the problem of optimal use of vehicles (milk tanker, tanker).

The problem of the distribution of investments.

Five options are evaluated in terms of the possibility of financing them for the next 3 years. The table contains the expected profit from the implementation of each project and the distribution of investments by years.

Project

Costs (million UAH)

Profit (mln.)

1st year

2nd year

3rd year

one

five

one

eight

20

2

four

7

ten

40

3

3

9

2

20

four

7

four

one

15

five

eight

6

ten

thirty

Available capital

25

25

25

It is necessary to determine the set of projects, which corresponds to the maximum total profit. The task is reduced to “yes - no” solutions for each project, that is, binary variables

1 if project j is approved

x j = 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments.

0 if project j is not approved

The CPP’s task is as follows:

z = 20x 1 + 40x 2 + 20x 3 + 15x 4 + 30x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. max

5x 1 + 4x 2 + 3x 3 + 7x 4 + 8x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 25

x 1 + 7x 2 + 9x 3 + 4x 4 + 6x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 25

8x 1 + 10x 2 + 2x 3 + x 4 + 10x 5 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. 25

x 1 x 2 x 3 x 4 7 algorithm of the branch and bound method Tasks that are reduced to integer ones.  Tasks about indivisibility.  The task of a traveling salesman.  The problem of the distribution of investments. {0,1}.


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Mathematical methods of research operations. The theory of games and schedules.

Terms: Mathematical methods of research operations. The theory of games and schedules.