A Faster Deterministic Algorithm for Mader’s \(\mathcal{S}\)-Path Packing


Abstract

Given an undirected graph \(G = (V, E)\) with a set of terminals \(T\subseteq V\) partitioned into a family \(\mathcal{S}\) of disjoint blocks, find the maximum number of vertex-disjoint paths whose endpoints belong to two distinct blocks while no other internal vertex is a terminal. This problem is called Mader’s \(\mathcal{S}\)-path packing. It has been of remarkable interest as a common generalization of the non-bipartite matching and vertex-disjoint \(s\text{-}t\) paths problem.

This paper presents a new deterministic algorithm for this problem via known reduction to linear matroid parity. The algorithm utilizes the augmenting-path algorithm of Gabow and Stallmann (1986), while replacing costly matrix operations between augmentation steps with a faster algorithm that exploits the original \(\mathcal{S}\)-path packing instance. The proposed algorithm runs in \(O(mnk)\) time, where \(n = |V|\), \(m = |E|\), and \(k = |T|\le n\). This improves on the previous best bound \(O(mn^{\omega})\) for deterministic algorithms, where \(\omega\ge2\) denotes the matrix multiplication exponent.

1 Introduction↩︎

Let \(G = (V, E)\) be an undirected graph of \(n = |V|\) vertices and \(m = |E|\) edges. We are given a set \(T\subseteq V\) of \(k = |T|\) terminals as well as a partition \(\mathcal{S}\) of \(T\) into non-empty blocks. A path on \(G\) is said to be a \(\mathcal{S}\)-path if and only if each endpoint is a terminal in a distinct block from the other and no internal vertex is a terminal. A \(\mathcal{S}\)-path packing is a set of vertex-disjoint \(\mathcal{S}\)-paths. Mader’s \(\mathcal{S}\)-path packing problem is to find a \(\mathcal{S}\)-path packing of the maximum possible size.

This problem was raised by Gallai [1], generalizing both the non-bipartite matching problem (when \(\mathcal{S}= \{\{v\}\mid v\in V\}\)) and the vertex-disjoint \(R\)-\(S\) paths problem (when \(\mathcal{S}= \{R,S\}\) for mutually disjoint terminal sets \(R,S\subseteq V\)). For an equivalent form of the openly disjoint \(T\)-paths problem, Mader [2] established a good characterization by proving a min-max theorem. Lovász [3], [4] then showed a reduction to matroid matching and developed the first polynomial-time algorithm. A linear representation of this reduction is described in Schrijver [5], allowing for more efficient algorithms via linear matroid parity. Schrijver [6] also provided a short inductive proof of the min-max theorem of Mader.

The fastest known deterministic algorithm to Mader’s problem entirely relies on reduction to linear matroid parity as well. Despite the reduced instance having a special structure, the running time of this algorithm is \(O(mn^{\omega})\) directly implied by Gabow and Stallmann’s augmenting-path algorithm [7], which has been the fastest deterministic solution for general linear matroid parity problems. Note that \(\omega\ge 2\) denotes the matrix multiplication exponent with the current best bound of \(\omega < 2.371552\) due to [8].

We overcome this shortcoming and present a new deterministic algorithm for Mader’s problem. Our approach circumvents matrix inversion and multiplication used to create and update an auxiliary graph in the Gabow–Stallmann algorithm [7]. Instead, we update the auxiliary graph using combinatorial techniques, which exploit an interpretation of the parity solution as a subgraph of \(G\) in the original instance of Mader’s problem. The proposed algorithm thus involves only simple arithmetic operations over a finite field \(\mathbb{F}_q\) of order \(q=O(|\mathcal{S}|)\). Throughout this paper, we adopt the uniform-cost model of computation, i.e., any single arithmetic operation over \(\mathbb{F}_q\) is performed in constant time.

Theorem 1. There exists a deterministic algorithm that solves Mader’s \(\mathcal{S}\)-path packing problem in \(O(mnk)\) time.

1.1 Related work↩︎

1.1.0.1 Randomized algorithms

Extending the algebraic algorithms for bipartite matching by Sankowski [9], Harvey [10] provided efficient randomized algebraic algorithms for matching and linear matroid intersection. Subsequently, Cheung, Lau, and Leung [11] extended this approach to the linear matroid parity problem. A direct application of the resulting algorithm to Mader’s \(\mathcal{S}\)-paths packing problem runs in \(O(mn^{\omega-1})\) time. Furthermore, they improved their randomized algorithm to run in \(O(n^\omega)\) time, faster than ours for dense graphs.

1.1.0.2 Combinatorial algorithms

Subsequently to the min-max theorem, considerable efforts has been made to obtain efficient combinatorial algorithms. For the non-zero \(A\)-path packing problem on group-labeled graphs, which generalizes Mader’s \(\mathcal{S}\)-paths packing problem, Chudnovsky, Cunningham, and Geelen [12] provided an \(O(n^5)\)-time combinatorial algorithm. This algorithm yields the Edmonds–Gallai type structural decomposition independently of the prior work of Sebő and Szegő [13]. Furthermore, Pap [14] devised a polynomial-time combinatorial algorithm based on a different type of graph decomposition, which generalizes the odd ear-decomposition of factor-critical graphs [15].

1.1.0.3 Mader matroid

