Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Transshipment Problem

Similar presentations


Presentation on theme: "Chapter 2 Transshipment Problem"— Presentation transcript:

1 Chapter 2 Transshipment Problem
Network Optimization Chapter 2 Transshipment Problem

2 2.1 The Network Simplex Method
G = (V, E) is a digraph. |V|=n, |E|=m. A type of commodity is shipped on the network. For each arc , is the cost of sending one unit of commodity from vertex i to vertex j . Vector c = has m components, and is called the cost vector. There are three kinds of vertices:

3 2.1 The Network Simplex Method
(1) Source If the supply at source i is ( >0 ), then let bi =- . (2) Sink If the demand at sink j is ( >0 ), then let bj = . (3) Intermediate vertex Neither a source, nor a sink. If k is an intermediate vertex, then let bk = 0.

4 2.1 The Network Simplex Method
S denotes supply and D denotes demand

5 2.1 The Network Simplex Method
Balanced transshipment problem Total supply = total demand: , i.e.

6 2.1 The Network Simplex Method
inflow at vertex i ~ the total commodity sent to i; outflow at vertex i ~ the total commodity sent out from i; netflow at vertex i ~ inflow at i - outflow at i; flow vector x ~ , where is the amount of commodity from i to j ; feasible flow x ~ a flow x that makes the netflow at each vertex i equal bi .

7 2.1 The Network Simplex Method
A Feasible Flow

8 2.1 The Network Simplex Method
Single commodity uncapacitated transshipment problem Find a feasible flow such that its cost is as low as possible. Let A be the incidence matrix of the network. The supply-demand can be expressed by Ax=b

9 2.1 The Network Simplex Method
For example, if at vertex i: e1 e2 e3 then A x b netflow at i

10 2.1 The Network Simplex Method
The transshipment problem is now formulated as min cx s.t. Ax=b c ~ row vector, x & b ~ column vector c, , uncapacitated ~ all xij have no upper bound

11 2.1 The Network Simplex Method
Example 2.1 Consider the network shown below with 7 vertices and 10 arcs in which any flow vector x is of the form xT = [x13 x21 x32 x51 x52 x61 x64 x67 x74 x75]. The cost vector is given by c = [ ] and the supply-demand vector by bT = [ ].

12 2.1 The Network Simplex Method

13 2.1 The Network Simplex Method

14 2.1 The Network Simplex Method
Note that the rows of A are linearly dependent because the sum of all rows of A is a zero vector. So, rank (A) < n. On the other hand, we will see later that A contains an nonsingular submatrix. Therefore, rank (A) = n-1. We may delete one equation from Ax = b without changing the solution set.

15 Do you still remember? What is a basic? What is a basic solution?
What is a basic feasible solution? What is the main idea of Simplex method? From a vertex (feasible basic sol) to another vertex, obj. value keep decreasing.

16 2.1 The Network Simplex Method
Feasible tree solution (FTS) A feasible flow x is called an FTS if there is a spanning tree T such that if As each spanning tree has n-1 edges, an FTS x has at most n-1 nonzero components xij.

17 2.1 The Network Simplex Method
If an FTS x has n-1 nonzero components, then the associated spanning tree is unique. It must be the tree consisting of the n-1 edges eij that correspond to the n-1 nonzero xij. We call such an FTS a nondegenerate FTS. An FTS x is called a degenerate FTS if the number of nonzero components is less than n-1. A degenerate FTS may associate with more than one spanning tree.

18 2.1 The Network Simplex Method
Example b = (-3, 3, 0, 0)T It is easy to see that x = ( 3, 0, 0, 0 )T is a feasible solution of the equation Ax = b.

19 2.1 The Network Simplex Method
In fact x is a degenerate FTS, and the associated spanning trees are not unique. They can be one of the following trees: Conversely, every spanning tree T is associated with at most one feasible tree solution.

20 The above few pages told you
FS can be classified into FTS/not FTS. FTS can be further classified into DE/non-DE. Given non-DE FTS, we can defined a unique ST. Given DE FTS, there will be many ST. The following few pages tell: Given a ST, we can solve for a unique solution. The solution may be a FS or not FS.

