Abstract 1 Introduction 2 Preliminaries 3 Proximity result 4 The new algorithm 5 Discussion References

An Optimal Algorithm for the Stacker Crane Problem on Fixed Topologies

Yike Chen ORCID University of Electronic Science and Technology of China, Chengdu, China Ke Shi ORCID University of Science and Technology of China, Hefei, China Chao Xu ORCID University of Electronic Science and Technology of China, Chengdu, China
Abstract

The Stacker Crane Problem (SCP) is a variant of the Traveling Salesman Problem. In SCP, pairs of pickup and delivery points are designated on a graph, and a crane must visit these points to move objects from each pickup location to its respective delivery point. The goal is to minimize the total distance traveled. SCP is known to be NP-hard, even on trees. The only positive results, in terms of polynomial-time solvability, apply to graphs that are topologically equivalent to a path or a cycle.

We propose an algorithm that is optimal for each fixed topology, running in near-linear time. This is achieved by demonstrating that the problem is fixed-parameter tractable (FPT) when parameterized by both the cycle rank and the number of branch vertices.

Keywords and phrases:
Stacker Crane Problem, Fixed-Parameter Tractable, Min-Cost Circulation
Copyright and License:
[Uncaptioned image] © Yike Chen, Ke Shi, and Chao Xu; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Fixed parameter tractability
; Theory of computation Network flows ; Mathematics of computing Combinatorial optimization
Acknowledgements:
We would like to thank Siyue Liu and Jianbo Wang for the initial discussions related to this problem. Chao would like to thank Zexuan Liu and Luze Xu for their discussions on the proximity results of a related integer program.
Funding:
Supported by Science and Technology department of Sichuan Province under grant M112024ZYD0170.
Editors:
Ho-Lin Chen, Wing-Kai Hon, and Meng-Tsung Tsai

1 Introduction

In the stacker crane problem (SCP), a stacker crane must retrieve and deliver a set of m items from and to specified locations within a warehouse. The goal is to determine an optimal order for these operations, constructing a tour that completes the task while minimizing the total distance traveled. The problem is typically modeled as a problem on a weighted graph, where the stacker crane moves between vertices, traversing the edges.

The SCP was first studied by Frederickson et al. [10], who provided an equivalent formulation involving a tour on a mixed graph and designed a 9/5-approximation algorithm. Subsequently, there have been many studies focused on developing approximation algorithms for various SCP variants [18, 14, 20].

Regarding exact algorithms, Frederickson and Guan demonstrated that SCP is NP-hard even on trees [8], ruling out some of the simplest graph classes as candidates for polynomial-time solvability. However, Atallah and Kosaraju showed that when the input graph is a path, SCP can be reduced to a minimum spanning tree problem. Moreover, if the input graph is a cycle with n vertices, there exists an O(m+nlogn)-time exact algorithm [2]. Frederickson later improved the running time to match that of finding a minimum spanning tree, and also proved the algorithm to be optimal [9].

Since paths and cycles are topologically equivalent to a single edge or a self-loop, respectively, one might conjecture that SCP is solvable in polynomial time for any fixed topology. Fixed topologies have practical significance: the layout of warehouses is usually fixed, often resembling a grid with a limited number of aisles [17, 4]. For further details on various industrial applications of SCP, we refer readers to [6].

Our Contributions

We present an optimal algorithm for solving the SCP for fixed topologies. The idea is to design an FPT algorithm parameterized by the cycle rank and the number of branch vertices. Our algorithm generalizes Frederickson’s approach, reducing to his algorithm when the topology is a path or a cycle [9]. Because our algorithm is more general, it also serves as an alternative and more intuitive proof of the correctness of Frederickson’s algorithm for paths and cycles as special cases [9].

2 Preliminaries

We consider mixed graphs, which can contain both undirected edges and directed edges, the latter being referred to as arcs. A graph that contains only arcs is called a directed graph, while one that contains only undirected edges is called an undirected graph. A vertex is termed a branch vertex if its degree is at least 3.

For an arc (s,t), s is the tail and t is the head. For an undirected edge, both vertices are tails and heads. A walk is a sequence of edges such that the tail of the subsequent edge matches the head of the preceding edge. A tour is a walk that starts and ends at the same vertex. Let MST(m) denote the worst-case running time for finding a minimum spanning tree in a graph with m edges.

