On the K best integer network flows
Introduction
The minimum cost flow (MCF) problem in a directed network with n nodes, m arcs, arbitrary lengths and capacities on the arcs appears in many important real cases (distribution problems, etc.) and there are numerous algorithms to solve it (see, for example, [2]).
The problem of finding the K best solutions of combinatorial optimization problems [1] was initiated by Murty [3] for assignments and continued by Lawler [4] for paths, Gabow [5] for spanning trees, Camerini et al. [6] for spanning arborescences, Hamacher et al. [7] for minimum network cuts, Chegireddy and Hamacher [8] for matchings, Camerini and Hamacher [9] for matroid intersections, and Brucker and Hamacher [10] for scheduling problems. In this paper, we revisit the K best integer network flow (KBINF) problem, which determines the K best integer solutions of the classical mathematical formulation of the MCF problem. Hamacher and Husselman [11] and Hamacher [1] addressed this problem for the first time. The determination of the best integer network flows in a network has a wide range of applications: Dynamic Lot Size problems as commented in Hamacher [1] and Multiobjective Integer MCF problem (see [12]). In addition, the resolution of the K best integer network flow problem provides an instrument to solve the MCF problem with additional constraints (Crew Scheduling problems, see [13]) or flow problems where the costs change in a time horizon (see [1]). Note that a K best algorithm should be fast and require only a limited amount of RAM when a MCF problem with additional constraints is solved in an exact way, because it is possible that thousands of solutions need to be enumerated.
For that, we introduce a new algorithm for the KBINF problem that runs in O(f(n,m,L,U)+KmS(n,m,L)) time, but uses only O(K+m) memory space and, therefore, notably reduces the O(Km) memory requirement in the previous algorithm. O(f(n,m,L,U)) is the time needed for the resolution of the MCF problem in a network with n nodes, m arcs, maximum absolute value of the costs L and an upper bound on the capacities and supplies/demands U. O(S(n,m,L)) is the best time to solve the single-source shortest path problem. A proper minimal cycle allows the second best integer flow to be determined from a given optimal flow. In this paper, we also introduce a new method to compute a proper minimal simple cycle in a residual network with non-negative lengths. The method given in Hamacher [1] requires exactly single-source shortest path computations whereas the proposed method performs at most of these computations, where is the number of pairs of symmetric arcs in the residual network. Moreover, in practice, the number of shortest path computations is less than (i.e., close to n). Computational experiments confirm this claim. In addition, the effort made by the algorithm to reduce the required memory space in practice is insignificant in relation to the effort needed by the algorithm to compute the best solutions. Finally, our method simplifies the implementation of the binary partition scheme introduced in [1] by working only with residual capacities instead of lower and upper bounds on the flows. Therefore, it does not need to store the successive modifications on those lower and upper bounds.
The direct application of the proposed algorithm for ranking assignments solves this problem in O(KnS(n,m,L)) time and O(K+m) memory space. Therefore, the proposed algorithm improves the memory space while keeps the best time needed to solve this problem. The direct application of the proposed algorithm to the K shortest path trees, however, does not suppose any computational advantage (see [14]).
The organization of the paper is as follows. Section 2 presents the linear programming formulation of the MCF and the KBINF problems. This section also includes comments on the algorithm to solve the KBINF problem proposed by Hamacher [1]. In Section 3, we introduce a new method to determine a proper minimal simple cycle in a residual network where all the lengths of the arcs are non-negative. Section 4 explains the tree of flows data structure to store implicitly the K best flows to reduce the memory space needed by the algorithm. The procedures to build an integer flow in the tree of flows from an optimal integer flow are also given. Section 5 contains detailed pseudo-code and an explanation of the proposed algorithm. Moreover, the worst-case time and memory space complexities of the algorithm are also proven in this section. In Section 6, we comment on the computational experiments carried out. Finally, in Section 7, we offer our conclusions and lines of future research.
Section snippets
The minimum cost flow and the K best integer network flow problems
The minimum cost flow problem is stated in a directed network G=(V, A), where V is the set of n nodes and A is the set of m arcs. Let an integer bi be the supply/demand rate of node i. Each arc (i,j)∈A has associated the following values: uij and lij, the upper and lower capacity of the arc (i,j) (both values are integer) and, cij, the cost per unit of flow on arc (i,j). Let and . Also, we define by and
Finding a proper minimal simple cycle
Let x∈X be an optimal flow and let G(x) be its corresponding residual network. The determination of the proper minimal simple cycle in G(x) can be tackled by the determination for each node r∈V of a proper minimal simple r-cycle Cr where a proper simple r-cycle is a proper simple cycle with node r being the first and last node of the cycle. Then,
We modify the network G(x) to compute a proper minimal simple r-cycle Cr for a fixed node r∈V.
Improvement of the used memory space in the resolution of the KBINF problem
Based on the results of Murty [3], Lawler [4] and Gabow [5], the binary partition scheme was used in Hamacher [1] to devise an algorithm determining the K best integer network flow and it is now described. Given an optimal flow x, let be the second best integer network flow. Then, let (i,j) be an arc in the proper minimal simple cycle such that , then x is an optimal flow in L(x)={y∈X:yij≤xij} and x′ is an optimal flow in L(x′)={y∈X:yij≥xij+1}. Now the third best integer
An improved KBINF algorithm
The proposed algorithm to solve the KBINF problem uses the previous procedures as subroutines. Fig. 3 shows a pseudo-code of the algorithm. The main algorithm starts by obtaining an optimal flow x1. Next, the algorithm stores the residual network G(x)=G(x1), the shortest path distances d=d1 and the objective value c(x1)=c(x). The index k is set to 1. A proper minimal simple cycle is found by the PMSC(G(x), pred, r, MinL) procedure, where node r is associated with the proper minimal simple r
Computational results
Our interest in the current experiment lies in the answers to the next two questions. (1) Is the number of shortest path computations to determine a proper minimal cycle much less than , for example, close to n? And (2) is the additional number of shortest path computations that the BG procedure performs in the KBINF algorithm insignificant when it is compared to the number of shortest path computations to determine the K best integer network flows?
The algorithm was written in C and
Conclusions
The paper outlines a scheme to establish an implicit representation of the K best integer network flows that facilitates the construction of any best flow from the optimal network flow. This scheme leads to the development of a K best integer network flow algorithm using O(K+m) memory space. This result implies a notable reduction in the memory requirement used with respect to the previous algorithm (O(Km)). One area of application is the biobjective integer minimum cost flow problem (see [12]
Acknowledgments
The authors wish to thank the anonymous referees for their valuable keys and comments that have improved this paper. This work has been partially supported by Spanish Government Research Project MTM2009-08830.
References (16)
- et al.
On finding the K best cuts in a network
Operations Research Letters
(1984) - et al.
Algorithms for finding K best matchings in an undirected graph
Annals of Discrete Mathematics
(1987) - et al.
K-optimal solutions in scheduling problems
European Journal of Operational Research
(1989) - et al.
A two-phase algorithm for the biobjective integer minimum cost flow problem
Computers and Operations Research
(2009) - et al.
On the K shortest path trees
European Journal of Operational Research
(2010) A note on K best network flows
Annals of Operations Research
(1995)- et al.
Network flows
(1993) An algorithm for ranking all the assignments in increasing order of cost
Operations Research
(1968)
Cited by (8)
Finding all minimum cost flows and a faster algorithm for the K best flow problem
2022, Discrete Applied MathematicsCitation Excerpt :Recall that we obtain a second-best flow by augmenting an optimal flow over a proper minimal cycle with one flow unit. After this, we will use the binary partition approach, as presented in [11] or [19]. [11]
Exploring K-best solutions to enrich network design decision-making
2018, Omega (United Kingdom)Citation Excerpt :Melo et al. [33] and Melo et al. [32] present comprehensive reviews of facility location models applied to SCND, identifying basic features that such models must capture to support decision-making involved in strategic supply chain planning. The K-best approach, in which the models provide not only the best solution but a set of a pre-defined number of K best solutions, has been used to tackle an increasing number of problems, such as Shortest-Path problem [13,27,35,44], Minimum Spanning Tree Problem [17], Minimum Spanning Arborescence problem [5], Resource Allocation problem [25], Minimum Network Cut problem [20], Integer Network Flow problems [19,21,37], Perfect Matching problem [9], Matroid intersection problem [6], Scheduling problem [4], Traveling Salesman problem [39], Knapsack problem [28,29,41], Modular Product Design problem [45], among others. Melo et al. [32] have made an extensive review of supply chain location models, but none of the latter used the K-best approach to obtain alternative solutions.
Computing k shortest paths using modified pulse-coupled neural network
2015, NeurocomputingCitation Excerpt :Many authors [6,8,12,16,17] aim to find KSPs with the solution paths not required to be simple, i.e., loops are allowed in the paths; while in other works [5,9–11,13–15], the solution paths are restricted to be simple where there is no node repeated along any solutions. From another perspective, the goal of most algorithms is to compute KSPs between two given nodes, also called single-pair KSP problem [8–11,13–17]. However, the single-source KSP problem aims to find KSPs from a given node to each other node [5,6].
On Strings Having the Same Length-k Substrings
2022, Leibniz International Proceedings in Informatics, LIPIcsAn O(nm) time algorithm for finding the min length directed cycle in a graph
2017, Proceedings of the Annual ACM-SIAM Symposium on Discrete Algorithms