21 2.1 The Network Simplex Method
By relabeling vertices and arcs, we may let the part of A corresponding to the arcs in T contain a nonsingular matrix B. For example, if we consider the following spanning tree T (formed by solid lines) in Example 2.1:

22 2.1 The Network Simplex Method
It is not clear if in A, the columns corresponding to the arcs in T contain an nonsingular B.

23 2.1 The Network Simplex Method
Relabel vertices and arcs as follows:

24 2.1 The Network Simplex Method
How to relabel? First pick up an arbitrary vertex and label it as the first one. In general suppose i vertices and i-1 arcs in the tree are already relabeled ( ). Then from all unlabeled vertices, choose one (say w) which is adjacent to a relabeled vertex (say u), and label w as the i+1th vertex, and also label the arc between w and u in the tree (either (u,w), or (w,u)) as the ith arc. Repeat the procedure until we have labeled all n vertices and n-1 arcs in the tree.

25 2.1 The Network Simplex Method
a7, a8, a9, a10 are the four arcs not in T, now the incidence matrix

26 2.1 The Network Simplex Method
Let x = (x1, … , x10)T , where xi corresponds to arc ai. Rows 2-7 and columns 1-6 form a matrix B, which is upper triangular, and the diagonal elements are 1 or -1. So, B is a nonsingular matrix.

27 2.1 The Network Simplex Method
The feasible tree solution corresponding to T must have x7 = x8 = x9 = x10 = 0. For xB= ( x1, x2, x3, x4, x5, x6 )T, it can be decided by bi ~ the supply or demand, or zero corresponding to vi.

28 2.1 The Network Simplex Method
Therefore, xB is uniquely determined: (1) If , then is an FTS, i.e., T is associated with a unique FTS. (2) If some components of xB are negative, then is not a feasible solution, i.e., T is not associated with any FTS.

29 2.1 The Network Simplex Method
Summary of the relationship between FTS and ST

30 2.1 The Network Simplex Method
From the above analysis, we know that a Tree Solution is actually a Basic Solution of the system Ax = b, and the base B can be determined by an associated spanning tree. An FTS is a feasible basic solution (FBS). In simplex method we move from one FBS to another FBS. Now in network simplex method, we move from one FTS to another FTS, and geometrically, from one spanning tree to another spanning tree.

31 2.1 The Network Simplex Method
The dual solution defined by a spanning tree We know that the dual problem of min cx s.t. Ax=b is max yb s.t. where y is a row vector: Also, the complementarity slackness condition holds.

32 2.1 The Network Simplex Method
Now for a nondegenerate FTS x, the associated spanning tree T is unique, and for any arc in T, Let the column in A which corresponds to arc be , then by the complementarity slackness condition, i.e. (*)

33 2.1 The Network Simplex Method
The above set (*) has n-1 equations for n variables. So, the solutions are not unique. If we fix yn = 0, then y1, … , yn-1 can be uniquely determined. (If we fix yn to another value t, then in the solution, each shall increase its value by t.) We call the row vector , determined by the equations (*), the dual solution defined by the spanning tree T. (*)

34 2.1 The Network Simplex Method
Profitable arcs Suppose x is an FTS that defines a spanning tree T(x) and a dual solution y. An arc (i, j) which is not in T(x) is said to be profitable with respect to the FTS x if Note that if we change the value of yn in deciding y, as all shall change by the same value, the value of every shall remain unchanged. So, the determination of profitable arcs is independent of the value of yn chosen.

35 2.1 The Network Simplex Method
Theorem 2.2 An FTS u with no profitable arcs is an optimal solution. Proof Suppose u is associated with tree T(u) and dual solution y. Define We know that In fact (1) If arc , then by the definition of y, (2) If arc , then So, for any arc ,

36 2.1 The Network Simplex Method
Now for any feasible solution v: Av= b, , . (1) In particular, when v = u, . (2) (1) - (2):

37 2.1 The Network Simplex Method
Since there is no profitable arc, for any arc , . But , and hence u is an optimal solution.