It is known that Mader’s \(\mathcal{S}\)-path problem has a more intrinsic matroid interpretation, known as Mader matroid [5]. The Mader matroid is a matroid \((T, \mathcal{I})\) on the ground set \(T\) where each basis is the set of endpoints of a distinct maximum \(\mathcal{S}\)-path packing, that is, \[\begin{align} \mathcal{I} = \{T'\subseteq T \mid There exists a \mathcal{S}-path packing that covers T'.\}. \end{align}\] Schrijver’s question of whether every Mader matroid is a gammoid [5], [16] has been positively resolved by Pap [17], which hence implies a linear representation of the Mader matroid [18]. However, the representation requires as large a field as \(2^{|T|}\), and it is still unknown if there exists a deterministic algorithm to obtain the representation in polynomial time.

1.1.0.4 Mader delta-matroid

A recent work [19] establishes the linear delta-matroid structure in Mader’s \(\mathcal{S}\)-path problem, called the Mader delta-matroid, in parallel with the relation between the matching matroid and the matching delta-matroid. Specifically, the Mader delta-matroid is defined as the delta-matroid \((T,\mathcal{F})\) with \[\begin{align} \mathcal{F}= \{T' \subseteq T \mid The exists a \mathcal{S}-path packing whose endpoints are T'. \}. \end{align}\] This interpretation also allows them to show that any instance \((G,T,\mathcal{S})\) can be converted to a mimicking instance \((\tilde{G},T,\mathcal{S})\) with \(|V(\tilde{G})| = O(|T|^3)\). However, they rely on randomized algorithms to compute the skew-symmetric matrix representing the Mader delta-matroid, involving proper instantiation of variables in the Tutte matrix. Efficient algorithms to find the maximum feasible set of a linear delta-matroid either require such a representation explicitly [20] or use the separation oracle, which is also computationally hard for the Mader delta-matroid, in a greedy approach [21], [22].

1.1.0.5 Variants/Generalizations of Mader’s problem

Prior to Mader’s theorem, Gallai [1] showed the min-max theorem for the special case of \(\mathcal{S}= \{\{t\}\mid t\in T\}\) known as \(T\)-path packing, which contributes to the \(O(k^2)\)-vertex kernel for feedback vertex set [23]. The edge-disjoint companion of Mader’s problem is solved by a combinatorial algorithm [24] in \(O(m^2)\) time, faster than handling line graphs in Mader’s problem. Mader’s problem and its variants has been generalized to weighted graphs in many forms [25][28], among which Yamaguchi [29] established the first polynomial-time algorithm for the minimum weight \(\mathcal{S}\)-path packing via reduction to weighted linear matroid parity [30], [31]. Other extended notions include non-returning \(A\)-paths [14], [32] as well as non-zero \(A\)-paths in group-labelled graphs [12], [33][35]. Half-integral, or more generally, node-capacitated \(\mathcal{S}\)-path packing has also been ddressed [36][39], playing a key role in many FPT algorithms [40].

2 Reduction to linear matroid parity↩︎

It suffices to consider the case when the graph \(G\) is connected, as the general graph can be handled in each connected component; this would not increase the total running time from what [thm:main] guarantees for the original instance. We also assume \(|\mathcal{S}|\ge 2\); otherwise the problem would be trivial. As is common in the literature, we denote \(E[X, Y]\mathrel{\vcenter{:}}= \{\{x,y\}\in E \mid x\in X,y\in Y\}\) for any \(X,Y\subseteq V\). In particular, for each \(X\subseteq V\), we denote \(E[X]\mathrel{\vcenter{:}}= E[X, X]\) and let \(G[X] = (X, E[X])\) denote the subgraph induced by \(X\).