We now provide a graph-theoretical definition of SCP. In SCP, we are given a simple graph B=(V,E), called the base graph, together with a list of requests R. A request is an ordered pair of vertices, represented as an arc. For simplicity, we assume that the requests are distinct, although our results can handle cases with duplicate requests.

We use the following formulation of SCP, as introduced by Frederickson et al. [10].

Problem 1 (Stacker Crane Problem (SCP)).

Given a simple graph B=(V,E) on n vertices and a set of p arcs R, with a cost function c:ER+, find a min-cost tour in the mixed graph G=(V,ER) that traverses each arc in R exactly once.

Intuitively, by assigning the cost of an arc (s,t)R to be the length of the shortest st-path in B, traversing an arc represents moving an object from s to t. We emphasize that this ensures the object must be delivered immediately once it is picked up.

An edge subdivision operation involves inserting a new vertex in the middle of an edge. Specifically, given an edge uv, we delete the edge, add a new vertex w, and connect u and v via w by adding edges uw and wv. A graph H is called a subdivision of a graph G if H can be obtained through a sequence of edge subdivision operations starting from G. Two graphs, G1 and G2, are topologically equivalent if G1 and G2 are subdivisions of the same graph G. Our goal is to show that SCP for a fixed topology can be solved in optimal time.

Problem 2 (Stacker Crane Problem with Fixed Topology (SCP(H))).

Given a simple graph B=(V,E) on n vertices that is topologically equivalent to a graph H, and a set of p arcs R, with a cost function c:ER+, find a min-cost tour in the mixed graph G=(V,ER) that traverses each arc in R exactly once.

2.1 Circulations

Consider a mixed graph G=(V,EA) with a set of undirected edges E and directed arcs A. An arbitrary orientation is assigned to each undirected edge to define a forward direction, which serves solely as a notational convenience and has no bearing on the results. We define δ(v) and δ+(v) as the sets of in-edges/in-arcs and out-edges/out-arcs of a vertex v, respectively. Each edge and arc has an associated lower bound, upper bound, and cost function, denoted as ,u:EA and c:EA.

A circulation is a function f:EA such that eδ(v)f(e)=eδ+(v)f(e) for every vertex vV. The circulation f is feasible with respect to the lower bounds and upper bounds u if (e)f(e)u(e) for every edge eEA. Typically, the values of and u are clear from the context.

The cost of a circulation f under the cost function c is given by aAf(a)c(a)+eE|f(e)|c(e). A feasible circulation with the minimum cost is called a min-cost circulation. An edge or arc e is termed fixed if (e)=u(e). An edge e is considered unconstrained if (e)= and u(e)=. An arc is unconstrained if (e)=0 and u(e)=. The support of f, denoted by supp(f), is defined as {ef(e)0,eEA}.

For a circulation f, we use [f] to denote the set of all tours corresponding to f in a natural way: a tour where f(e) represents the difference between the number of times the tour traverses the edge in the forward and backward directions. The set [f] is referred to as a homology class, and two tours in [f] are said to be homologically equivalent.

For the SCP problem with input graph G=(V,ER), the corresponding circulation problem is a circulation problem on G where each edge in E is unconstrained, and each arc in R is fixed with a flow value of 1. The costs of the edges and arcs remain the same as in the original SCP formulation. The SCP problem and the corresponding circulation problem are not equivalent. A gap exists due to connectivity. A tour must be connected, but the corresponding circulation does not guarantee connectivity by simply looking at the support.

2.2 Cycle space

For an undirected graph G=(V,E), the functions f:E can be represented as vectors in E. The space of circulations is a submodule of E, known as the integral cycle space, or simply the cycle space. If the graph is connected, the dimension of the cycle space is |E||V|+1 [3]. This value, |E||V|+1, is referred to as the cycle rank. Any two topologically equivalent graphs have the same cycle rank.

