How to solve a problem about appointments

How to solve a problem about appointments

The task about appointments is a special case of a transport task in which number of points of production and destinations equally. In this case the matrix of the transport table will have square shape. It is natural that for each destination the volume of requirement will be equal 1, and for each point of production the offer size will also be equal to 1. To solve a problem about appointments, use the Hungarian method.

Instruction

1. Solve a problem about appointments similar to any transport task and formalize it in the form of the transport table in which lines appointments are reflected, and in columns – distances to consumers. Find the minimum value in each column of the table and subtract it from each element of this line, then do the same operation for columns. It turns out that now in each column and every line you have, at least, on one zero value.

2. Find a line which contains only one zero value of cost, and place one element in this cell. If there is no such line, then it is allowed to begin the solution of a task on appointment with any cell having zero cost.

3. Cross out the remained zero values in cells of this column and repeat two last actions until it becomes already impossible to continue them.

4. In case in lines there are zero cells which remained not crossed out to which there will not correspond appointments, then find a column with the unique zero value and place one element in the corresponding cell. Cross out the zero values of cost which remained in this line. Repeat the last two actions until it is possible.

5. If all elements are distributed in cells to which there corresponds zero cost, then this decision on appointments is optimum. In case it was inadmissible, carry out the minimum quantity of vertical and horizontal straight lines through columns and lines of the table so that they passed through all cells with zero cost.

6. Define the minimum element among through what there did not pass straight lines. Add this element to all values of elements of a matrix which lie on crossing of the drawn straight lines. Leave those values of elements in which there is no crossing of straight lines without changes. After this transformation you in the table will have, at least, one more zero value. Return to a step 2 and repeat optimization, do not receive the necessary result yet.

Author: «MirrorInfo» Dream Team


Print