We use the following simplified form of Schrijver’s linear representation [5]. A similar formulation is used in [11]. Let \(q\) be the least prime number that satisfies \(|\mathcal{S}|<q\leq 2\,|\mathcal{S}|\). Note that \(q\) is odd as \(|\mathcal{S}|\geq 2\). Let \(\mathbb{F}_q\) be the finite field of order \(q\) so that each terminal \(t\in S\in\mathcal{S}\) can be labelled with a scalar \(\theta(t)\in\mathbb{F}_q\) uniquely to its block \(S\) i.e., \[\begin{align} \theta(t) = \theta(t') \quad&\Leftrightarrow\quad (\{t,t'\}\subseteq S,\;\exists S\in\mathcal{S}), &\forall t,t'\in T. \end{align}\] Each edge \(e\in E\) is also equipped with an arbitrary bijection \(\mu_e:e\to\{1,-1\}\subseteq\mathbb{F}_q\) that orients \(e\), although this orientation has no effect on the output or any combinatorial operation of our algorithm. We then introduce a \((2n-k)\)-dimensional vector space \(W\) over \(\mathbb{F}_q\) spanned by a singleton \(\vb*{t}\) for each \(t\in T\) as well as vertex-twins \(\vb*{v^\circ}\), \(\vb*{v^\bullet}\) for each \(v\in V\setminus T\). Then, let \[\begin{align} K \mathrel{\vcenter{:}}= \{\vb*{t} \mid t\in T\} \end{align}\] denote the set of all singletons, and let also vertex-twins for each terminal \(t\in T\) be defined as \[\begin{align} \vb*{t^{\circ}} \mathrel{\vcenter{:}}= \vb*{t},\quad \vb*{t^{\bullet}} \mathrel{\vcenter{:}}= \theta(v)\vb*{t}.\label{eq:def-terminal-twin} \end{align}\tag{1}\] Let \(\ell_e \mathrel{\vcenter{:}}= \{\vb*{e}^\circ, \vb*{e}^\bullet\}\) be a line that consists of edge-twins: \[\begin{align} \vb*{e}^\circ &\mathrel{\vcenter{:}}= \mu_e(u) \vb*{u^{\circ}} + \mu_e(v) \vb*{v^{\circ}},\tag{2}\\ \vb*{e}^\bullet &\mathrel{\vcenter{:}}= \mu_e(u) \vb*{u^{\bullet}} + \mu_e(v) \vb*{v^{\bullet}}\tag{3} \end{align}\] for each edge \(e\in E\), and let \[\begin{align} L \mathrel{\vcenter{:}}= \bigcup_{e\in E} \ell_e = \{\vb*{e}^\circ,\vb*{e}^\bullet \mid e \in E\} \end{align}\] denote the union of all lines. Let also \[\begin{align} J \mathrel{\vcenter{:}}= L \cup \{\vb*{v^{\circ}},\vb*{v^{\bullet}} \mid v\in V\} \end{align}\] contain all vertex-twins and edge-twins. A vector set is said to be feasible if and only if it is a union of some lines plus some singletons. Then let \(\mathcal{U}\subseteq 2^{W}\) denote the collection of all feasible sets i.e., \[\begin{align} \mathcal{U}\mathrel{\vcenter{:}}= \left\{\{\vb*{t} \mid t\in S\} \cup \{\vb*{e}^\circ, \vb*{e}^\bullet \mid e\in F\} \mid S\subseteq T, F\subseteq E \right\}, \end{align}\] and let \(\mathcal{I}\subseteq\mathcal{U}\) (resp. \(\mathcal{B}\subseteq\mathcal{U}\)) be the collection of all feasible independent sets (resp. all feasible bases of \(W\)). For any feasible set \(U\in\mathcal{U}\), we define \[\begin{align} T[U] &\mathrel{\vcenter{:}}= \{t\in T \mid \vb*{t}\in U \},\\ E[U] &\mathrel{\vcenter{:}}= \{e\in E\mid \ell_{e} = \{\vb*{e}^\circ,\vb*{e}^\bullet\}\subseteq U\},\\ G[U] &\mathrel{\vcenter{:}}= (V, E[U]). \end{align}\] as the subset of terminals, the subset of edges, and the subgraph induced by \(U\), respectively. Let \(\mathcal{Z}(U)\) denote the set of all connected components in \(G[U]\). More precisely, \(\mathcal{Z}(U)\) is a partition of \(V\), where each \(Z\in\mathcal{Z}(U)\) is a maximal set of vertices that induces a connected subgraph \(G[Z]\). [lem:walk], which immediately follows by definition, leads to [lem:base-exist] ensuring the existence of a feasible base.