A circulation f is called a cycle flow if supp(f) forms an undirected cycle (after considering all edges as undirected). A cycle flow f is a unit cycle flow if |f(e)|=1 for all esupp(f). Let T be a spanning tree in G. For each edge uvT, the fundamental cycle Cuv with respect to T is defined as the unit cycle flow that traverses uv in the forward direction and then traces back from v to u along the unique path in T. Note that it is possible that some fundamental cycles have a negative flow value on some edges.

The fundamental cycles with respect to T form a basis for the cycle space. That is, let C1,,Cr be the fundamental cycles with respect to T. Then, for any circulation f, we have f=i=1rλiCi for some coefficients λr [15].

2.3 Techniques

Atallah and Kosaraju solved SCP(H) for the cases where H is either a path or a cycle [2]. Using a more modern and general perspective, their approach can be summarized as a three-step algorithm:

  1. 1.

    Find a min-cost circulation f in the corresponding circulation problem.

  2. 2.

    Find all circulations g such that fgb for some bound b.

  3. 3.

    Find a min-cost tour in each homology class [g], and return the minimum.

It is crucial that H is a path or a cycle, as their technique in each of these steps relies heavily on this property. We describe how to eliminate such a restriction.

In the first step, finding a min-cost circulation when H is either a path or a cycle was solved through an ad-hoc process in linear time. On a path, such a circulation is unique. For a cycle, they fix a flow sent along a particular edge, and then the circulation becomes unique. Alternatively, one can use a min-cost flow algorithm on a one-tree [13], which can also obtain a linear time algorithm. We show that min-cost circulation can be solved in linear time for arbitrary fixed H by reducing it to a problem similar to linear programming in a fixed dimension. See Subsection 4.1.

For the second step, Atallah and Kosaraju showed that b=0 suffices for paths, leading to an optimal algorithm. In the same paper, they established a bound of b=p for cycles, where p is the number of requests. Fortunately, their technique does not explicitly generate all circulations, but instead searches through them using a binary search, implemented alongside step 3. Later, Frederickson improved the bound on b to 1 by squeezing the value of the min-cost tour between two one-dimensional functions, thereby achieving the desired proximity result [9]. This improvement not only made the algorithm faster but also allowed steps 2 and 3 to be separated.

In general, it is not difficult to argue that for any H, a bound of b=p suffices. The number of feasible circulations in step 2 would then be O((2p+1)r), where r is the cycle rank of B. This is too large to yield a fast algorithm. Unfortunately, Frederickson’s technique does not generalize to graphs with higher cycle ranks. Therefore, we need a proximity theorem for arbitrary graphs. This is the most technical part of our paper. As we will show in Section 3, a bound of b=r suffices. The algorithm to explicitly enumerate O((2r+1)r) such circulations will be described in Subsection 4.2.

For the third step, Atallah and Kosaraju found the min-cost tour in a homology class by computing a minimum spanning tree in an auxiliary graph. The auxiliary graph is constructed by contracting edges in the circulation that defines the homology class. Once again, computing a minimum spanning tree suffices only because H is a path or a cycle. In Subsection 4.3, we show that the correct problem to solve is minimum Steiner tree in the auxiliary graph, which is an NP-hard problem in general. However, since the number of Steiner branch vertices depends only on H, the running time remains efficient.

3 Proximity result

Let B=(V,E) be the base graph. Consider the mixed graph G=(V,ER) in the SCP problem and the corresponding circulation problem on G. Assume f is the min-cost circulation in G. We will show that there exists a circulation g in G such that the homology class [g] contains the min-cost tour, and fgr, where r is the cycle rank of B.

For a unit cycle flow C, we call kC a cycle flow of value k. A circulation f is said to contain a circulation g if |g(e)||f(e)| for each edge e, and g(e) and f(e) have the same sign.

Definition 1.

A circulation is elementary if it does not contain a cycle flow of value 2.

Intuitively, this means that after cancellations, no part of the flow circulates around a cycle more than once. In fact, we prove the proximity result by showing that fg is an elementary circulation in B, the undirected base graph.

3.1 Elementary Circulations

For a graph or mixed graph G, let G=sym(G) be the directed graph obtained by replacing each edge with two opposing arcs. Interestingly, we prove the proximity result by considering circulations in the residual graph of G, as it is easier to reason about.