38 2.1 The network simplex method
The above theorem provides an optimality criterion. Now we consider what happens if there is a profitable arc Of course e is not in T, and If we can increase the flow on from to , meanwhile keep for other arcs not in T, then as , we may have (will explain in detail later), i.e. we obtain a better solution v.

39 2.1 The Network Simplex Method
When arc e is added to the spanning tree T, a unique cycle C(e) will be obtained.

40 2.1 The Network Simplex Method
In the cycle, we call each arc with the same direction as e a forward arc (arcs e1 & e2 in the above graph) and each arc with the opposite direction a backward arc (arcs e3 & e4 in the above graph). If the flow along arc e is increased from 0 to t, then the flow along each forward arc ei is from ui to ui+t, and the flow along each backward arc ej is from uj to uj-t.

41 2.1 The Network Simplex Method
There must be some backward arcs in the cycle. Why? Because if not, we may increase t infinitely (Can this problem be unbounded?). But when , the new feasible flow v shall let , which is impossible as and

42 2.1 The Network Simplex Method
Now since cycle C(e) has backward arcs, when t is increased to certain amount, the flow along a backward arc becomes zero, and we cannot further increase t (for otherwise some flow shall become negative, violating the feasibility).

43 2.1 The Network Simplex Method
In the above example, the largest value of t to maintain a non-negative flow is Suppose t = u3. In this case, call e3 the leaving arc. Generally, if an arc f in C(e) is the leaving arc, we obtain a new tree by deleting and adjoining The updated flow vector v is associated with , i.e., v is a new FTS, and the associated spanning tree is

44 2.1 The Network Simplex Method
Theorem 2.3 If u is an FTS with a profitable arc e and if v is the updated flow using this arc e, then v is an FTS and Proof We first show that v is still an FTS, because (1) When we change from flow u to v, the net-flow at each vertex remains unaffected, and hence all supply / demand requirements are still satisfied, i.e. Av = b. (2) Obviously,

45 2.1 The Network Simplex Method
We next show that Let , where y is the dual solution of u. By Theorem 2.2, Consider two types of arcs: (a) If arc is in the tree T(u) (b) If arc is not in the T(u) and other than the profitable arc

46 2.1 The Network Simplex Method
Therefore, In particular, if u is a nondegenerate FTS , arc t = min { uij | is a backward arc of T(u) } > If all calculated FTS are non-degenerate, the computation must be terminated after a finite number of iterations (i.e. no cycling).

47 2.1 The Network Simplex Method
We now summarize the steps. Initial Step: find an initial FTS and an associated spanning tree Let k = 1. Iterative Steps: for k = 1, 2, … Step 1 Calculate dual solution on the tree . Step 2 If , i.e., the network has no profitable arc, terminate, is the optimal FTS. Otherwise obtain a profitable arc with

48 2.1 The Network Simplex Method
Step 3 Form the cycle and determine t = min { | is a backward arc in C(e) } Suppose the minimum is attained at arc f. Let If (i, j) is a forward arc of C(e) If (i, j) is a backward arc of C(e) If (i, j) = (p, q) For other arcs and and return to Step 1.

49 2.1 The Network Simplex Method
Let us now use Example 2.1 to explain the algorithm. S = 5 S = 2 D = 2 D = 5 D = 3 S = 3

50 Tradition about arc labeling
In the above example, there are totally 10 arcs: (1,3), (2,1), (3,2) (5,1), (5,2), (6,1), (6,4) (6,7) (7,4) (7,5). We normally, label them according to the first number and then the second. e1 = (1,3), e2 = (2,1), …

51 2.1 The Network Simplex Method
Iteration 1 We have given an initial feasible tree solution with which we start our first iteration. Step 1. The initial FTS is xT = [ ] and its cost is z = cx = 71. The arcs of a spanning tree T (not unique since x is degenerate) with which x can be associated are (1, 3), (2, 1), (5, 2), (6, 1), (6, 7) and (7, 4).

52 2.1 The Network Simplex Method
For each arc in T or Start with . So, y = [ 6, 5, 7, 5, 0, -5, 0 ] .