Lemma 1. If there is a walk on the graph \(G\) that passes vertices \(v_0, v_1 \ldots, v_k\in V\) and edges \(e_1,\ldots,e_k\in E\) in this order, we have \[\begin{align} \sum_{i=1}^k \mu_{e_i}(v_i)\, \vb*{e_i^\circ} &= \vb*{v_k^\circ} - \vb*{v_0^\circ},\label{eq:path-circ}\\ \sum_{i=1}^k \mu_{e_i}(v_i)\, \vb*{e_i^\bullet} &= \vb*{v_k^\bullet} - \vb*{v_0^\bullet}.\label{eq:path-bullet} \end{align}\] {#eq: sublabel=eq:eq:path-circ,eq:eq:path-bullet} Particularly, the following also holds if \(v_0,v_k\in T\): \[\begin{align} \theta(v_k)\sum_{i=1}^k \mu_{e_i}(v_i) \vb*{e}_i^\circ - \sum_{i=1}^k \mu_{e_i}(v_i) \vb*{e}_i^\bullet = (\theta(v_k)-\theta(v_0))\vb*{v_0}.\label{eq:path-terminal} \end{align}\qquad{(1)}\]

Lemma 2. There exists a feasible base \(B\in\mathcal{B}\) that contains all singletons i.e., \(K\subseteq B\).

Proof. As \(G\) is connected, there is a spanning forest \((V, F)\) of \(G\) consisting of \(|T|\) connected components (trees) each of which contains a distinct terminal in \(T\). Then, the feasible set \[\begin{align} B \mathrel{\vcenter{:}}= K \cup \bigcup_{f\in F} \ell_f = K \cup \{\vb*{f}^\circ,\vb*{f}^\bullet \mid f\in F\} \end{align}\] is a base of \(W\) due to [lem:walk]. ◻

We are ready to consider a linear matroid parity problem in the form of finding a feasible base \(B\in\mathcal{B}\) that maximizes \(|E[B]|\), where it holds by definition that \[\begin{align} |T[B]| + 2 |E[B]| &= |B| = \dim\, W = 2n - k, &\forall B\in\mathcal{B}. \label{eq:base-size} \end{align}\tag{4}\] Note that [lem:base-exist] makes this equivalent to seeking the maximum number of lines, or the maximum matching \(M\) such that \(\{\vb*{e}^\circ,\vb*{e}^\bullet \mid e\in M\}\) is independent. To see the validity of this reduction, we establish the following characterization of feasible independent sets and of feasible bases.

Lemma 3. A feasible set \(U\in\mathcal{U}\) is independent i.e., \(U\in\mathcal{I}\) if and only if every \(Z\in\mathcal{Z}(U)\) satisfies all the following conditions:

  1. \((G[U])[Z]\) is a tree.

  2. \(|Z\cap S| \le 1,\quad\forall S\in\mathcal{S}\).

  3. \(|Z\cap T| + |Z \cap T[U]| \le 2\).

Proof. For any \(U\in\mathcal{U}\) and \(Z\in\mathcal{Z}(U)\), let \[\begin{align} U[Z] &\mathrel{\vcenter{:}}= \{\vb*{t} \mid t \in Z\cap T[U] \} \cup \bigcup_{e\in E[Z] \cap E[U]}\ell_e\\ &= \{\vb*{t} \mid t \in Z\cap T[U] \} \cup \{\vb*{e}^\circ, \vb*{e}^\bullet \mid e\in E[Z] \cap E[U]\}. \end{align}\] By the definition 13 , \(U\in\mathcal{U}\) is independent if and only if \(U[Z]\) is independent for every \(Z\in\mathcal{Z}(U)\).

First, we prove the necessity in the lemma. Fix any feasible independent set \(U\in\mathcal{I}\) and \(Z\in\mathcal{Z}[U]\). Eq. ?? –?? in [lem:walk] requires that no cycle exists in \((G[U])[Z]\) for the independence of \(U\), which ensures [item:tree]; Eq. ?? necessitates [item:one-per-block] for \(U\in\mathcal{I}\) as well. It also follows from the definition 13 that \[\begin{align} |U[Z]| = \rank\, U[Z] &\le |Z\cap T| + 2|Z\setminus T|\\ &= 2(|Z| - 1) - |Z\cap T| + 2\\ &= |U[Z]| - |Z\cap T[U]| - |Z\cap T| + 2, \end{align}\] which yields 3 as desired.

Next, we prove the sufficiency in the lemma. Fix an arbitrary independent set \(U\in\mathcal{U}\) that satisfies [item:tree]3. As initially noted, it suffices to show that \(U[Z]\in\mathcal{I}\) for every \(Z\in\mathcal{Z}(U)\); given 3, we separately deal with three cases depending on \(|Z\cap T|\in\{0,1,2\}\). When \(Z\cap T = \emptyset\), it is easy from [item:tree] and the definition 13 to see \(U[Z]\in\mathcal{I}\). If \(Z\cap T = \{t\}\) for some \(t\), then 3 implies either \(Z\cap T[U] = \emptyset\) or \(Z\cap T[U] = \{t\}\). It hence follows from [item:tree]3 and Eq. ?? –?? that \[\begin{align} \rank (U\cup\{\vb*{t}\})[Z] = 1 + 2(|Z| - 1) = |(U\cup\{\vb*{t}\})[Z]|,\label{eq:proof-indep-one-terminal} \end{align}\tag{5}\] which requires \(U[Z]\in\mathcal{I}\). Finally, when \(|Z\cap T| = \{t_1, t_2\}\) for some \(t_1\neq t_2\), we have \(Z\cap T[U] = \emptyset\) from 3. Here, Eq. ?? –?? together imply that two singletons \(\vb*{t}_1,\vb*{t}_2\) as well as twins \(\vb*{v}^\circ,\vb*{v}^\bullet\) for every \(v\in Z\setminus T\) can be all represented by \(U\). This guarantees that \[\begin{align} \rank U[Z] = 2 + 2(|Z| - 2) = 2(|Z| - 1) = |U[Z]|, \end{align}\] or equivalently \(U[Z]\in\mathcal{I}\) as desired. ◻

Lemma 4. A feasible independent set \(I\in\mathcal{I}\) is a base of \(W\) i.e., \(I\in\mathcal{B}\) if and only if every \(Z\in\mathcal{Z}(U)\) satisfies all the following conditions:

  1. \(Z\cap T\neq\emptyset\),

  2. \(|Z\cap T| + |Z \cap T[I]| = 2\).

Proof. First, we prove the necessity in the lemma. Fix any feasible base \(I\in\mathcal{B}\) and \(Z\in\mathcal{Z}(I)\). If \(Z\cap T = \emptyset\), there exists some edge \(e\in E[Z, V\setminus Z]\) since \(G\) is connected; then despite \(I\cup\ell_e\in\mathcal{I}\), we would have \(e\notin E[I]\) i.e., \(\ell_{e}\not\subseteq I\) by definition of \(Z\), which contradicts \(I\in\mathcal{B}\). Hence, [item:non-empty] is necessary. It remains for 3 to show that \(|Z\cap T[I]| \ge 1\) holds when \(|Z\cap T| = 1\), given the necessity of 3 and [item:non-empty]. In this case, Eq. 5 follows from the proof of [lem:indep-char] with \(U\) replaced by \(I\), which requires \(\vb*{t}\in I\) for \(I\in\mathcal{B}\) as desired.

Next, we prove the sufficiency in the lemma. Fix any feasible independent set \(I\in\mathcal{I}\) for which [item:non-empty]-4 holds for every \(Z\in\mathcal{Z}(I)\). It then follows that \[\begin{align} |I| = |T[I]| + 2|E[I]| &= \sum_{Z\in\mathcal{Z}(I)} (|Z\cap T[I]| + 2|E[Z] \cap E[I]|)\\ &= \sum_{Z\in\mathcal{Z}(I)} (2 - |Z\cap T| + 2(|Z| - 1))\\ &= \sum_{Z\in\mathcal{Z}(I)} (2|Z| - |Z\cap T|) = 2|V| - |T| = \dim W, \end{align}\] or equivalently \(I\in\mathcal{B}\) as desired. ◻

Proposition 1 ([5]). There exists a \(\mathcal{S}\)-path packing of size \(p\) if and only if there exists a feasible base \(B\in\mathcal{B}\) that contains \(n - k + p\) lines i.e., \(|E[B]| = n - k + p\).

Proof. First, we prove the necessity in the proposition. Let \(P_1,\ldots,P_p\) be arbitrary \(p\) vertex-disjoint \(\mathcal{S}\)-paths such that \(s_i, t_i\in T\) be the endpoints of each path \(P_i\) i.e., \[\begin{align} \{t_1^{(i)}, t_2^{(i)}\} &\mathrel{\vcenter{:}}= P_i\cap T,&\forall i\in\{1,\ldots,p\}. \end{align}\] Notice \(2p\le |T| = k\) as these paths are vertex-disjoint. Let also \[\begin{align} \{ t_1^{(0)}, \ldots, t_{k - 2p}^{(0)} \} &\mathrel{\vcenter{:}}= T\setminus \{t_1^{(i)}, t_2^{(i)} \mid i\in\{1,\ldots,p\} \} \end{align}\] denote the set of terminals disjoint from the \(\mathcal{S}\)-paths. We can construct a spanning forest \(H = (V, F)\) that satisfies all the following conditions:

  • The vertex set \(V\) is partitioned into \(k - p\) connected components \(X_1,\ldots,X_p,Y_1,\ldots,Y_{k-2p}\).

  • For each \(i\in\{1,\ldots,p\}\), the subgraph \(H[X_i]\) contains the \(\mathcal{S}\)-path \(P_i\) and satisfies \(X_i\cap T = \{t_1^{(i)}, t_2^{(i)}\}\).

  • For each \(j\in\{1,\ldots,k-2p\}\), we have \(Y_j\cap T = \{t_j^{(0)}\}\).

Now, we define a feasible set \(B\in\mathcal{U}\) as follows: \[\begin{align} B \mathrel{\vcenter{:}}= \{ \vb*{t}_1^{(0)}, \ldots, \vb*{t}_{k - 2p}^{(0)} \} \cup \bigcup_{f\in F} \ell_f = \{ \vb*{t}_1^{(0)}, \ldots, \vb*{t}_{k - 2p}^{(0)} \} \cup \{ \vb*{f}^\circ, \vb*{f}^\bullet \mid f\in F \}. \end{align}\] [lem:indep-char] and [lem:base-char] ensures \(B\in\mathcal{B}\), while it is clear that \[\begin{align} |E[B]| = |F| = n - k + p. \end{align}\]

Next, we prove the sufficiency in the proposition. Let \(B\in\mathcal{B}\) be an arbitrary feasible base that consists of \(n-k+p\) lines plus \(k-2p\) singletons. Then, Lemmas [lem:indep-char] and [lem:base-char] imply that \(G[B]\) partitions \(V\) into connected \(k-p\) components \(X_1,\ldots,X_p,Y_1,\ldots,Y_{k-2p}\) that satisfies the following:

  • For each \(i\in\{1,\ldots,p\}\), we have \(|X_i\cap T| = 2\) as well as \(|X_i \cap S| \le 1,\;\forall S\in\mathcal{S}\).

  • For each \(j\in\{1,\ldots,k-2p\}\), we have \(|Y_j\cap T| = 1\).

Each connected subgraph \((G[B])[X_i]\) has a \(\mathcal{S}\)-path, which constitutes a desired \(\mathcal{S}\)-path packing of size \(p\). ◻

3 Revisiting the Gabow–Stallmann algorithm↩︎

Before presenting our algorithm, we review how Gabow and Stallmann [7] would solve the linear matroid parity problem. Their augmenting-path method generalizes similar concepts for matroid intersection [41], [42] and that for non-bipartite matching [43][45]. It starts from an arbitrary feasible base \(B\in\mathcal{B}\), and then repeatedly updates the feasible base \(B\) with \(E[B]\) increased by \(2\) (and hence \(T[B]\) decreased by \(1\)) per iteration. Specifically, a new feasible base \(B'\) results from taking the symmetric difference of the original base \(B\) and an augmenting path \(\vb*{s},\ell_0,\ell_1,\ldots,\ell_{2p},\vb*{t}\) consisting of an odd number of lines with two singletons, as follows: \[\begin{align} B' \setminus B &= \bigcup_{i=0}^p \ell_{2i},\\ B \setminus B' &= \{\vb*{s},\vb*{t}\}\cup \bigcup_{i=1}^p \ell_{2i - 1}. \end{align}\] Such an appropriate path is sought on a bipartite graph between \(B\) and \(L\setminus B\), called a dependence graph [7], which connects \(\vb*{b}\in B\) and \(\vb*{w}\in L\setminus B\) with a scalar \(d(\vb*{w}, \vb*{b})\) if and only if \(\vb*{b}\) has a non-zero coefficient \(d(\vb*{w}, \vb*{b})\) in the representation of \(\vb*{w}\) with respect to \(B\). In other words, augmenting a given feasible base \(B\in\mathcal{B}\) requires us to compute the (unique) matrix \(D(B) = (d(\vb*{w},\vb*{b}))_{\vb*{w}\in L\setminus B,\,\vb*{b}\in B}\in\mathbb{F}_q^{(L\setminus B)\times B}\) that enjoys \[\begin{align} \vb*{w} &= \sum_{\vb*{b}\in B} d(\vb*{w}, \vb*{b}) \vb*{b}, &\forall\vb*{w}\in L\setminus B, \label{eq:def-depmat} \end{align}\tag{6}\] which we refer to as the dependence matrix for the feasible base \(B\in\mathcal{B}\) in this paper.

Here, it must be carefully considered that their original setting differs from 2 in the definition of singletons and hence in the underlying vector space; they define singletons as copies of all single twins in \(L\). These singletons can be padded to each matching to form a base of \(\mathrm{span}\,L\), not of \(W\). However, the singletons do not serve as anything but dummy vectors to ensure the existence of as large an independent set as the number of lines, which obviously bounds the size of any matching. Indeed, replacing these singletons still preserves every guarantee in their proof as long as this property holds, which implies [prop:aug].

Proposition 2 ([7]). There exists a deterministic algorithm that, given any feasible base \(B\) coupled with the dependence matrix \(D(B)\), returns either a new feasible base \(B'\) enjoying \(|E[B']| = |E[B]| + 1\), or reports if \(E[B]\) is the maximum possible, in \(O(mn)\) time and \(O(mn)\) space under the uniform cost model.

As a whole, the bottleneck of their algorithm lies in repeatedly computing the dependence matrix \(D(B)\) each time \(B\) is updated by augmentation. By the above definition 6 of \(D(B)\), this generally requires \(O(m n^{\omega-1})\) time [46], which dominates the \(O(mn)\) time for a single augmentation guaranteed in [prop:aug]. Since \(\rank\,L\le n\), the time complexity amounts to \(O(mn^{\omega})\) in total [7].

Figure 1: The main algorithm for Mader’s \(\mathcal{S}\)-path packing problem.

Figure 2: The subroutine to initialize a feasible base.

Figure 3: The subroutine to compute the dependence matrix for a feasible base.

Figure 4: The subroutine to restore a \(\mathcal{S}\)-path packing from a feasible base.

4 Our algorithm↩︎

By utilizing the modified definition of singletons in 2, we achieve the following two points that help us improve upon the time complexity described in 3. First, [lem:base-exist] allows us to start from a “nice” base \(B\in\mathcal{B}\) that accepts at most \(\left\lfloor\frac{|T|}{2}\right\rfloor\) augmentations until it becomes optimal; this bound may not hold in Gabow and Stallmann’s setting. Second, the feasible base \(B\in\mathcal{B}\) maintained by 1 now has a helpful interpretation as shown in [lem:indep-char] and [lem:base-char]. These are fundamental in our key subroutine to more efficiently compute the dependence matrix \(D(B)\) as detailed below.

We present 1 as our main routine, which is shown to correctly solve Mader’s problem and achieve [thm:main]. It is fundamentally similar to the flow of the Gabow–Stallmann algorithm discussed in 3, where the number of lines \(|E[B]|\) in a feasible base \(B\in\mathcal{B}\) is increased by one per iteration until \(|E[B]|\) becomes as large as possible. The following discussions in this section establish [thm:correct].

Proposition 3. The main algorithm (1)* correctly solves Mader’s \(\mathcal{S}\)-path packing problem for an arbitrary given instance \((G, T, \mathcal{S})\).*

4.1 Initializing the feasible base↩︎

The subroutine defined in 2 obtains the initial feasible base \(B\in\mathcal{B}\) constructed in the proof of [lem:base-exist]. We can compute the desired spanning forest by expanding disjoint vertex sets each of which contains exactly one terminal.

4.2 Computing the dependence matrix↩︎

The subroutine obtains the dependence matrix \(D(B)\) for a given feasible base \(B\) as defined in 3. Here, it clearly suffices to compute the (unique) matrix \(C = (c(\vb*{w},\vb*{b}))_{\vb*{w}\in J,\,\vb*{b}\in B}\in\mathbb{F}_q^{J\times B}\) that enjoys \[\begin{align} \vb*{w} &= \sum_{\vb*{b}\in B} c(\vb*{w}, \vb*{b})\vb*{b} &\forall\vb*{w}\in J, \label{eq:def-auxmat} \end{align}\tag{7}\] as the representation of each vector in \(L\setminus B\) is obtained from those of at most two vectors in \(J\) by definition.

Starting from each terminal chosen as the root, this algorithm traverses the forest \(G[B]\) while computing the representation of each singleton and vertex-twin with respect to \(B\). Each connected component \(Z\) of \(G[B]\) is scanned exactly \(|Z\cap T| = 2 - |Z\cap T[B]| \in\{1,2\}\) times due to [lem:base-char]. The former case, when \(Z\cap T = \{t\}\) for some \(t\), can be handled simply; since \(Z\cap T[B] = \{t\}\) and thus \(\vb*{t}\in B\) hold then, we can compute the representation of twins \(v^\circ, v^\bullet\) for each \(v\in Z\) during the traversal from the root \(t\).

In the latter case when \(Z\cap T[B] = \emptyset\) and \(Z\cap T = \{t_1, t_2\}\) for some \(t_1\neq t_2\), assume \(t_1\) is chosen as the root before \(t_2\) without loss of generality. We compute a tentative representation of \(v^\circ - t_1, v^\bullet - t_1\) for each \(v\in Z\) during the first traversal from the root \(t_1\). Before the second traversal from the root \(t_2\), the correct representation of the singleton \(\vb*{t}_2\) can be now obtained using the tentative representations and Eq. 1 , which finally allows us to propagate the correct representations across \(Z\).

4.3 Augmenting the feasible base↩︎

The subroutine designates an oracle that takes in the current feasible base \(B\in\mathcal{B}\) coupled with the dependence matrix \(D(B)\), and executes the augmenting-path algorithm claimed by [prop:aug]. We assume that, when \(B\) allows for no augmentation as it has already reached the maximum \(E[B]\), just returns the original feasible base \(B\); otherwise, an updated feasible base is returned, and the loop continues in 1.

4.4 Restoring a \(\mathcal{S}\)-path packing↩︎

After all iterations, the subroutine defined in 4 recovers the maximum \(\mathcal{S}\)-path packing in the same way as we prove the sufficiency in [prop:pack-base]. Recall the decomposition we use in the proof; due to [lem:indep-char] and [lem:base-char], the spanning forest \(G[B]\) has \(E[B] - n + k\) connected components that contains exactly two terminals from \(T\setminus T[B]\) and from distinct blocks, while any other component contains exactly one from \(T[B]\). 4 traverses each of the former components from one of the two terminals while creating back pointers, which are then used to construct a \(\mathcal{S}\)-path from the other terminal.

5 Complexity↩︎

In this section, we analyze the time and space complexity of 1 to prove [prop:main-time] below. We assume the uniform model where any single arithmetic operation over the field \(\mathbb{F}_q\) of size \(O(|\mathcal{S}|)\) is done in constant time. Recall that \(n = |V|\), \(m = |E| \ge n - 1\) as \(G\) is connected, and \(|\mathcal{S}| \le k = |T| \le n = |V|\).

Lemma 5. The main routine in 1 can find the finite field \(\mathbb{F}_q\) in \(O(|\mathcal{S}|^2)\) time.

Proof. One can naively find the minimum prime number greater than \(|\mathcal{S}|\) in \(O(|\mathcal{S}|^2)\) time. ◻

Lemma 6. The subroutine in 2 runs in \(O(n)\) time and \(O(n)\) space.

Proof. Let \(B\in\mathcal{B}\) be the feasible base finally obtained. Each vertex or edge of \(G[B]\) is scanned at most once in the traversal. One can also avoid scanning any edge in \(E\setminus E[B]\) by efficient implementation. ◻

Lemma 7. The subroutine in 3 runs in \(O(mn)\) time and \(O(mn)\) space.

Proof. As described in 4.2, each vertex or edge of \(G[B]\) is scanned at most twice. On visiting each vertex, the representations of its corresponding vertex-twins are coordinate-wise computed in \(O(n)\) time. Lastly, we compute \(O(mn)\) entries of the dependence matrix, which dominates in the total complexity. ◻

Lemma 8. The loop in 1 iterates at most \(\left\lfloor\frac{k}{2}\right\rfloor\) times.

Proof. The claim follows from [prop:aug] and Eq. 4 . ◻

Lemma 9. The subroutine in 4 runs in \(O(n)\) time and \(O(n)\) space.

Proof. Each vertex or edge in \(G[B]\) is scanned at most once in the traversal. Constructing the \(\mathcal{S}\)-paths takes \(O(n)\) time and \(O(n)\) space in total as those paths are vertex-disjoint. ◻

Proposition 4. The main routine 1 runs in \(O(mnk)\) time and \(O(mn)\) space.

Proof. The claim follows from Lemmas 59 as well as [prop:aug]. ◻

Finally, Propositions [thm:correct] and [prop:main-time] together derive [thm:main].

References↩︎

[1]
Tibor Gallai. Maximum-minimum tze und verallgemeinerte Faktoren von Graphen. Acta Mathematica Hungarica, 12(1-2):131–173, 1961.
[2]
Wolfgang Mader. ber die Maximalzahl kreuzungsfreier \(H\)-Wege. Archiv der Mathematik, 31(1):387–402, 1978.
[3]
László Lovász. The matroid matching problem. Algebraic Methods in Graph Theory, 2:495–517, 1978.
[4]
László Lovász. Matroid matching and some applications. Journal of Combinatorial Theory, Series B, 28(2):208–236, 1980.
[5]
Alexander Schrijver. Combinatorial Optimization: Polyhedra and Efficiency. Springer-Verlag, 2003.
[6]
Alexander Schrijver. A short proof of Mader’s \(\mathcal{S}\)-paths theorem. Journal of Combinatorial Theory, Series B, 82(2):319–321, 2001.
[7]
Harold N. Gabow and Matthias Stallmann. An augmenting path algorithm for linear matroid parity. Combinatorica, 6(2):123–150, 1986.
[8]
Virginia Vassilevska Williams, Yinzhan Xu, Zixuan Xu, and Renfei Zhou. New bounds for matrix multiplication: from alpha to omega. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3792–3835. SIAM, 2024.
[9]
Piotr Sankowski. Weighted bipartite matching in matrix multiplication time. In Proceedings of the 33rd international conference on Automata, Languages and Programming-Volume Part I, pages 274–285, 2006.
[10]
Nicholas J. A. Harvey. Algebraic algorithms for matching and matroid problems. SIAM Journal on Computing, 39(2):679–702, 2009.
[11]
Ho Yee Cheung, Lap Chi Lau, and Kai Man Leung. Algebraic algorithms for linear matroid parity problems. ACM Transactions on Algorithms (TALG), 10(3):1–26, 2014.
[12]
Maria Chudnovsky, William H. Cunningham, and Jim Geelen. An algorithm for packing non-zero \(A\)-paths in group-labelled graphs. Combinatorica, 28(2):145–161, 2008.
[13]
András Sebő and László Szegő. The path-packing structure of graphs. In Proceedings of the 10th International Conference on Integer Programming and Combinatorial Optimization (IPCO), pages 256–270. Springer, 2004.
[14]
Gyula Pap. Packing non-returning \(A\)-paths algorithmically. Discrete Mathematics, 308(8):1472–1488, 2008.
[15]
László Lovász. A note on factor-critical graphs. Studia Sci. Math. Hungar, 7(11):279–280, 1972.
[16]
Alexander Schrijver. Is each mader matroid a gammoid? https://homepages.cwi.nl/ lex/, 2001.
[17]
Gyula Pap. Mader matroids are gammoids. Technical Report TR-2006-17, Egerváry Research Group on Combinatorial Optimization (EGRES), 2006.
[18]
John H. Mason. On a class of matroids arising from paths in graphs. Proceedings of the London Mathematical Society, 3(1):55–74, 1972.
[19]
Magnus Wahlström. Representative set statements for delta-matroids and the Mader delta-matroid. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 780–810. SIAM, 2024.
[20]
Tomohiro Koana and Magnus Wahlström. Faster algorithms on linear delta-matroids. arXiv preprint arXiv:2402.11596, 2024.
[21]
André Bouchet. Greedy algorithm and symmetric matroids. Mathematical Programming, 38:147–159, 1987.
[22]
Ramaswamy Chandrasekaran and Santosh N. Kabadi. Pseudomatroids. Discrete Mathematics, 71(3):205–217, 1988.
[23]
Stéphan Thomassé. A \(4k^2\) kernel for feedback vertex set. ACM Transactions on Algorithms (TALG), 6(2):1–8, 2010.
[24]
Satoru Iwata and Yu Yokoi. Finding maximum edge-disjoint paths between multiple terminals. SIAM Journal on Computing, 52(5):1230–1268, 2023.
[25]
Alexander V. Karzanov. Edge-disjoint \(T\)-paths of minimum total cost. Technical Report STAN-CS-92-1465, Department of Computer Science, Stanford University, 1993.
[26]
Alexander V. Karzanov. Multiflows and disjoint paths of minimum total cost. Mathematical Programming: Series A and B, 78(2):219–242, 1997.
[27]
Gyula Pap. A polynomial time algorithm for weighted node-disjoint \(S\)-paths. In Proceedings of the 7th Hungarian-Japanese Symposium on Discrete Mathematics and Its Applications, pages 322–331, 2011.
[28]
Hiroshi Hirai and Gyula Pap. Tree metrics and edge-disjoint \(S\)-paths. Mathematical Programming, 147(1):81–123, 2014.
[29]
Yutaro Yamaguchi. Shortest disjoint \(\mathcal{S}\)-paths via weighted linear matroid parity. In Proceedings of the 27th International Symposium on Algorithms and Computation (ISAAC). Schloss-Dagstuhl-Leibniz Zentrum für Informatik, 2016.
[30]
Satoru Iwata and Yusuke Kobayashi. A weighted linear matroid parity algorithm. SIAM Journal on Computing, 51(2):STOC17–238, 2021.
[31]
Gyula Pap. Weighted linear matroid matching. In Proceedings the 8th Japanese-Hungarian Symposium on Discrete Mathematics and Its Applications, pages 411–413, 2013.
[32]
Gyula Pap. Packing non-returning \(A\)-paths. Combinatorica, 27(2):247–251, 2007.
[33]
Maria Chudnovsky, Jim Geelen, Bert Gerards, Luis Goddyn, Michael Lohman, and Paul Seymour. Packing non-zero \(A\)-paths in group-labelled graphs. Combinatorica, 26:521–532, 2006.
[34]
Shin-ichi Tanigawa and Yutaro Yamaguchi. Packing non-zero \(A\)-paths via matroid matching. Discrete Applied Mathematics, 214:169–178, 2016.
[35]
Yutaro Yamaguchi. Packing \(A\)-paths in group-labelled graphs via linear matroid parity. SIAM Journal on Discrete Mathematics, 30(1):474–492, 2016.
[36]
Gyula Pap. Some new results on node-capacitated packing of \(A\)-paths. In Proceedings of the 39th Annual ACM Symposium on Theory of Computing (STOC), pages 599–604, 2007.
[37]
Gyula Pap. Strongly polynomial time solvability of integral and half-integral node-capacitated multiflow problems. Technical Report TR-2008-12, Egerváry Research Group on Combinatorial Optimization (EGRES), 2008.
[38]
Maxim A. Babenko. A fast algorithm for the path 2-packing problem. Theory of Computing Systems, 46(1):59–79, 2009.
[39]
Hiroshi Hirai. A dual descent algorithm for node-capacitated multiflow problems and its applications. ACM Transactions on Algorithms (TALG), 15(1):1–24, 2018.
[40]
Yoichi Iwata, Yutaro Yamaguchi, and Yuichi Yoshida. 0/1/all CSPs, half-integral \(A\)-path packing, and linear-time FPT algorithms. In Proceedings of the 59th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 462–473. IEEE, 2018.
[41]
Stein Krogdahl. The dependence graph for bases in matroids. Discrete Mathematics, 19(1):47–59, 1977.
[42]
Eugene L. Lawler. Combinatorial Optimization: Networks and Matroids. Holt, Rinehart and Winston, 1976.
[43]
Harold N. Gabow. An efficient implementation of Edmonds’ algorithm for maximum matching on graphs. Journal of the ACM (JACM), 23(2):221–234, 1976.
[44]
Jack Edmonds. Paths, trees, and flowers. Canadian Journal of Mathematics, 17:449–467, 1965.
[45]
Shimon Even and Oded Kariv. An \(O (N^{2.5})\) algorithm for maximum matching in general graphs. In Proceedings of the 16th Annual Symposium on Foundations of Computer Science (FOCS), pages 100–112, 1975.
[46]
Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.

  1. Department of Mathematical Informatics, The University of Tokyo, Tokyo 113-8656, Japan, and Institute for Chemical Reaction Design and Discovery, Hokkaido University, Sapporo, Hokkaido 001-0021, Japan. ↩︎

  2. Department of Mathematical Informatics, The University of Tokyo, Tokyo 113-8656, Japan. ↩︎