The residual graph for a given directed graph G with lower and upper bounds and u, and a feasible circulation f, is the directed graph Gf along with new lower and upper bounds f and uf. For each arc aA, define uf(a)=u(a)f(a) and f(a)=(a)f(a). The residual graph Gf consists of all arcs for which either uf(a)0 or f(a)0. Note that the lower bounds in the residual graph do not have to be non-negative. However, f(a)0uf(a) is always satisfied, meaning that the zero circulation is always feasible. The fixed arcs in the original graph do not appear in the residual graph, so the complexity of the residual graph can be much smaller than the original graph.

One can observe that the SCP can be reduced to a min-cost connected circulation problem on G=(V,AR)=sym(G). Here, A are the arcs obtained from symmetrizing E. For arcs in A, the lower bound is 0 and the upper bound is infinity. The cost of each arc is the cost of the corresponding edge. For arcs in R, both the lower bound and upper bound are 1. If f is a min-cost connected circulation in G, then it corresponds to a min-cost tour of the same cost in G.

Theorem 2.

Let f be a min-cost circulation in G=(V,ER), where the flows on arcs in R are fixed to 1, and edges E are unconstrained. There exists a circulation g such that the min-cost tour is in the homology class [g] and gf is an elementary circulation in the base graph B=(V,E).

Proof.

Let Δ=gf. We choose g such that a min-cost tour is contained in [g], and out of all such g, one that minimizes Δ1. Note that Δ is a circulation in B because f and g agree on the fixed arcs in R, hence Δ is zero outside of E.

Let G=sym(G), and let f be the min-cost circulation in G, which corresponds to the min-cost circulation f in G in a natural way. Specifically, for each edge uv, let (u,v) denote the positive orientation. Define f(u,v)=f(uv) and f(v,u)=0 if f(uv)0 and otherwise set f(u,v)=0 and f(v,u)=f(uv). This ensures that f(uv)=f(u,v)f(v,u). Let g be the min-cost connected circulation in G, such that g(uv)=g(u,v)g(v,u), again using the positive orientation (u,v). Let Δ=gf, which is a circulation in B=sym(B).

Consider the residual graph Gf. Certainly, Δ is a feasible circulation in Gf because f+Δ=g is a feasible circulation in G. We label the arcs in Gf as follows: for each edge eE, label two corresponding arcs as e+ and e such that Δ(e+)Δ(e)0, which implies Δ(e+)Δ(e)=|g(e+)f(e+)g(e)+f(e)|=|g(e)f(e)|=|Δ(e)|.

Assume Δ is not elementary. Then, there exists a unit cycle flow C such that 2C is contained in Δ. In terms of Gf, this would imply that Δ(e+)Δ(e)2 for each eC. We consider a cycle flow C in Gf whose undirected version is C, and which uses the maximum number of edges with positive labels. That is, for each edge e, we set C(e+)=1 and C(e)=0 if Δ(e+)2, otherwise, since Δ(e+)1, it follows that Δ(e)Δ(e+)21, set C(e+)=0 and C(e)=1.

Certainly, ΔC is feasible in Gf. The cost of C cannot be negative, since the residual graph of a min-cost circulation cannot contain a negative cost cycle [1]. This implies that the cost of gC is no greater than the cost of g.

Additionally, we need to show that supp(gC) is connected. For each esupp(C), there are two cases:

  1. 1.

    If C(e+)=1, then Δ(e+)2. Therefore, g(e+)C(e+)=f(e+)+Δ(e+)11. Hence, e+supp(gC).

  2. 2.

    If C(e)=1, then Δ(e)1. Therefore, g(e)C(e)=g(e)+11. Hence, esupp(gC).

Since supp(gC) would include at least one of e+ or e for each eC, if supp(g) is connected, then supp(gC) is also connected. Because gC is a connected circulation of no greater cost than g, we have that [gC] also contains a min-cost tour. However, ΔC1<Δ1 because Δ contains C. This contradicts our choice of Δ having minimal L1 norm.

3.2 Elementary Circulations and 𝑳 Norm

In this section, we bound the number of elementary circulations in a graph using its cycle rank.

The idea is to show that for an elementary circulation f, we have fr, where r is the cycle rank, by expressing the circulation as the sum of r cycle flows. We then use the fact that no flow traverses a cycle more than once to establish the desired bound.

