O PRAVILU NAPUŠTAJUĆE GRANE U MREŽNOM SIMPLEKS ALGORITMU ON LEAVING ARC RULE FOR NETWORK SIMPLEX ALGORITHM Cristian Dobre TRANSILVANIA UNIVERSITY OF BRASOV, BRASOV, Iuliu Maniu 50, ROMANIA Rezime: Kada se u mrežnom simpleks algoritmu pojavi degenerisano rešenje, nastaje problem nalaženja i kasnije održavanja jakog dopustivog razapinjućeg stabla. Polazeći od ovakve početne strukure, jaku dopustivost možemo održati pažljivim izborom pravila napuštajuće grane. Ovo pravilo koristi tehniku najmanjeg zajedničkog prethodnika za koje ja predlažem paralelno rešenje. KLJUČNE REČI: MREŽNI SIMPLEKS, PRAVILO NAPUŠTANJĆE GRANE, NAJMANJI ZAJEDNIČKI PRETHODNIK Abstract: Starting from the degeneracy in Network Simplex Algorithm appears the problem of finding, and latter on keeping, a strong feasible spanning tree. Having an initial structure as the one mentioned earlier, we can maintain the strong feasibility by carefully choosing the leaving arc rule. This rule is using the Lowest Common Ancestor technique for which I propose a parallel solution. KEY WORD: NETWORK SIMPLEX, LEAVING ARC RULE, LOWEST COMMON ANCESTOR 1. INTRODUCTION The Minimum Cost Flow (MCF) problem for a given network G = (N, A, c, u), where N denotes the set of vertices, A the set of arcs, c and u being the cost and capacity functions, is a familiar problem in optimisation area. There are many algorithms for solving MCF and among them we distinguish The Network Simplex Algorithm, using a technique similar to the well-known simplex algorithm elaborated by G.B. Dantzig for solving linear programming problems. .The Network Simplex Algorithm first determines an initial basis structure (T, L, U) for a given network as follows: set T consisting only in free arcs (arcs with the flow strictly positive and less than the arc capacity) if possible, set L consisting in restricted arcs with flow zero and set U with restricted arcs with flow equal to the capacity. The topic of this paper rises from the nature of arcs in set T. If all arcs in T are free, then T is strong feasible (the reverse is not a valid statement). Strong feasibility is also achieved in some other conditions that we discuss later on. Keeping such a strong feasible spanning tree structure is the main idea that we deal with. After determining the initial basis, the algorithm checks whether this is an optimal one or not. If yes, then it ends and if not then it executes a so-called “pivot” iteration. During “pivot” iteration an entering arc is chosen from the arcs that are not satisfying optimality conditions. (arc from L or U). Therefore we form a cycle together with the spanning tree from T. From this cycle we must choose a leaving arc so that the structure remains a spanning tree. In the case that this arc is determined unique there is no problem with the following structure, but if not then we have to carefully make this choice. After the leaving arc is determined then we have another (T, L, U) structure, and the algorithm repeats the actions above until we reach optimality. Returning to the rule of choosing the leaving arc, this one states the following [1]: select the leaving arc as the last blocking arc encountered in traversing the pivot cycle along its orientation starting at the node LCA(k, l). Here the arc (k, l) is the entering arc, and LCA(k, l) denotes the Lowest Common Ancestor of nodes k and l. In the following paragraphs we discuss blocking arc and other details concerning this problem. 2. LEAVING ARC RULE The Minimum Cost Flow (MCF) problem is of the following form: min z ( x) cij xij ( i , j )A x j |( i , j ) A ij x j |( j ,i ) A 0 xij uij ji b(i ) (lowest common ancestor of nodes k and l). (1) () i N () (i, j ) A 3. LOWEST COMMON ANCESTOR OF NODES (2) K AND L . The vector x is said to be an admissible solution of the MCF problem if it satisfies the constraints. In this constraints b(i) is called the value of node i. If for a certain node i the value is positive then the node is called source node (denoted with s), if the value is negative we have the sink node (denoted with t) and for the other nodes the incoming flow equals the outcoming flow therefore the value is zero. The vector x is said to be a spanning tree solution if it satisfies the restrictions mentioned above and its components are divided into three sets: set U (consisting only in arcs with the flow equal to capacity), set L (consisting in arcs with zero flow) and set T composed with exact n-1 arcs connecting the n nodes of the network. As I said in section one the nature of arcs in set T leads to degeneracy. In order to avoid degeneracy, that is to avoid cycling we have to maintain a structure called strong feasible spanning tree solution. There appear two problems: how to determine such an initial structure and of course having such a structure how to maintain it when flow and node potential are changed. In the following paragraphs we identify the spanning tree structure with the spanning tree itself. Let (T, L, U) be the spanning tree structure, and let r be its root node. Arcs in T can be headed toward the root (upward pointing) or away from the root (downward pointing). The spanning tree is said to be strong feasible if every tree arc with zero flow is upward pointing and every tree arc whose flow equals its capacity is downward pointing. As a consequence we can say that a spanning tree is strong feasible if we can send a positive amount of flow from any node to the root along the tree path, satisfying conditions (3). If the optimality conditions are not satisfied the algorithm identifies an entering arc. Let (k, l) be this arc. This arc together with some arcs in T forms a cycle. We can push an amount of flow along this cycle. Let δ be the amount of flow that we can send along the cycle, and yet after modifying the flow, the restrictions (3) are valid. As a consequence of flow bounds restrictions at least one of the arcs in the cycle will have the flow equal to its capacity or will have zero flow. Such an arc is said to be a blocking arc. As long as the blocking arc is unique it is the leaving arc and the new structure remains strong feasible, but if not, then we have to choose one of the blocking arcs respecting the rule I mentioned in section 1: select the leaving arc as the last blocking arc encountered in traversing the pivot cycle along its orientation starting at the node LCA(k, l) If T is the set of arcs that form(3) the strong feasible spanning tree, first we determine an eulerian circuit. As we can see in [2], if the tree has n nodes and it is represented with the adjacency list in a circular manner, we can obtain the eulerian circuit in O(1) parallel time. The eulerian circuit will be determined by a circular list of arcs, for which we make the following constructions: Array A: will have the root on the first position, and then each arc from the list determining the eulerian circuit will be replaced by its ending node. As T consists in n-1 arcs, therefore we have 2n-1 components for A. Array B: it has the same dimension as A; and will store on the i-th position the level in the tree for the corresponding node in A (the level for the root is zero). For a given node k we will maintain the following values: Lev(k) - representing the level of node k in the tree; F(k) - representing the first appearance of the node k in A; L(k) - representing the last appearance of the node k in A. Having these values we can obtain the following statements (if k is not the root): F(k) = i < = > A[i] = k and Lev(A[i – 1]) = Lev(A[i]) 1, L(k) = i < = > A[i] = k and Lev(A[i + 1]) = Lev(A[i]) 1. So, if A and B are given, we can compute the values F(k) and L(k) in O(1) parallel time within a linear number of operations. Also we have the following result [2]: Lemma 1. In the conditions presented above, if k and l are two nodes of the tree T, then: i) k is an ancestor of l F(k) < F(l) < L(k); ii) LCA(k, l) = r L(k) < F(l) or L(l) < F(k); iii) if L(k) < F(l) then LCA(k, l) = t, where t is determined as being the value A[i], for which we have B[i ] min {B[ j ]} . L ( k ) j F (l ) According to the Lemma presented above, the problem of determining the lowest common ancestor of the nodes k and l, has reduced to the problem of determining the minimum on a certain interval that we can solve with an efficient algorithm using the technique of successive speed-up [2]. The same reference proves that we can solve the problem of the minimum on a certain interval in O(log(n)) parallel time within O(n) number of operations. 4. NUMERICAL EXAMPLE We will consider a numerical example for determining the leaving arc in the Figure 1. The spanning tree has 10 nodes, the root node in 1, and we suppose that arc (9,10) was determined to be the entering arc. Therefore k = 9 and l = 10. We form the cycle shown in the picture (2, 3, 5, 7, 9, 10, 8, 6, 4, 2). As we can see all the arcs with flow equal to arc capacity are downward pointing (2,3), (6,8); and the arcs with zero flow (4,2), (7,5) are upward pointing. So the structure is indeed a strong feasible spanning tree. corresponding to the 1 we found is 10. And the node 2 being A[10] is the lowest common ancestor for nodes 9 and 10. In the end, starting from node 2, along the orientation of the cycle (as shown in the picture) we find blocking arc (2,3) and then (7,5). According to the rule stated before we will choose arc (7,5) as being the leaving arc. 5. CONCLUDING REMARKS Network simplex algorithm can be viewed as a unit of algorithms each with a special purpose: finding initial structure, testing optimality, determining the entering arc or the leaving arc and finally computing the data for the new structure, if necessary. Each of this problems stated above has its particular problems concerning complexity and data structures used for implementation. We only discussed here the way of using parallel techniques in order to find the leaving arc, and the resulting complexity of that particular technique. REFERENCES [1] Ahuja, R.K., Magananti, T.L., Orlin, J.B.: Network Flows: Theory, Algorithms and Applications. New Jersey. Prentice Hall, Englewood, Cliffs, 1993. [2] Croitoru, C.: Introducere în proiectarea algoritmilor paraleli. Matrix Rom Bucharest Editor, 2002. [3] Bertsekas, D.P.: Linear Network Optimization. London. MIT, 1991. Fig 1 Because the entering arc (k, l) comes from the set L (having zero flow) we define the orientation of the cycle in the same manner as arc (9,10) is oriented. Blocking arcs are (2,3) and (7,5). Array A has the following components A = (1, 2, 3, 5, 7, 9, 7, 5, 3, 2, 4, 6, 8, 10, 8, 6, 4, 2, 1) - 19 positions (2n-1) and array B = (0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0) denoting the levels in the tree. Concerning nodes 9 and 10 we have F(9) = 6, L(9) = 6, F(10) = 14 and L(10) = 14. So L(9) < F(10) and we apply the third part of the Lemma. B[i ] min {B[ j ]} min{ 5, 4, 3, 2, 1, 2, 3, 4, 5} 1 . 6 j 14 So, the level of LCA(k, l) is 1 and the i-th position [4] Bertsekas, D.P., Castanon, D., Eckstein, J., Zenios, S.: Parallel Computing in Network Optimization. Handbook in Operations Research and Management Science, Vol 7, North Holland, Amsterdam, 1995, pg 331-399.