53 2.1 The Network Simplex Method
Step 2. We test whether there is a profitable arc e with respect to x. In the present case we see that e = (5, 1) is the only profitable arc which comes into T(x) as an entering arc. In the degenerate case, cycling might occur, but we can use the methods learned in Linear Programming to avoid cycling. . For each arc not in T, calculate ~ entering arc.

54 2.1 The Network Simplex Method
Step 3. The cycle C(e) is in which (5, 2) and (2, 1) are both backward arcs with existing flow 2 and 0, respectively. We revise the flow in this cycle as t units along (5, 1), 2 - t units along (5, 2) and 0 - t units along (2, 1). Therefore t = 0. Since (5, 1) has just entered it does not make sense to take it as a leaving arc. Thus (2, 1) becomes the leaving arc. Since t = 0, the cost remains unchanged.

55 2.1 The Network Simplex Method
Iteration 2 Step 1. The current FTS is xT = [ ] with cost z = 71. The arcs of the spanning tree are (1, 3), (5, 1), (5, 2), (6, 1), (6, 7) and (7, 4). From the defining equations, y = [ ] Step 2. We see that e = (3, 2) is the only profitable arc which enters T(x).

56 2.1 The Network Simplex Method
Step 3. The cycle C(e) is We get t = 2 and (5, 2) leaves the tree.

57 2.1 The Network Simplex Method
Iteration 3 Step 1. Our FTS is now xT = [ ] and z = 67. The spanning tree has arcs (1, 3), (3, 2), (5, 1), (6, 1), (6, 7) and (7, 4). Also y = [ ] Step 2. There are no profitable arcs for the current FTS. At this stage the algorithm halts after reporting that the current FTS is an optimal solution.

58 Again to avoid having many different answer
If there are two profitable arc, add the arc having prior (smallest) label. For example, if there are 3 profitable arc (2,3), (3,4) and (4,1), Then please add (2,3). Otherwise, I may mark your answer wrong.

59 2.2 Initialization As we have seen, the network simplex method need to have a feasible tree solution (FTS) to start with. How to obtain the initial FTS and the associated spanning tree?  Use artificial arcs.

60 (Always pick vertex 1 in exam)
2.2 Initialization The way to obtain an initial spanning tree T 1. choose an arbitrary vertex v in the graph. (Always pick vertex 1 in exam) 2. for each source i, if there is an arc from i to v, then this arc (i, v) is an arc of T; if there is no arc from i to v, construct an artificial arc (i, v) and take it as an arc of T;

61 2.2 Initialization 3. for each sink j, if there is an arc from v to j, then this arc (v, j) is an arc of T; if there is no arc from v to j, construct an artificial arc (v, j) and take it as an arc of T; 4. for each intermediate vertex k, if there is an arc from v to k or from k to v, we take that arc as an arc of T; if there is no such an arc, construct an artificial arc in either direction and take it as an arc of T. This T must be a spanning tree.

62 2.2 Initialization Suppose there are r artificial arcs, we denote the enlarged network by which has m + r arcs, but still n vertices. Define a new cost vector by taking If (i, j) is an arc of the original network G If (i, j) is an artificial arc

63 2.2 Initialization If the incidence matrix of is , we solve the problem: min s.t. Note that the vector

64 2.2 Initialization Obviously, , for all sources i; , for all sinks j;
, for other arcs in form a feasible tree solution (FTS) corresponding to the tree T. Starting with this (initial) FTS, we use the network simplex method to solve problem

65 2.2 Initialization Suppose x* is an optimal FTS with an associated spanning tree T*. There are three possibilities: Case 1 T* contains no artificial arc. In this case T* is a spanning tree of the original network G and the components of x* that correspond to the artificial arcs must be zero. Thus the original transshipment problem is feasible. We delete all artificial arcs, replace cost vector by c and use T* as the initial tree to solve the original network problem.

66 2.2 Initialization Case 2 T* has at least one artificial arc along which the flow is positive. In this case, the optimal value of problem is positive which means that the original problem has no feasible solution.