However, a naive decomposition might result in a cycle flow with values greater than 2, even though the overall circulation remains elementary due to cancellations.

To avoid this issue, we transition to non-negative circulations, ensuring that everything we analyze is non-negative. This simplifies the argument, as it prevents flow cancellations on edges when summing flows around cycles.

First, we strengthen the well-known flow decomposition theorem for circulations, which typically states that a circulation can be decomposed into m cycle flows, where m is the number of edges [19]. We show that this can be improved to r, the cycle rank of the graph.

Proposition 3.

Every non-negative circulation on a graph with cycle rank r can be decomposed into at most r non-negative cycle flows. That is, f=i=1rλiCi, where C1,,Cr are non-negative cycle flows and λ1,,λr0.

Proof.

We prove this by induction on the cycle rank r.

If the cycle rank is 0, then the graph contains no cycles, and f must be zero everywhere.

Now, consider the case where the cycle rank is r. We can assume the graph is connected; otherwise, we can apply the proof to each connected component separately. Suppose there exists a cycle C with positive flow. Let λ=mineCf(e). We include λC as a term in the decomposition.

Let D be the set of edges with zero flow after reducing the flow on C by λ. Assume that GD has k components. Observe that k|D|+1. If k=|D|+1, this would imply that removing each edge in D disconnects the graph, contradicting the fact that G contains the cycle C. Hence, k|D|.

Let the components of GD be V1,,Vk. By the inductive hypothesis, the remaining circulation can be decomposed into i=1k(|Ei||Vi|+1)=(m|D|)n+kmn=r1 non-negative cycle flows. Therefore, we can decompose f into r non-negative cycle flows.

Next, we show that elementary circulations have a small L norm.

Proposition 4.

Let f be an elementary circulation in a graph with cycle rank r. Then, fr.

Proof.

Let f be an elementary circulation. Assume f is non-negative; if not, we reverse the orientation of the edges with negative flow so that f becomes non-negative. By Proposition 3, f can be decomposed into r non-negative cycle flows. Since f is an elementary circulation, each of the r cycle flows is a unit cycle flow. Hence, for each edge e, we have f(e)=i=1rCi(e)i=1r1=r. Therefore, fr.

The bound in Proposition 4 is tight. Consider a cycle rank r graph with 2(r+1) vertices that consists of a path P=v1,,v2r. There are also edges eri between v2ri and v1+i for ir. See Figure 1. It has cycle rank r. Let Ci be the fundamental cycle with respect to the path P using edge ei in the smaller to larger vertex direction, where i1. Consider the circulation f=i=1rCi, which is elementary, and f(e0)=r.

Figure 1: Example graph where there is an elementary circulation where f=r.

4 The new algorithm

This section describes the optimal algorithm up to constants for SCP(H).

4.1 Min-Cost Circulation

Recall that we are interested in finding the min-cost circulation f of G=(V,ER), where f(a)=1 for all aR. The min-cost circulation problem was shown to be solvable in m1+o(1) time, where m is the number of edges in the graph [5]. In our case, the graph has p+m edges. The min-cost flow algorithm on a one-tree gives a linear time algorithm for the special case when the base graph have cycle rank 1 [13]. We can show that there is a linear time algorithm for base graphs with fixed cycle rank.

Theorem 5.

Let r be a fixed number. Consider a min-cost circulation problem where the edges are either fixed or unconstrained, and the unconstrained edges form a graph with cycle rank r. The min-cost circulation can be found in O(m) time.

Proof.

Let B=(V,E) be the undirected graph containing all the unconstrained edges, and let R be the set of fixed edges. We have G=(V,ER). Consider a spanning tree T on B, and let the edges in ET be e1,,er. We define g(λ1,,λr) to be the cost of the min-cost circulation f in G such that f(e)=1 for eR and f(ei)=λi for 1ir. To find the min-cost circulation, we need to solve minλg(λ). Note that there is an integral minimizer, as λi represents the flow value on edge ei, which can always be taken to be integral.

Finding the minimum is equivalent to solving the following linear program. For each aR, compute the fundamental cycle Ca, and let be=eCaCa(e). For each eE and 1ir, we define Ae,i=Cei(e).