67 2.2 Initialization Case 3 T* has at least one artificial arc, but the flow in every artificial arc is zero. The original problem has a feasible solution x obtained by the restriction of x* to the set of original arcs. After deleting the artificial arcs in T*, the remaining part of T* has less than n-1 arcs, which cannot form a spanning tree. So, it must consist of several disconnected components, which implies that the original problem can be decomposed into several smaller sub-problems which may be solved separately.

68 2.2 Initialization Example 2.3

69 2.2 Initialization Iteration 1.
Introduce arcs a10 =(1,5) and a11 =(5,6). Initial spanning tree T(1): D = 11 S = 6 S = 8 D = 7 S = 4

70 2.2 Initialization Let = [ 0 0 0 0 0 0 0 0 0 | 1 1 ] . Initial FTS
x(1) = [ | 6 11 ]T . , , , , .

71 2.2 Initialization For the arc (1, 2) not in T(1), .
arc is profitable. . contains cycle

72 2.2 Initialization The only backward arc is which is the leaving arc. t = 6. x(2) = [ ]T

73 2.2 Initialization is the leaving arc. Iteration 2.
y2  y7 don’t change, So, y(2) = [ ]. For arc , . is a profitable arc. Backward arcs in : (4, 5) and (5, 6) Since min {x45, x56} = min {0, 11} = 0, is the leaving arc.

74 2.2 Initialization , but T(3) is different from T(2).

75 2.2 Initialization Iteration 3. don’t change, .
So, y(3) = [ ]. For arc , is a profitable arc.

76 2.2 Initialization Since min {x12, x25, x56} = min {6, 10, 11} = 6,
is the leaving arc. x(4) = [ ]T.

77 2.2 Initialization Iteration 4. y2  y7 don’t change,
So, y(4) = [ ]. For the 5 arcs not in T(4), So, there are no profitable arcs, and x(4) is the optimal solution of problem But the flow on the artificial arc (5, 6) is positive, which means the original problem is infeasible.

78 2.2 Initialization Integer Solutions
If all supplies / demands are integer values, i.e. b is an integer vector, then the optimal solution x* of the transshipment problem, obtained by the network simplex method, must be an integer vector. Why? because the incidence matrix A is unimodular.

79 2.2 Initialization Let be the matrix obtained by deleting the first row of A; and be the vector obtained by deleting the first component of b. Then the equation is equivalent to (since rank(A) = n-1). Any feasible tree solution x corresponds to a non-singular submatrix B of such that , where and So, each component of has the form , where p is an integer. Since A is unimodular, as a nonsingular square submatrix of A, B must satisfy So, must be an integer.

80 2.2 Initialization Unbalanced Transshipment Problem
So far we consider balanced transshipment problem, i.e. total supply = total demand. Now if total supply > total demand we let r = total supply - total demand and introduce one dummy sink v with the demand r and an arc from each source vertex to v with zero cost. Hence the unbalanced problem becomes a balanced problem in the enlarged network.

81 2.2 Initialization Note that if in the optimal solution, the supply of the source i is and the flow from i to the dummy vertex v is , then the source i sends out only units of the commodity and remains units at its place.

82 2.4 Transportation Problems
Motivating Example: A number of warehouses must ship a single commodity to a number of manufacturing plants. Shipping costs are proportional to distance and the amount shipped. What shipping pattern will minimize total shipment costs?

83 2.4 Transportation Problems

84 2.4 Transportation Problems
A transportation problem is a special transshipment problem in which (1) there is no intermediate vertices (i.e. every vertex is either a source, or a sink). (2) every arc is from a source to a sink. The underlying graph of a transportation problem is a bipartite graph.

85 2.4 Transportation Problems
G = (S, D, E). S ~ the set of sources, denoted by (i = 1, … , m); D ~ the set of sinks, denoted by (j = 1, …, n); E ~ the set of arcs from a source to a sink . Flow matrix: matrix ~ is the flow on the arc ;

86 2.4 Transportation Problems
Cost matrix: matrix ~ is the cost to send one unit of the commodity from to . Note that if actually there is no arc from to , in order to express the problem easily, we assume that there is an arc , but the cost is very expensive, i.e. let , where M is a very large number.