Here, A is the edge-fundamental cycle incidence matrix, which is a network matrix [15].

minλET,xTexesubject toxec(e)|Aeλ+be|eE

Zemel showed that the minimizer of mathematical programs of the above form can be seen as a generalization of r-dimensional L1 linear regression, which can be solved using techniques similar to Megiddo’s constant-dimension linear programming algorithm [16]. Consequently, the problem can be solved in 2O(2r)m=O(m) time [21].

4.2 Generating Circulations Near the Min-Cost Circulation

In this section, we show how to generate all circulations that are close to the min-cost circulation in terms of the L norm.

Lemma 6.

For an undirected graph with cycle rank r, the number of circulations f such that fk is at most (2k+1)r and these circulations can be found in O((2k+1)rm) time.

Proof.

Consider any fundamental cycle basis of G, a graph with cycle rank r, with respect to some spanning tree T. The values on the edges outside T uniquely determine the circulation. For a circulation f such that fk, the absolute value of the flow on each edge outside T is at most k. Hence, there can be at most 2k+1 choices for each of the r edges outside T. This shows that there can be at most (2k+1)r circulations with L norm at most k.

To construct all such circulations, we find a fundamental cycle basis C1,,Cr. This takes O(rm) time. Next, we generate circulations of the form i=1rλiCi one by one where kλik. The sequence of circulations is generated using a generalized Gray code, so two consecutive circulations differ in only a single cycle [11]. Therefore, it takes O(m) time to generate a circulation from the previous circulation by augmenting a cycle. The total running time for generating all circulations with L norm no larger than k is O((2k+1)rm).

Corollary 7.

Let f be the min-cost circulation in G. The number of circulations g in G such that fgr is O((2r+1)r) and they can be found in O((2r+1)rm) time, where m is the number of edges in G.

Proof.

By Lemma 6, there can be at most (2r+1)r circulations with L norm no larger than r in B. These circulations can be computed in O((2r+1)rm) time. For each such circulation h, we compute g=f+h. This takes an additional O(m) time per circulation. Thus, the total time complexity is O((2r+1)rm).

4.3 Min-Cost Tour in a Given Homology Class

Recall that we are interested in finding the min-cost tour in the homology class [f] for some given circulation f in G=(V,ER), where f(a)=1 for aR.

If f is already connected, then we are done, as we can find a tour that uses each edge e exactly |f(e)| times. Otherwise, we need to find a tour in [f]. Note that in addition to the edges in supp(f), some extra edges might need to be used by the tour. Naturally, this would look like a Steiner Asymmetric Traveling Salesman Problem (ATSP), defined as finding the shortest tour in a directed graph that visits each terminal vertex at least once, which is even harder to work with than ATSP. However, because we are restricting the tour to be in [f], this limits the kinds of edges we add to the tour: Specifically, these are edges outside supp(f) that must be traversed both forward and backward exactly once.

To address this, we take G and contract each connected component of supp(f) into a single vertex. Let the resulting graph be B. Note that only edges in E might remain, as all arcs in R have been contracted. Therefore, B is a graph instead of a mixed graph. Moreover, we change the weight of the edges to twice their original cost since each edge would be traversed once forward and once backward. We then reduce the problem to the minimum Steiner tree problem.

For a graph G=(V,E) with a set of terminal vertices TV, the vertices in VT are called Steiner vertices. A Steiner tree is a tree that contains all the vertices in T. The minimum Steiner tree with respect to a weight function w:E+ is a Steiner tree of minimum weight.

We are interested in solving the minimum Steiner tree problem on B, where the terminals are the contracted vertices. This would give us the minimum set of extra edges the tour must traverse to be connected. The minimum Steiner tree problem is NP-hard in general, but note that B has only a bounded number of Steiner branch vertices. The number of Steiner branch vertices in B is at most the number of branch vertices in B. Indeed, the contracted vertices are not Steiner vertices, so all Steiner branch vertices must be branch vertices in B. The Steiner vertices of degree 1 and 2 can be preprocessed away, so only Steiner branch vertices remain [7]. Hence, the minimum Steiner tree can be solved in O(2kMST(m)) time for a graph containing k Steiner branch vertices and m edges [12].

Since B can have at most m edges, the minimum Steiner tree in B can be found in O(2kMST(m)) time. This leads us to the following theorem.

Theorem 8.

For an input mixed graph G=(V,ER), let f be a circulation where f(a)=1 for each aR. Finding a min-cost tour in [f] takes O(p+2kMST(m)) time, where m=|E|, p=|R|, and k is the number of branch vertices in B=(V,E).

4.4 Putting Everything Together

Combining all the components, we obtain the desired algorithm as described in Figure 2. We are now ready to prove our main theorem.

Theorem 9.

SCP(H) with an input graph of n vertices and p requests can be solved in O(MST(n)+p) time.

Proof.

Let B be the base graph and R be the set of requests. For a fixed topology, the cycle rank r and the number of branch vertices k are constants. If m is the number of edges in B, then m=n+r1=O(n).

Consider the algorithm in Figure 2. By Theorem 5, computing the min-cost circulation takes O(m+p) time. By Corollary 7, enumerating all O(1) possible circulations close to the min-cost circulation takes O(m) time. By Theorem 8, finding the min-cost tour in the homology class of each circulation takes O(MST(m)+p) time. Using the fact that m=O(n), we obtain a final running time of O(MST(n)+p).

The running time in Theorem 9 is optimal. The term MST(n) is unavoidable, as finding the minimum spanning tree on n edges can be reduced to SCP(P) in linear time, where P is a path [9]. Moreover, since reading the input requires at least O(p) time, the term p is also tight.

Now, in terms of FPT, what we showed is that the SCP problem with the cycle rank and the number of branch vertices as parameters is FPT.

Figure 2: Pseudocode for solving SCP given base graph B, requests R and cost function c.
Figure 3: Finding the min-cost tour for a given graph G and a circulation f on G.

5 Discussion

We simplified the presentation of our results, but our approach can be extended in multiple ways without increasing the time complexity.

As mentioned earlier in the preliminaries, we can handle duplicate arcs in R without altering the complexity of the algorithm. Indeed, this is done by allowing demands on arcs in R. Specifically, we can introduce a function d:R such that, for each aR, the tour is required to traverse a exactly d(a) times. This generalization can be handled by simply fixing the value of the flow to be d(a) for each aR during our computation.

Our current cost function is symmetric; for an edge e=uv, traversing from u to v or from v to u incurs the same cost. However, our algorithm can be adapted to work with asymmetric cost functions as well by splitting the edge into two edges of opposite orientation with different costs and only allowing non-negative flows. During Steiner tree computations, merge the two edges and give the merged edge a weight equal to the cost of traversing the edge forward and backward once.

Although we provide an optimal algorithm, the constant factor hidden in the time complexity is extremely large, making it impractical for real-world applications. If the fixed topology has cycle rank r and k branch vertices, then the hidden factor is 2O(2r)+(2r+1)r2k. The bottleneck of 2O(2r) arises from solving the min-cost flow problem on a graph that is a tree with r additional edges. In practice, one can use theoretically slower, off-the-shelf min-cost flow algorithms to avoid the exponential dependency on r. However, there are two potential avenues for improvement:

  1. 1.

    The problem is very close to linear programming in constant dimensions, so techniques other than Megiddo’s algorithm might be beneficial for improving the running time.

  2. 2.

    In the proof of Theorem 5, the matrix A is a network matrix, but Zemel’s algorithm is designed for arbitrary matrices. This presents another opportunity for optimization.

The factor (2r+1)r is unlikely to be significantly improved if we need to enumerate all elementary circulations, as their number can be exponential with respect to r. However, there may be strategies to consider only a much smaller subset of elementary circulations. For example, our enumeration of elementary circulations is independent of cost information, which could potentially be leveraged to reduce the search space.