87 2.4 Transportation Problems
Now the transportation problem can be expressed mathematically as min s.t , for i = 1, … , m (1) , for j = 1, … , n (2) for i = 1, … , m; j = 1, … , n (3)

88 2.4 Transportation Problems
The constraint equations (1) and (2) can be jointly expressed as: A x = b, where A is an (m+n) x mn matrix, which is in fact the incidence matrix of the associated bipartite graph (hence is a unimodular one according to Corollary 1.3b); b is an m+n vector by combining the right-hand-side of the equations (1) and (2); and x is an m∙n vector consists of all

89 2.4 Transportation Problems
Transportation problem can be solved on a particularly designed tableau, called the transportation tableau.

90 2.4 Transportation Problems
Finding an initial FTS ~ the northwest corner method.

91 2.4 Transportation Problems
Note that the m+n-1 = 6 filled entries, together with other , form an initial FTS. The arcs corresponding to the filled entries form a spanning tree T.

92 2.4 Transportation Problems
Calculating dual solution y associated with the tree T We use the equation for any arc to determine y. In the above example, let We fill in y1 ~ y3 to the right-most column and y4 ~ y7 to the bottom row.

93 2.4 Transportation Problems
Checking if there is a profitable arc For each arc , calculate and check if all such If yes, an optimal solution is obtained. But is profitable.

94 2.4 Transportation Problems
Deciding the leaving arc Starting from the cell (1, 6) in the tableau, move horizontally or vertically until return to the cell (1, 6) to form a cycle. It is seen that in the cycle the arcs are forward and backward alternatively.

95 2.4 Transportation Problems
Put a + in the tableau for every forward arc; Put a - in the tableau for every backward arc; Decide t = min { | is a backward arc}.

96 2.4 Transportation Problems
Moving from a non-optimal tableau to the next tableau Let If (i, j) is a forward arc; If (i, j) is a backward arc; Other arcs

97 2.4 Transportation Problems
Introduce the entering (profitable) arc into the new tree; remove the leaving arc from the tree. Note that in the example the two backward arcs (1, 5) and (2, 6) both have In this case, we can choose either one as a leaving arc (in the example (2,6) is chosen to leave the tree), but not both, because to maintain a spanning tree need to have m+n-1 = 6 arcs. So far we completed one iteration and switch to a new tableau.

98 2.4 Transportation Problems
Example 2.7 If an FTS is given by the circled numbers in the tableau below, and suppose the entering cell is (3, 7), how to form a cycle in the tableau?

99 2.4 Transportation Problems
Note that when we are at (1, 8) and move horizontally, we have to skip the cell (1, 6) and reach (1, 4). Then we move vertically. If we change the moving direction at (1, 6), no cycle can be formed.

100 2.5 Some Applications to Combinatorics
Definition A matching in a graph is a set M of edges of the graph such that no two edges in M have a vertex in common. graph G a matching of G

101 2.5 Some Applications to Combinatorics
In a bipartite graph G = (X, Y, E) where X and Y both have n vertices (it is possible that between some pair of vertices and , there exists no edges, i.e., G may not be a complete bipartite graph), a matching M is called a perfect matching if there are n edges in M.

102 2.5 Some Applications to Combinatorics
This bipartite graph has no perfect matching This graph has a perfect matching

103 2.5 Some Applications to Combinatorics
A graph is called a regular graph of degree k if the degree of each vertex is k. 2-regular graph Theorem 2.5 (Konig’s marriage theorem) A regular bipartite graph G(U, V, E) of degree k (where k is a positive integer) with has a perfect matching.

104 2.5 Some Applications to Combinatorics
Proof We formulate a transportation problem as follows: Let the vertices in U be sources; the vertices in V be sinks; For each edge , give an arc from to Let the supply at each source be 1; the demand at each sink be 1; the unit cost on each arc (u, v) be 1.

105 2.5 Some Applications to Combinatorics
This problem is feasible because if we let the flow along each arc be , it is a feasible flow. Also, the supply-demand vector is an integer vector as the incident matrix of a bipartite graph is unimodular. Therefore, the transportation problem must have an integer optimal solution x*. In fact as all supplies / demands are 1, x* must be a 0-1 vector. Let M = { (u, v) | , u, v = 1, … , n }. It is easy to see that |M|=n, i.e., M must be a perfect matching.