References

  • [1] Ravindra K Ahuja, Thomas L Magnanti, and James B Orlin. Network flows. Pearson, Upper Saddle River, NJ, February 1993.
  • [2] Mikhail J. Atallah and S. Rao Kosaraju. Efficient Solutions to Some Transportation Problems with Applications to Minimizing Robot Arm Travel. SIAM Journal on Computing, 17(5):849–869, October 1988. doi:10.1137/0217053.
  • [3] Bela Bollobas. Modern graph theory. Graduate Texts in Mathematics. Springer, New York, NY, 1998 edition, December 2013.
  • [4] Hadrien Cambazard and Nicolas Catusse. Fixed-parameter algorithms for rectilinear steiner tree and rectilinear traveling salesman problem in the plane. European Journal of Operational Research, 270(2):419–429, 2018. doi:10.1016/j.ejor.2018.03.042.
  • [5] Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS), pages 612–623, 2022. doi:10.1109/FOCS54457.2022.00064.
  • [6] Ángel Corberán and Gilbert Laporte. Arc Routing. Society for Industrial and Applied Mathematics, Philadelphia, PA, 2015. doi:10.1137/1.9781611973679.
  • [7] Cees Duin. Preprocessing the Steiner Problem in Graphs, pages 175–233. Springer US, Boston, MA, 2000. doi:10.1007/978-1-4757-3171-2_10.
  • [8] G.N. Frederickson and D.J. Guan. Nonpreemptive Ensemble Motion Planning on a Tree. Journal of Algorithms, 15(1):29–60, July 1993. doi:10.1006/jagm.1993.1029.
  • [9] Greg N. Frederickson. A Note on the Complexity of a Simple Transportation Problem. SIAM Journal on Computing, 22(1):57–61, February 1993. doi:10.1137/0222005.
  • [10] Greg N. Frederickson, Matthew S. Hecht, and Chul E. Kim. Approximation algorithms for some routing problems. SIAM Journal on Computing, 7(2):178–193, 1978. doi:10.1137/0207017.
  • [11] Dah-Jyh Guan. Generalized gray codes with applications. In Proc. Natl. Sci. Counc. Repub. China Part A Phys. Sci. Eng., volume 22(6), pages 841–848. Citeseer, 1998.
  • [12] S. L. Hakimi. Steiner’s problem in graphs and its implications. Networks, 1(2):113–133, 1971. doi:10.1002/net.3230010203.
  • [13] Bahman Kalantari and Iraj Kalantari. A Linear-Time Algorithm for Minimum Cost Flow on Undirected One-Trees, pages 217–223. Springer US, Boston, MA, 1995. doi:10.1007/978-1-4613-3554-2_13.
  • [14] Jianping Li, Xiaofei Liu, Weidong Li, Li Guan, and Junran Lichen. Approximation algorithms for the generalized stacker crane problem. In Xiaofeng Gao, Hongwei Du, and Meng Han, editors, Combinatorial Optimization and Applications, pages 95–102, Cham, 2017. Springer International Publishing. doi:10.1007/978-3-319-71150-8_8.
  • [15] Christian Liebchen and Romeo Rizzi. Classes of cycle bases. Discrete Applied Mathematics, 155(3):337–355, 2007. doi:10.1016/j.dam.2006.06.007.
  • [16] Nimrod Megiddo. Linear programming in linear time when the dimension is fixed. J. ACM, 31(1):114–127, January 1984. doi:10.1145/2422.322418.
  • [17] Kees Jan Roodbergen and René de Koster. Routing order pickers in a warehouse with a middle aisle. European Journal of Operational Research, 133(1):32–43, 2001. doi:10.1016/S0377-2217(00)00177-6.
  • [18] Yuhui Sun, Wei Yu, and Zhaohui Liu. Approximation algorithms for some min–max and minimum stacker crane cover problems. Journal of Combinatorial Optimization, 45(1):18, 2022. doi:10.1007/s10878-022-00955-x.
  • [19] David P. Williamson. Network Flow Algorithms. Cambridge University Press, 2019.
  • [20] Wei Yu, Rui-Yong Dai, and Zhao-Hui Liu. Approximation Algorithms for Multi-vehicle Stacker Crane Problems. Journal of the Operations Research Society of China, 11(1):109–132, March 2023. doi:10.1007/s40305-021-00372-7.
  • [21] Eitan Zemel. An O(n) algorithm for the linear multiple choice knapsack problem and related problems. Information Processing Letters, 18(3):123–128, March 1984. doi:10.1016/0020-0190(84)90014-0.