106 2.5 Some Applications to Combinatorics
Example Does the following bipartite graph have a perfect matching? If yes, give a perfect matching. As this is a regular graph of degree 2, it has a perfect matching. Find a perfect matching by yourself.

107 2.5 Some Applications to Combinatorics
Definition A covering in a graph is a set W of vertices such that every edge of the graph is incident to at least one of the vertices in W. v6, v1, v3, v4 (or v5) is a covering of the left graph

108 2.5 Some Applications to Combinatorics
For any matching M and any covering C of a graph, suppose the graph has k edges , ,… , , such that all and are different to cover these k edges, we need to use at least k vertices from a covering C must have at least k vertices

109 2.5 Some Applications to Combinatorics
Therefore, for any matching M and any covering C This result can be strengthened to become an equality if bipartite graphs are concerned. (Just like Primal and Dual)

110 2.5 Some Applications to Combinatorics
Theorem 2.8 (Konig’s Theorem) In any bipartite graph, the size of a maximum matching equals to the size of a minimum covering.

111 2.5 Some Applications to Combinatorics
Konig’s Theorem can be translated equivalently to the context of matrices. We use the term a line to denote either a row, or a column. Suppose P is a property that an element of a matrix may or may not have. We call an element of a matrix a P-element if it has the property. A set of P-elements is said to be P-independent if no two of them lie on the same line. The size of the largest P-independent set is called the P-rank of the matrix.

112 2.5 Some Applications to Combinatorics
Example 2.10 Let matrix An element of A is said to have property P if it is positive, i.e., if its value is 1. Obviously, the P-rank of A is 3 as a largest P-independent set contains 3 elements, for example, the (1, 1)th, (2, 3)th and (5, 4)th element of A.

113 2.5 Some Applications to Combinatorics
Theorem (Konig-Egervary Theorem) The P-rank of a matrix A is equal to the minimum number of lines that contain all P-elements of the matrix.

114 2.5 Some Applications to Combinatorics
Proof We construct a bipartite graph. Let each row i of A correspond to a left vertex i; each column j of A correspond to a right vertex j. Introduce edge if and only if the element of A is a P-element.

115 2.5 Some Applications to Combinatorics
By Theorem 2.8, Size of a max. matching = Size of a min. covering. Now, a matching is a set of edges, all with different (left and right) endpoints. (correspond to) a set of P-elements in different rows/columns, i.e. a P-independent set. So, Size of a max. matching = Size of the largest P-independent set = P-rank of A.

116 2.5 Some Applications to Combinatorics
A covering is a set of vertices such that every edge of the graph is incident to at least one of these vertices. (correspond to) a set of rows and columns such that each P-element is contained in one of these lines. So, Size of a min. covering = minimum number lines of A that contain all P-elements of the matrix. Thus, the theorem is proved.

117 2.6 Assignment Problem The assignment problem is a special kind of transportation problem in which (1) the supply at each source and the demand at each sink are equal to 1. (2) the number of sources = the number of sinks.

118 2.6 Assignment Problem Let be the cost to send one unit of product (or sevice) from source i to sink j. The mathematical formulation of the assignment problem is min s.t , ,

119 2.6 Assignment Problem Note that actually we are interested in integer solutions, i.e. should be 0 or 1, but this request does not need to be imposed explicitly, because the unimodular property for bipartite graph guarantees an integer optimal solution.

120 2.6 Assignment Problem Example A mill has 4 machines and 4 jobs to be completed. Each machine must be assigned to complete one job. The times required to complete each job on different machines are shown in the table: Time (hours) Job 1 Job 2 Job 3 Job 4 Machine 1 14 5 8 7 Machine 2 2 12 6 Machine 3 3 9 Machine 4 4 10 Decide an assignment scheme to minimize the total time needed to complete the 4 jobs.

121 2.6 Assignment Problem Method 1 use the method for transportation problems. Method 2 the Hungarian method. Theorem 2.17 Suppose C is the cost matrix and is the matrix obtained by adding a number t to each element in a row or to each element in a column. Then a solution is optimal with respect to if and only if it is optimal with respect to C.

122 2.6 Assignment Problem Proof Suppose the row is added by t, i.e , and , for and Then for any feasible solution , = = = = Therefore, under C and C’ , the optimal solutions are the same.

123 2.6 Assignment Problem Based on this theorem, we can change C to C’ such that each row and each column of C’ has at least one zero entry by the following operations: Step 1 Subtract each row by its smallest entry; Subtract each column by its smallest entry.

124 2.6 Assignment Problem 2 examples (-1) (-2) (-1) (-1)

125 2.6 Assignment Problem If in such modified matrix C’ , there are n zero entries and not two of them in the same row or same column, for example then obviously , other is an optimal solution, because for any feasible solution x, (all y are non-negative numbers)

126 2.6 Assignment Problem but
Question: How to check if C’ has zero entries at all different rows and columns? This is in the method of step 2. Step 2 Check whether C’ has n zero entries at different rows and columns. If the answer is yes, then an optimal assignment is obtained by taking the assignment corresponding to the n zero entries and we stop. Otherwise we go to Step 3.

127 2.6 Assignment Problem This step can be fulfilled by the following sub-steps. Step 2a Locate a row or a column in C’ with exactly one 0, and the 0 is selected. If every line (row or column) has more than one zero, a line with the minimum number of 0s is located, and we select anyone of the 0s in this line. This line should not be located again (we can put a check mark beside it)

128 2.6 Assignment Problem Put a circle around the selected 0, and draw a line through (covering) the 0. This line should be a vertical line if the line located is a row, and a horizontal line if the line located is a column.

129 2.6 Assignment Problem Step 2b Repeat the previous step (but do not consider any 0 which has been covered by a line) till every 0 has at least one line through it. Step 2c If the number of lines drawn is n, the n selected (circled) 0s will point out an optimal solution. If the number of lines is less than n, we go to Step 3.

130 2.6 Assignment Problem Examples
n = 5 (lines), we obtain an optimal solution which is 2.6 Assignment Problem and other Examples

131 2.6 Assignment Problem n = 4 < 5, so, we are unable to obtain an optimal assignment by using the modified matrix

132 2.6 Assignment Problem Generally, if the number of lines needed to cover the zeros is k and k<n, we call the 0 element in the matrix as P-element and by Th. 2.9, we know that the P-rank of the matrix is k, i.e., the maximal number of 0 elements in different rows and columns is k. In this case, we need to modify the matrix further to create more 0s in the right place. Let m be the smallest value of the uncovered elements. We subtract m from all uncovered rows ~ so that more 0s appear in the previously uncovered part.

133 2.6 Assignment Problem Example m = 2
(+2) (+2) However, now in the covered column, some 0 become –m which are negative. We now add m to the covered columns.

134 2.6 Assignment Problem The above operations can be further simplified. We divide all elements in the matrix obtained at Step 2 into 3 groups. (1) Uncovered elements. (2) Singly covered elements ~ covered by only one line (a row or a column) (3) Doubly covered elements ~ covered by two lines: a row and a column.

135 2.6 Assignment Problem Step 3a Find the value of the smallest uncovered element. Suppose it is m. We (a) subtract m from all uncovered elements; (b) add m to all doubly covered elements. (and keep the singly covered elements unchanged)

136 2.6 Assignment Problem For example, if we apply the operations (a) and (b) to : . which is just

137 2.6 Assignment Problem Note that the 0s to be selected to draw the lines (i.e. the 0s with ) are singly covered, hence they are still 0. But some elements in the uncovered part become 0 ~ new 0, and thus need to use more lines to cover all 0.

138 2.6 Assignment Problem Step 3b Delete all covering lines and go back to Step 2.

139 2.6 Assignment Problem Now the number of lines to cover all 0s = 5 = n. So, we obtain an optimal assignment: and other , i.e. source 1 sink 5, source 2 sink 3, source 3 sink 2, source sink 4, source sink 1.


Download ppt "Chapter 2 Transshipment Problem"

Similar presentations


Ads by Google