Abstract
An intensive line of research on fixed parameter tractability of integer programming is focused on exploiting the relation between the sparsity of a constraint matrix A and the norm of the elements of its Graver basis. In particular, integer programming is fixed parameter tractable when parameterized by the primal treedepth and the entry complexity of A, and when parameterized by the dual treedepth and the entry complexity of A; both these parameterization imply that A is sparse, in particular, the number of its nonzero entries is linear in the number of columns or rows, respectively. We study preconditioners transforming a given matrix to a rowequivalent sparse matrix if it exists and provide structural results characterizing the existence of a sparse rowequivalent matrix in terms of the structural properties of the associated column matroid. In particular, our results imply that the \(\ell _1\)norm of the Graver basis is bounded by a function of the maximum \(\ell _1\)norm of a circuit of A. We use our results to design a parameterized algorithm that constructs a matrix rowequivalent to an input matrix A that has small primal/dual treedepth and entry complexity if such a rowequivalent matrix exists. Our results yield parameterized algorithms for integer programming when parameterized by the \(\ell _1\)norm of the Graver basis of the constraint matrix, when parameterized by the \(\ell _1\)norm of the circuits of the constraint matrix, when parameterized by the smallest primal treedepth and entry complexity of a matrix rowequivalent to the constraint matrix, and when parameterized by the smallest dual treedepth and entry complexity of a matrix rowequivalent to the constraint matrix.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Integer programming is a problem of fundamental importance in combinatorial optimization with many theoretical and practical applications. From the computational complexity point of view, integer programming is very hard: it is one of the 21 problems shown to be NPcomplete in the original paper on NPcompleteness by Karp [37] and remains NPcomplete even when the entries of the constraint matrix are zero and one only. On the positive side, Kannan and Lenstra [35, 45] showed that integer programming is polynomially solvable in fixed dimension, i.e., with a fixed number of variables. Another prominent tractable case is when the constraint matrix is totally unimodular, i.e., all determinants of its submatrices are equal to 0 or \(\pm 1\), in which case all vertices of the feasible region are integral and so linear programming algorithms can be applied.
Integer programming (IP) is known to be tractable for instances where the constraint matrix of an input instance enjoys a certain block structure. The two most important cases are the cases of 2stage IPs due to Hemmecke and Schultz [27], further investigated in particular in [1, 13, 31, 39, 40, 44], and nfold IPs introduced by De Loera et al. [15] and further investigated in particular in [11, 12, 19, 26, 34, 44]. IPs of this kind appear in various contexts, see e.g. [32, 41, 42, 48]. These (theoretical) tractability results complement well a vast number of empirical results demonstrating tractability of instances with a block structure, e.g. [2,3,4, 22, 23, 38, 49,50,51].
There tractability results on IPs with sparse constraint matrices can be unified and generalized using depth and width parameters of graphs derived from constraint matrices. Ganian and Ordyniak [24] initiated this line of study by showing that IPs with bounded primal treedepth \({{\,\textrm{td}\,}}_P(A)\) of a constraint matrix A and bounded coefficients of the constraint matrix A and the right hand side b can be solved efficiently. Levin, Onn and the second author [44] widely generalized this result by showing that IPs with bounded \(\Vert A\Vert _\infty \) and bounded primal treedepth \({{\,\textrm{td}\,}}_P(A)\) or dual treedepth \({{\,\textrm{td}\,}}_D(A)\) of the constraint matrix A can be solved efficiently; such IPs include 2stage IPs, nfold IPs, and their generalizations.
Most of the existing algorithms for IPs assume that the input matrix is already given in its sparse form. This is a substantial drawback as existing algorithms cannot be applied to instances that are not sparse but can be transformed to an equivalent sparse instance. For example, the matrix in the left below, whose dual treedepth is 5, can be transformed by elementary row operations to the matrix with dual treedepth 2 given in the right; a formal definition of treedepth is given in Sect. 2.1, however, just the visual appearance of the two matrices indicates which is likely to be more amenable to algorithmic techniques.
This transformation is an example of a preconditioner that transforms an instance of integer programming to an equivalent one that is more amenable to existing methods for solving integer programming and whose existence we investigate in this paper.
Preconditioning a problem to make it computationally simpler is a ubiquitous preprocessing step in mathematical programming solvers. An interesting link between matroid theory and preconditioners to sparsity of matrices was exhibited by Chan and Cooper together with the second, third and fourth authors [8, 9]. In particular, they proved the following structural characterization of matrices that are rowequivalent, i.e., can be transformed by elementary row operations, to a matrix with small dual treedepth: a matrix is rowequivalent to one with small dual treedepth if and only if the column matroid of the matrix has small contraction\(^*\)depth (see Theorem 1 below). In this paper, we further explore this uncharted territory by providing a structural characterization of matrices rowequivalent to matrices with small primal treedepth, designing efficient algorithms for finding preconditioners with respect to both primal and dual treedepth, and relating complexity of circuits and Graver basis of constraint matrices.
1.1 Our contribution
We now describe the results presented in this paper in detail. We opted not to interrupt the presentation of our results with various notions, some of which may be standard for some readers, and rather collect all definitions in a single section—Sect. 2. We remark that the primal treedepth of a matrix A is a structural parameter that measures the complexity of interaction between the columns of A, and the dual treedepth of a matrix A measures the complexity of interaction between the rows of A.
1.1.1 Characterization of depth parameters
Observe that the column matroid of the matrix is preserved by row operations, i.e., the column matroid of rowequivalent matrices is the same. The main structural result of [8, 9] is the following characterization of the existence of a rowequivalent matrix with small dual treedepth in terms of the structural parameter of the column matroid [8, Theorem 1]. We remark that the term branchdepth was used in [8, 9] in line with the terminology from [36] but as there is a competing notion of branchdepth [16], we decided to use a different name for this depth parameter throughout the paper to avoid confusion.
Theorem 1
For every nonzero matrix A, it holds that the smallest dual treedepth of a matrix rowequivalent to A is equal to the contraction\(^*\)depth of M(A), i.e., \({{\,\textrm{td}\,}}_D^*(A)={{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(A)\).
We discover structural characterizations of the existence of a rowequivalent matrix with small primal treedepth and the existence of a rowequivalent matrix with small incidence treedepth.
Theorem 2
For every matrix A, it holds that the smallest primal treedepth of a matrix rowequivalent to A is equal to the deletiondepth of M(A), i.e., \({{\,\textrm{td}\,}}_P^*(A)={{\,\textrm{dd}\,}}(A)\).
Theorem 3
For every matrix A, it holds that the smallest incidence treedepth of a matrix rowequivalent to A is equal to contraction\(^*\)deletiondepth of M(A) increased by one, i.e., \({{\,\textrm{td}\,}}_I^*(A)={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\).
1.1.2 Interplay of circuit and graver basis complexity
Graver bases play an essential role in designing efficient algorithms for integer programming. We show that the maximum \(\ell _1\)norm of a circuit of a matrix A and the maximum \(\ell _1\)norm of an element of the Graver basis of A, which are denoted by \(c_1(A)\) and \(g_1(A)\), respectively, are functionally equivalent.
Theorem 4
There exists a function \(f_1:\mathbb {N}\rightarrow \mathbb {N}\) such that the following holds for every rational matrix A with \(\dim \ker A>0\):
The parameter \(c_1(A)\) can be related to dual treedepth and entry complexity as follows (we have opted throughout the paper to use entry complexity rather than \(\Vert A\Vert _\infty \) as this permits to formulate our results for rational matrices rather than integral matrices, which is occasionally more convenient).
Theorem 5
Every rational matrix A with \(\dim \ker A>0\) is rowequivalent to a rational matrix \(A'\) with \({{\,\textrm{td}\,}}_D(A')\le c_1(A)^2\) and \({{\,\textrm{ec}\,}}(A')\le 2\lceil \log _2 (c_1(A)+1)\rceil \).
Our results together with Theorem 9 imply that the following statements are equivalent for every rational matrix A:

The \(\ell _1\)norm of every circuit of A, i.e., \(c_1(A)\), is bounded.

The \(\ell _1\)norm of every element of the Graver basis of A, i.e., \(g_1(A)\), is bounded.

The matrix A is rowequivalent to a matrix with bounded dual treedepth and bounded entry complexity.

The contraction\(^*\)depth of the matroid M(A) is bounded, and the matrix A is rowequivalent to a matrix with bounded entry complexity (with any dual treedepth).
1.1.3 Algorithms to compute matrices with small depth parameters
We also construct parameterized algorithms for transforming an input matrix to a rowequivalent matrix with small treedepth and entry complexity if one exists. First, we design a parameterized algorithm for computing a rowequivalent matrix with small primal treedepth and small entry complexity if one exists.
Theorem 6
There exists a function \(f:\mathbb {N}^2\rightarrow \mathbb {N}\) and a fixed parameter algorithm for the parameterization by d and e that for a given rational matrix A:

either outputs that A is not rowequivalent to a matrix with primal treedepth at most d and entry complexity at most e, or

outputs a matrix \(A'\) that is rowequivalent to A, its primal treedepth is at most d and entry complexity is at most f(d, e).
The following algorithm for computing a rowequivalent matrix with small dual treedepth was presented in [8, 9].
Theorem 7
There exists a function \(f:\mathbb {N}^2\rightarrow \mathbb {N}\) and a fixed parameter algorithm for the parameterization by d and e that for a given rational matrix A with entry complexity at most e:

either outputs that A is not rowequivalent to a matrix with dual treedepth at most d, or

outputs a matrix \(A'\) that is rowequivalent to A, its dual treedepth is at most d and entry complexity is at most f(d, e).
We improve the algorithm by replacing the parameterization by the entry complexity of an input matrix with the parameterization by the entry complexity of the to be constructed matrix. Note that if a matrix A has entry complexity e and is rowequivalent to a matrix with dual treedepth d, then Theorem 7 yields that A is rowequivalent to a matrix with dual treedepth d and entry complexity bounded by a function of d and e. Hence, the algorithm given below applies to a wider set of input matrices than the algorithm from Theorem 7.
Theorem 8
There exists a function \(f:\mathbb {N}^2\rightarrow \mathbb {N}\) and a fixed parameter algorithm for the parameterization by d and e that, for a given rational matrix A:

either outputs that A is not rowequivalent to a matrix with dual treedepth at most d and entry complexity at most e, or

outputs a matrix \(A'\) that is rowequivalent to A, its dual treedepth is at most d and entry complexity is at most f(d, e).
We point out the following difference between the cases of primal and dual treedepth. As mentioned, if a matrix A has entry complexity e and is rowequivalent to a matrix with dual treedepth d, then A is rowequivalent to a matrix with dual treedepth d and entry complexity bounded by a function of d and e. However, the same is not true in the case of primal treedepth. The entry complexity of every matrix with primal treedepth equal to one that is rowequivalent to the following matrix A is linear in the number of rows of A, quite in a contrast to the case of dual treedepth.
1.1.4 Fixed parameter algorithms for integer programming
One of the open problems in the area, e.g. discussed during the Dagstuhl workshop 19041 “New Horizons in Parameterized Complexity”, has been whether integer programming is fixed parameter tractable when parameterized by \(g_1(A)\), i.e., by the \(\ell _1\)norm of an element of the Graver basis of the constraint matrix A. Our results on the interplay of dual treedepth, the circuit complexity and the Graver basis complexity of a matrix yield an affirmative answer. The existence of appropriate preconditioners that we establish in this paper implies that integer programming is fixed parameter tractable when parameterized by

\(g_1(A)\), i.e., the \(\ell _1\)norm of the Graver basis of the constraint matrix,

\(c_1(A)\), i.e., the \(\ell _1\)norm of the circuits of the constraint matrix,

\({{\,\textrm{td}\,}}^*_P(A)\) and \({{\,\textrm{ec}\,}}(A)\), i.e., the smallest primal treedepth and entry complexity of a matrix rowequivalent to the constraint matrix, and

\({{\,\textrm{td}\,}}^*_D(A)\) and \({{\,\textrm{ec}\,}}(A)\), i.e., the smallest dual treedepth and entry complexity of a matrix rowequivalent to the constraint matrix.
We believe that our new tractability results significantly enhance the toolbox of tractable IPs as the nature of our tractability conditions substantially differ from prevalent blockstructured sparsitybased tractability conditions. The importance of availability of various forms of tractable IPs can be witnessed by nfold IPs, which were shown fixedparameter tractable in [26], and, about a decade later, their applications have become ubiquitous, see e.g. [6, 7, 10, 11, 28, 32, 33, 42, 43].
1.1.5 Hardness results
As our algorithmic results involve computing depth decompositions of matroids for various depth parameters in a parameterized way, we establish computational hardness of these parameters in Theorem 12, primarily for the sake of completeness of our exposition. In particular, computing the following matroid parameters is NPcomplete:

deletiondepth,

contractiondepth,

contractiondeletiondepth,

contraction\(^*\)depth, and

contraction\(^*\)deletiondepth.
2 Preliminaries
In this section, we fix the notation used throughout the paper. We start with general notation and we then fix the notation related to graphs, matrices and matroids.
The set of all positive integers is denoted by \(\mathbb {N}\) and the set of the first k positive integers by [k]. If A is a linear space, we write \(\dim A\) for its dimension. If K is a subspace of A, the quotient space A/K is the linear space of the dimension \(\dim A\dim K\) that consists of cosets of A given by K with the natural operations of addition and scalar multiplication; see e.g. [25] for further details. The quotient space A/K can be associated with a linear subspace of A of dimension \(\dim A\dim K\) formed by exactly a single vector from each coset of A given by K; we will often view the quotient space as such a subspace of A and write \(w+K\) for the coset containing a vector w. For example, if A is \(\mathbb {R}^3\) and K is the linear space generated by (0, 0, 1), A/K can be associated with (or viewed as) the 2dimensional space formed by vectors (x, y, 0), \(x,y\in \mathbb {R}\).
2.1 Graphs
All graphs considered in this paper are loopless simple graphs unless stated otherwise. If G is a graph, then we write V(G) and E(G) for the vertex set and the edge set of G, respectively. If W is a subset of vertices of a graph G, then \(G\setminus W\) is the graph obtained by removing the vertices of W (and all edges incident with them), and G[W] is the graph obtained by removing all vertices not contained in W (and all edges incident with them). If F is a subset of edges of a graph G, then \(G\setminus F\) is the graph obtained by removing the edges contained in F and G/F is the graph obtained by contracting all edges contained in F and removing resulting loops and parallel edges (while keeping one edge from each group of parallel edges).
We next define the graph parameter treedepth, which is the central graph parameter in this paper. The height of a rooted tree is the maximum number of vertices on a path from the root to a leaf, and the height of a rooted forest, i.e., a graph whose each component is a rooted tree, is the maximum height of its components. The depth of a rooted tree is the maximum number of edges on a path from the root to a leaf, and the depth of a rooted forest is the maximum depth of its components. Note that the height and the depth of a rooted tree always differ by one; we use both notions to avoid cumbersome way of expressing that would otherwise require adding or subtracting one. The closure \({{\,\textrm{cl}\,}}(F)\) of a rooted forest F is the graph obtained by adding edges from each vertex to all its descendants. Finally, the treedepth \({{\,\textrm{td}\,}}(G)\) of a graph G is the minimum height of a rooted forest F such that the closure \({{\,\textrm{cl}\,}}(F)\) of the rooted forest F contains G as a subgraph. See Fig. 1 for an example. It can be shown that the pathwidth, and so the treewidth, of any graph is at most its treedepth decreased by one; see e.g. [14] for a more detailed discussion of the relation of treedepth, pathwidth and treewidth, and their algorithmic applications.
2.2 Matroids
We next review basic definitions from matroid theory; we refer to the book of Oxley [46] for detailed exposition. A hereditary collection of subsets of a set is a collection closed under taking subsets; in particular, every nonempty hereditary collection of subsets contains the empty set. A matroid M is a pair \((X,\mathcal {I})\), where \(\mathcal {I}\) is a nonempty hereditary collection of subsets of X that satisfies the augmentation axiom, i.e., if \(X'\in \mathcal {I}\), \(X''\in \mathcal {I}\) and \(X'<X''\), then there exists an element \(x\in X''\setminus X'\) such that \(X'\cup \{x\}\in \mathcal {I}\). The set X is the ground set of M and the sets contained in \(\mathcal {I}\) are referred to as independent. We often refer to elements of the ground set of M to as elements of the matroid M, and if e is an element of (the ground set of) M, we also write \(e\in M\). Two important examples of matroids are vector matroids and graphic matroids. A vector matroid is a matroid whose ground set is formed by vectors and independent sets are precisely sets of linearly independent vectors (note that the augmentation axiom follows from the Steinitz exchange lemma). A graphic matroid is a matroid whose ground set is formed by edges of a graph and independent sets are precisely acyclic sets of edges, i.e., sets not containing a cycle.
The rank of a subset \(X'\) of the ground set X, which is denoted by \(r_M(X')\) or simply by \(r(X')\) if M is clear from the context, is the maximum size of an independent subset of \(X'\) (it can be shown that all maximal independent subsets of \(X'\) have the same cardinality); the rank of the matroid M, which is denoted by r(M), is the rank of its ground set. Note that in the case of vector matroids, the rank of \(X'\) is exactly the dimension of linear space generated by \(X'\). A basis of a matroid M is a maximal independent subset of the ground set of M and a circuit is a minimal subset of the ground set of M that is not independent. In particular, if \(X'\) is a circuit of M, then \(r(X')=X'1\) and every proper subset of \(X'\) is independent. An element x of a matroid M is a loop if \(r(\{x\})=0\), an element x is a bridge if it is contained in every basis of M, and two elements x and \(x'\) are parallel if \(r(\{x\})=r(\{x'\})=r(\{x,x'\})=1\). Note that in the case of vector matroids, two nonloop elements are parallel if and only if they are nonzero multiple of each other. If M is a matroid with ground set X, the dual matroid, which is denoted by \(M^*\), is the matroid with the same ground set X such that \(X'\subseteq X\) is independent in \(M^*\) if and only if \(r_M(X\setminus X')=r(M)\); in particular, \(r_{M^*}(X')=r_M(X\setminus X')+X'r(M)\) for every \(X'\subseteq X\).
For a field \(\mathbb {F}\), we say that a matroid M is \(\mathbb {F}\)representable if every element of M can be assigned a vector from \(\mathbb {F}^{r(M)}\) in such a way that a subset of the ground set of M is independent if and only if the set of assigned vectors is linearly independent. In particular, an element of M is a loop if and only if it is assigned the zero vector and two nonloop elements of M are parallel if and only if they are nonzero multiples of each other. Such an assignment of vectors of \(\mathbb {F}^{r(M)}\) to the elements of M is an \(\mathbb {F}\)representation of M. Clearly, a matroid M is \(\mathbb {F}\)representable if and only if it is isomorphic to the vector matroid given by its \(\mathbb {F}\)representation. Matroids representable over the 2element field are referred to as binary matroids. We say that a matroid M is \(\mathbb {F}\)represented if the matroid M is given by its \(\mathbb {F}\)representation. If a particular field \(\mathbb {F}\) is not relevant in the context, we just say that a matroid M is represented to express that it is given by its representation.
Let M be a matroid with a ground set X. The matroid kM for \(k\in \mathbb {N}\) is the matroid obtained from M by introducing \(k1\) parallel elements to each nonloop element and \(k1\) additional loops for each loop; informally speaking, every element of M is “cloned” to k copies. Note that a subset \(X'\) of the elements of kM is independent if and only if it does not contains two clones of the same element and the set of the elements of M corresponding to those contained in \(X'\) is independent. Observe that if M is a vector matroid, then kM is the vector matroid obtained by adding \(k1\) copies of each vector forming M. Similarly, if M is a graphic matroid associated with a graph G, then kM is the graphic matroid obtained from the graph G by duplicating each edge \(k1\) times.
If \(X'\subseteq X\), then the restriction of M to \(X'\), which is denoted by \(M\left[ X'\right] \), is the matroid with the ground set \(X'\) such that a subset of \(X'\) is independent in \(M\left[ X'\right] \) if and only if it is independent in M. In particular, the rank of \(M\left[ X'\right] \) is \(r_M(X')\). For example, if M is a graphic matroid associated with a graph G, then the restriction of M to \(X'\) is the graphic matroid associated with the spanning subgraph of G with edge set \(X'\). The matroid obtained from M by deleting \(X'\) is the restriction of M to \(X\setminus X'\) and is denoted by \(M\setminus X'\).
The contraction of M by \(X'\), which is denoted by \(M/X'\), is the matroid with the ground set \(X\setminus X'\) such that a subset \(X''\) of \(X\setminus X'\) is independent in \(M/X'\) if and only if \(r_M(X''\cup X')=X''+r_M(X')\). If \(X'\) is a single element set and e is its only element, we write \(M\setminus e\) and M/e instead of \(M\setminus \{e\}\) and \(M/\{e\}\), respectively. If M is a graphic matroid associated with a graph G and e is an edge of G, then M/e is the graphic matroid associated with the graph obtained from G by contracting the edge e (while keeping all resulting loops and parallel edges). If an \(\mathbb {F}\)representation of M is given and \(X'\) is a subset of the ground set of M, then an \(\mathbb {F}\)representation of \(M/X'\) can be obtained from the \(\mathbb {F}\)representation of M by considering the representation in the quotient space by the linear hull of the vectors representing the elements of \(X'\). This leads us to the following definition: if M is an \(\mathbb {F}\)represented matroid and A is a linear subspace of \(\mathbb {F}^{r(M)}\), then the matroid M/A is the \(\mathbb {F}\)represented matroid with the representation of M in the quotient space by A. Note that the ground sets of M and M/A are the same, in particular, M and M/A have the same number of elements.
A matroid M is connected if every two distinct elements of M are contained in a common circuit. We remark that the property of being contained in a common circuit is transitive [46, Proposition 4.1.2], i.e., if the pair of elements e and \(e'\) is contained in a common circuit and the pair \(e'\) and \(e''\) is also contained in a common circuit, then the pair e and \(e''\) is also contained in a common circuit. If M is an \(\mathbb {F}\)represented matroid with at least two elements, then M is connected if and only if M has no loops and there do not exist two nontrivial linear spaces A and B of \(\mathbb {F}^{r(M)}\) such that \(A\cap B\) contains the zero vector only and every element of M is contained in A or B (the linear space \(\mathbb {F}^{r(M)}\) would be the direct sum of the linear spaces A and B). Also observe that if M is a graphic matroid associated with a graph G, then the matroid M is connected if and only if the graph G is 2connected.
A component of a matroid M is an inclusionwise maximal connected restriction of M; a component is trivial if it consists of a single loop, and it is nontrivial otherwise. If M is a vector matroid, then each nontrivial component of M can be associated with a linear space such that each element of M is contained in one of the linear spaces and the linear hull of all elements of M is the direct sum of the linear spaces. We often identify components of a matroid M with their element sets. Using this identification, it holds that a subset \(X'\) of a ground set of a matroid M is a component of M if and only if \(X'\) is a component of \(M^*\) (we use this equivalence to prove some of our hardness results in Sect. 6). We remark that \((M^*)^*=M\) for every matroid M, and if e is an element of a matroid M, then \((M/e)^*=M^*\setminus e\) and \((M{\setminus } e)^*=M^*/e\).
2.3 Matrices
In this section, we define notation related to matrices. If \(\mathbb {F}\) is a field, we write \(\mathbb {F}^{m\times n}\) for the set of matrices with m rows and n columns over the field \(\mathbb {F}\). If A is a rational matrix, the entry complexity \({{\,\textrm{ec}\,}}(A)\) is the maximum length of a binary encoding of its entries, i.e., the maximum of \(\lceil \log _2(p+1)\rceil +\lceil (\log _2 q+1) \rceil \) taken over all entries p/q of A (where p and q are always assumed to be coprime). If A is an integral matrix, then \({{\,\textrm{ec}\,}}(A)=\Theta (\log \Vert A\Vert _{\infty })\). Throughout the paper, we use the entry complexity rather than the \(\ell _\infty \)norm of matrices as this permits formulating our results for rational matrices rather than integral matrices only.
A rational matrix A is zintegral for \(z\in \mathbb {Q}\) if every entry of A is an integral multiple of z. We say that two matrices A and \(A'\) are rowequivalent if one can be obtained from another by elementary row operations, i.e., by repeatedly adding a multiple of one row to another and multiplying a row by a nonzero element. Observe that if A and \(A'\) are rowequivalent matrices, then their kernels are the same. For a matrix A, we define M(A) to be the represented matroid whose elements are the columns of A. Again, if matrices A and \(A'\) are rowequivalent, then the matroids M(A) and \(M(A')\) are the same.
If A is a matrix, the primal graph of A is the graph whose vertices are columns of A and two vertices are adjacent if there exists a row having nonzero elements in the two columns associated with the vertices; the dual graph of A is the graph whose vertices are rows of A and two vertices are adjacent if there exists a column having nonzero elements in the two associated rows; the incidence graph of A is the bipartite graph with one part formed by rows of A and the other part by columns of A and two vertices are adjacent if the entry in the associated row and in the associated column is nonzero. See Fig. 2 for an example. The primal treedepth of A, denoted by \({{\,\textrm{td}\,}}_P(A)\), is the treedepth of the primal graph of A, the dual treedepth of A, denoted by \({{\,\textrm{td}\,}}_D(A)\), is the treedepth of the dual graph of A, and the incidence treedepth of A, denoted by \({{\,\textrm{td}\,}}_I(A)\), is the treedepth of the incidence graph of A. Finally, \({{\,\textrm{td}\,}}_P^*(A)\) is the smallest primal treedepth of a matrix rowequivalent to A, \({{\,\textrm{td}\,}}_D^*(A)\) is the smallest dual treedepth of a matrix rowequivalent to A, and \({{\,\textrm{td}\,}}_I^*(A)\) is the smallest incidence treedepth of a matrix rowequivalent to A.
A circuit of a rational matrix A is a supportwise minimal integral vector contained in the kernel of A such that all its entries are coprime; the set of circuits of A is denoted by \({\mathcal {C}}(A)\). Note that a set X of columns is a circuit in the matroid M(A) if and only if \({\mathcal {C}}(A)\) contains a vector with the support exactly equal to X. We write \(c_1(A)\) for the maximum \(\ell _1\)norm of a circuit of A and \(c_{\infty }(A)\) for the maximum \(\ell _{\infty }\)norm of a circuit of A. Note if A and \(A'\) are rowequivalent rational matrices, then \({\mathcal {C}}(A)={\mathcal {C}}(A')\) and so the parameters \(c_1(\cdot )\) and \(c_\infty (\cdot )\) are invariant under elementary row operations. Following the notation from [21], we write \(\dot{\kappa }_A\) for the least common multiple of the entries of the circuits of A. Observe that there exists a function \(f:\mathbb {N}\rightarrow \mathbb {N}\) such that \(\dot{\kappa }_A\le f(c_{\infty }(A))\) for every matrix A.
If \(\textbf{x}\) and \(\textbf{y}\) are two ddimensional vectors, we write \(\textbf{x}\sqsubseteq \textbf{y}\) if \(\textbf{x}_i\le \textbf{y}_i\) for all \(i\in [d]\) and \(\textbf{x}\) and \(\textbf{y}\) are in the same orthant, i.e., \(\textbf{x}_i\) and \(\textbf{y}_i\) have the same sign (or one or both are zero) for all \(i\in [d]\). The Graver basis of a matrix A, denoted by \({\mathcal {G}}(A)\), is the set of the \(\sqsubseteq \)minimal nonzero elements of the integer kernel \(\ker _{\mathbb {Z}}(A)\). We use \(g_1(A)\) and \(g_{\infty }(A)\) for the Graver basis of A analogously to the set of circuits, i.e., \(g_1(A)\) is the maximum \(\ell _1\)norm of a vector in \({\mathcal {G}}(A)\) and \(g_{\infty }(A)\) is the maximum \(\ell _{\infty }\)norm of a vector in \({\mathcal {G}}(A)\). Again, the parameters \(g_1(\cdot )\) and \(g_\infty (\cdot )\) are invariant under elementary row operations as the Graver bases of rowequivalent matrices are the same. Note that every circuit of a matrix A belongs to the Graver basis of A, i.e., \({\mathcal {C}}(A)\subseteq {\mathcal {G}}(A)\), and so it holds that \(c_1(A)\le g_1(A)\) and \(c_{\infty }(A)\le g_{\infty }(A)\) for every matrix A.
The existence of efficient algorithms for integer programming with of constraint matrices A with bounded primal and dual treedepth is closely linked to bounds on the norm of elements of the Graver basis of A. In particular, Koutecký, Levin and Onn [44] established the following.
Theorem 9
There exist functions \(f_P,f_D:\mathbb {N}^2\rightarrow \mathbb {N}\) such that the following holds for every rational matrix A: \(g_{\infty }(A)\le f_P({{\,\textrm{td}\,}}_P(A),{{\,\textrm{ec}\,}}(A))\) and \(g_{1}(A)\le f_D({{\,\textrm{td}\,}}_D(A),{{\,\textrm{ec}\,}}(A))\).
2.4 Matroid depth parameters
We now define matroid depth parameters that will be of importance further. We start with the notion of deletiondepth and contractiondepth, which were introduced by DeVos, Kwon and Oum [16].
The deletiondepth of a matroid M, denoted by \({{\,\textrm{dd}\,}}(M)\), is defined recursively as follows:

If M has a single element, then \({{\,\textrm{dd}\,}}(M)=1\).

If M is not connected, then \({{\,\textrm{dd}\,}}(M)\) is the maximum deletiondepth of a component of M.

Otherwise, \({{\,\textrm{dd}\,}}(M)=1+\min \limits _{e\in M}{{\,\textrm{dd}\,}}(M\setminus e)\), i.e., \({{\,\textrm{dd}\,}}(M)\) is 1 plus the minimum deletiondepth of \(M\setminus e\) where the minimum is taken over all elements e of M.
A sequence of deletions of elements witnessing that the deletiondepth of a matroid M is \({{\,\textrm{dd}\,}}(M)\) can be visualized by a rooted tree, which we call a deletiontree, defined as follows. If M has a single element, then the deletiontree of M consists of a single vertex labeled with the single element of M. If M is not connected, then the deletiontree is obtained by identifying the roots of deletiontrees of the components of M. Otherwise, there exists an element e of the matroid M such that \({{\,\textrm{dd}\,}}(M)={{\,\textrm{dd}\,}}(M\setminus e)+1\) and the deletiontree of M is obtained from the deletiontree of \(M\setminus e\) by adding a new vertex adjacent to the root of the deletiontree of \(M\setminus e\), changing the root of the tree to the newly added vertex and labeling the edge incident with it with the element e. See Fig. 3 for an example. Observe that the height of the deletiontree is equal to the deletiondepth of M. In what follows, we consider deletiontrees that need not to be of optimal height, i.e., its edges can be labeled by a sequence of elements that decomposes a matroid M in a way described in the definition of the deletiondepth but its height is larger than \({{\,\textrm{dd}\,}}(M)\). In this more general setting, the deletiondepth of a matroid M is the smallest height of a deletiontree of M.
The contractiondepth of a matroid M, denoted by \({{\,\textrm{cd}\,}}(M)\), is defined recursively as follows:

If M has a single element, then \({{\,\textrm{cd}\,}}(M)=1\).

If M is not connected, then \({{\,\textrm{cd}\,}}(M)\) is the maximum contractiondepth of a component of M.

Otherwise, \({{\,\textrm{cd}\,}}(M)=1+\min \limits _{e\in M}{{\,\textrm{cd}\,}}(M/e)\), i.e., \({{\,\textrm{cd}\,}}(M)\) is 1 plus the minimum contractiondepth of M/e where the minimum is taken over all elements e of M.
It is not hard to show that \({{\,\textrm{dd}\,}}(M)={{\,\textrm{cd}\,}}(M^*)\) and \({{\,\textrm{cd}\,}}(M)={{\,\textrm{dd}\,}}(M^*)\) for every matroid M. We define a contractiontree analogously to a deletiontree; the contractiondepth of a matroid M is the smallest height of a contractiontree of M (an example is given in Fig. 3).
We next introduce the contractiondeletiondepth; this parameter was studied under the name type in [17], however, we decided to adopt the name contractiondeletiondepth from [16], which we find to better fit the context considered here. The contractiondeletiondepth of a matroid M, denoted by \({{\,\textrm{cdd}\,}}(M)\), is defined recursively as follows:

If M has a single element, then \({{\,\textrm{cdd}\,}}(M)=1\).

If M is not connected, then \({{\,\textrm{cdd}\,}}(M)\) is the maximum contractiondeletiondepth of a component of M.

Otherwise, \({{\,\textrm{cdd}\,}}(M)=1+\min \limits _{e\in M}\min \{{{\,\textrm{cdd}\,}}(M\setminus e),{{\,\textrm{cdd}\,}}(M/e)\}\), i.e., \({{\,\textrm{cdd}\,}}(M)\) is 1 plus the smaller among the minimum contractiondeletiondepth of the matroid \(M\setminus e\) and the minimum contractiondeletiondepth of the matroid M/e where both minima are taken over all elements e of M.
Observe that it holds that \({{\,\textrm{cdd}\,}}(M)={{\,\textrm{cdd}\,}}(M^*)\), \({{\,\textrm{cdd}\,}}(M)\le {{\,\textrm{dd}\,}}(M)\) and \({{\,\textrm{cdd}\,}}(M)\le {{\,\textrm{cd}\,}}(M)\) for every matroid M.
One of the key parameters in our setting is that of contraction\(^*\)depth; this parameter was introduced under the name branchdepth in [36] and further studied in [8] but we decided to use a different name to avoid a possible confusion with the notion of branchdepth introduced in [16]. We first introduce the parameter for general matroids, and then present an equivalent definition for represented matroids, which is more convenient to work in our setting. The contraction\(^*\)depth of a matroid M, denoted by \({{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\), is the smallest depth of a rooted tree T with exactly r(M) edges with the following property: there exists a function f from the ground set of M to the leaves of T such that for every subset X of the ground set of M the total number of edges contained in paths from the root to vertices of X is at least r(X). An example is given in Fig. 4.
There is an alternative definition of the parameter for represented matroids, which also justifies the name that we use for the parameter. The contraction\(^*\)depth of a represented matroid M can be defined recursively as follows:

If M has rank zero, then \({{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)=0\).

If M is not connected, then \({{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\) is the maximum contraction\(^*\)depth of a component of M.

Otherwise, \({{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\) is 1 plus the minimum contraction\(^*\)depth of a matroid obtained from the matroid M by factoring along an arbitrary onedimensional subspace.
As the contraction in the definition is allowed to be by an arbitrary onedimensional subspace, not only by a subspace generated by an element of M, it follows that \({{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\le {{\,\textrm{cd}\,}}(M)\).
The sequence of such contractions can be visualized by a contraction\(^*\)tree that is defined in the same way as a contractiontree except that onevertex trees are associated with matroids of rank zero (rather than matroids consisting of a single element) and the edges are labeled by onedimensional subspaces. If each onedimensional subspace that is the label of an edge of the tree is generated by an element of the matroid M, we say that the contraction\(^*\)tree is principal and we view the edges of the tree as labeled by the corresponding elements of M. Note that the minimum depth of a principal contraction\(^*\)tree of a matroid M is an upper bound on its contraction\(^*\)depth, however, in general, the contraction\(^*\)depth of a matroid M can be smaller than the minimum depth of a principal contraction\(^*\)tree of M. We point out that the notions of principal contraction\(^*\)trees and contractiontrees differ in a subtle but important way. For example, if M is a vector matroid of rank one containing a single element e, its only contractiontree consists of a root labeled by e while its only contraction\(^*\)tree has a root and a leaf adjacent to it and the edge joining them is labeled with (the subspace generated by) e. However, if M is a vector matroid of rank one containing two parallel elements e and \(e'\), any contractiontree and any contraction\(^*\)tree of M has depth one. Still, the minimum depth of a principal contraction\(^*\)tree of M is either \({{\,\textrm{cd}\,}}(M)1\) or \({{\,\textrm{cd}\,}}(M)\).
Kardoš et al. [36] established the connection between the contraction\(^*\)depth and the existence of a long circuit, which is described in Theorem 10 below; Theorem 10 implies that \({{\,\textrm{cd}\,}}(M)\le k^2+1\) where k is the size of the largest circuit of M.
Theorem 10
Let M be a matroid and k the size of its largest circuit. It holds that \(\log _2 k\le {{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\le k^2\). Moreover, there exists a polynomialtime algorithm that for an input oraclegiven matroid M outputs a principal contraction\(^*\)tree of depth at most \(k^2\).
We next introduce the parameter of contraction\(^*\)deletiondepth, which we believe to have not been yet studied previously, but which is particularly relevant in our context. To avoid unnecessary technical issues, we introduce the parameter for represented matroids only. The contraction\(^*\)deletiondepth of a represented matroid M, denoted by \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)\), is defined recursively as follows:

If M has rank zero, then \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)=0\);

if M has a single nonloop element, then \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)=1\).

If M is not connected, then \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)\) is the maximum contraction\(^*\)deletiondepth of a component of M.

Otherwise, \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)\) is 1 plus the smaller among the minimum contraction\(^*\)deletiondepth of the matroid \(M\setminus e\), where the minimum is taken over all elements of M, and the minimum contraction\(^*\)deletiondepth of a matroid obtained from M by factoring along an arbitrary onedimensional subspace.
Observe that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)\le {{\,\textrm{cdd}\,}}(M)\) and \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M)\le {{\,\mathrm{c^{*}\hspace{3pt}d}\,}}(M)\) for every matroid M.
Finally, if A is a matrix, the deletiondepth, contractiondepth, etc. of A is the corresponding parameter of the vector matroid M(A) formed by the columns of A, and we write \({{\,\textrm{dd}\,}}(A)\), \({{\,\textrm{cd}\,}}(A)\), etc. for the deletiondepth, contractiondepth, etc. of the matrix A. Observe that the deletiondepth, contractiondepth etc. of a matrix A is invariant under elementary row operations as elementary row operations preserve the matroid M(A).
3 Structural results
In this section, we prove our structural results concerning optimal primal treedepth and optimal incidence treedepth of a matrix. We start with presenting an algorithm, which uses a deletiontree of the matroid associated with a given matrix to construct a rowequivalent matrix with small primal treedepth.
Lemma 1
There exists a polynomialtime algorithm that for an input matrix A and a deletiontree of M(A) with height d outputs a matrix \(A'\) rowequivalent to A such that \({{\,\textrm{td}\,}}_P(A')\le d\).
Proof
We establish the existence of the algorithm by proving that \({{\,\textrm{td}\,}}_P(A')\le d\) in a constructive (algorithmic) way. Fix a matrix A and a deletiontree T of M(A) with height d.
Let X be the set of nonzero columns that are labels of the vertices of T. We show that the columns contained in X form a basis of the column space of the matrix A. As the matroid obtained from M(A) by deleting the labels of the edges of T has no component of size two or more, the columns contained in X are linearly independent. Suppose that there exists a nonzero column x that is not a linear combination of the columns contained in X, and choose among all such columns the label of an edge e as far from the root of T as possible. Since the element x does not form its own component in the matroid obtained from M by deleting the labels of all edges on the path from the root to e (excluding e), x is a linear combination of the labels of the vertices and edges of the subtree of T delimited by e. This implies that either x is a linear combination of the columns in X or there is a label of an edge of this subtree that is not a linear combination of the columns in X contrary to the choice of x. We conclude that X is a basis of the column space of A. In particular, unless A is the zero matrix, the set X is nonempty.
Let \(A'\) be the matrix obtained from A by elementary row operations such that the submatrix of \(A'\) induced by the columns of X is the unit matrix and with some additional zero rows; note that the set X is determined by the input deletiontree and so the matrix \(A'\) depends on the deletiontree. See Fig. 5 for an example. This finishes the construction of \(A'\) and, in particular, the description of the algorithm to produce the output matrix \(A'\). To complete the proof, it remains to show that the primal treedepth of \(A'\) is at most d, i.e., the correctness of the algorithm. This will be proven by induction on the number of columns of an input matrix A.
The base of the induction is the case when A has a single column. In this case, the primal treedepth of \(A'\) is one and the tree T is a single vertex labeled with the only column of A, and so its height is one. We next present the induction step. First observe that every label of a vertex of T is either in X or a loop in M(A) (recall that only nonzero columns of A are included to X), and every label of an edge e is a linear combination of labels of the vertices in the subtree delimited by e.
Suppose that the root of T has a label and let x be one of its labels; note that x is either a loop or a bridge in the matroid M(A). Let B be the matrix obtained from A by deleting the column x, and let \(T'\) be the deletiontree of M(B) obtained from T by removing the label x from the root. Let \(B'\) be the matrix produced by the algorithm described above for B and \(T'\). If x is a loop, then the matrix \(A'\) is the matrix \(B'\) extended by a zero column with possibly permuted rows, and if x is a bridge (and so \(x\in X\)), then the matrix \(A'\) is, possibly after permuting rows, the matrix \(B'\) extended by a unit vector such that its nonzero entry is the only nonzero entry in its row. In either case, the vertex associated with the column x is isolated in the primal graph of \(A'\), and it follows that \({{\,\textrm{td}\,}}_P(A')={{\,\textrm{td}\,}}_P(B')\le d\) (the inequality holds by the induction hypothesis). Hence, we can assume that the root of T has no label.
We next analyze the case that the root of T has a single child and no label. Let x be the label of the single edge incident with the root of T. Let B be the matrix obtained from A by deleting the column x, and let \(T'\) be the deletiontree of M(B) obtained from T by deleting the edge incident with the root and rooting the tree at the remaining vertex of the deleted edge. Let \(B'\) be the matrix produced by the algorithm described above for B and \(T'\); note that the primal treedepth of \(B'\) is at most \(d1\) by the induction hypothesis. Since \(B'\) is the submatrix of \(A'\) formed by the columns different from x (possibly after permuting rows), the primal treedepth of \(A'\) is at most \({{\,\textrm{td}\,}}_P(B')+1=d\).
The final case to analyze is the case when the root of T has \(k\ge 2\) children (in addition to having no label). Let \(T_1,\ldots ,T_k\) be the k subtrees of T delimited by the k edges incident with the root of T, let \(Y_1,\ldots ,Y_k\) be the labels of the vertices and edges of these subtrees, and let \(B_1,\ldots ,B_k\) be the submatrices of A formed by the columns contained in \(Y_1,\ldots ,Y_k\). Observe that \(T_i\) is a deletiontree of the matroid \(M(B_i)\) for \(i=1,\ldots ,k\), and the matrix \(B'_i\) produced by the algorithm described above for \(B_i\) and \(T_i\) is the submatrix of \(A'\) formed by the columns contained in \(Y_i\) (possibly after permuting rows). Since the support of the columns contained in \(Y_i\) contains only the unit entries of the columns of \(A'\) contained in \(X\cap Y_i\), the primal graph of \(A'\) contains no edge joining a column of \(Y_i\) and a column of \(Y_j\) for \(i\not =j\). It follows that the primal treedepth of \(A'\) is at most the maximum primal treedepth of \(B_i\), which is at most d by the induction hypothesis. It follows that \({{\,\textrm{td}\,}}_P(A')\le d\) as desired. The proof of the correctness of the algorithm is now completed and so is the proof of the lemma. \(\square \)
We are now ready to establish the link between the optimal primal treedepth and the deletiondepth of the matroid associated with the matrix.
Proof of Theorem 2
Fix a matrix A. By Lemma 1, it holds that \({{\,\textrm{td}\,}}_P^*(A)\le {{\,\textrm{dd}\,}}(A)\) as there exists a deletiontree of the matroid M(A) with height \({{\,\textrm{dd}\,}}(A)\). So, we focus on proving that \({{\,\textrm{dd}\,}}(A)\le {{\,\textrm{td}\,}}_P^*(A)\). We will show that every matrix B satisfies that \({{\,\textrm{dd}\,}}(B)\le {{\,\textrm{td}\,}}_P(B)\); this implies that \({{\,\textrm{dd}\,}}(A)\le {{\,\textrm{td}\,}}_P(A')\) for every matrix \(A'\) rowequivalent to A as \({{\,\textrm{dd}\,}}(A)={{\,\textrm{dd}\,}}(A')\) and so implies that \({{\,\textrm{dd}\,}}(A)\le {{\,\textrm{td}\,}}_P^*(A)\).
The proof that \({{\,\textrm{dd}\,}}(B)\le {{\,\textrm{td}\,}}_P(B)\) proceeds by induction on the number of columns. If B has a single column, then both \({{\,\textrm{dd}\,}}(B)\) and \({{\,\textrm{td}\,}}_P(B)\) are equal to one. We next present the induction step. We first consider the case when the matroid M(B) is not connected. Let \(B_1,\ldots ,B_k\) be the submatrices of B formed by columns corresponding to the components of M(B); note that some of the submatrices may consist of a single zero column (if M(B) has a loop). The definition of the deletiondepth implies that \({{\,\textrm{dd}\,}}(B)\) is the maximum among \({{\,\textrm{dd}\,}}(B_1),\ldots ,{{\,\textrm{dd}\,}}(B_k)\). On the other hand, the primal treedepth of each of the matrices \(B_i\) is at most the primal treedepth of the matrix B as the primal graph of \(B_i\) is a subgraph of the primal graph of B. It follows that \({{\,\textrm{dd}\,}}(B_i)\le {{\,\textrm{td}\,}}_P(B)\), which implies that \({{\,\textrm{dd}\,}}(B)\le {{\,\textrm{td}\,}}_P(B)\).
We next assume that the matroid M(B) is connected and claim that the primal graph of B must also be connected. Suppose that the primal graph of B is not connected, i.e., there exists a partition of rows of B into \(R_1\) and \(R_2\) and a partition of the columns into \(C_1\) and \(C_2\), such that for each \(i=1,2\), the support of each column in \(C_i\) is contained in \(R_i\). Therefore, for any dependent set of columns of B, either its subset formed by columns contained in \(C_1\) is dependent, or its subset formed by by columns contained in \(C_2\) is dependent, or both these subsets are dependent. It follows that the support of every circuit of M(B) is fully contained in either \(C_1\) or \(C_2\); in particular, no there is no circuit of M(B) containing a column from \(C_1\) and a column from \(C_2\). This implies that M(B) is not connected. Hence, the primal graph of B must be connected.
Since the primal graph of B is connected, there exists a column such that the matrix \(B'\) obtained by deleting this column satisfies that \({{\,\textrm{td}\,}}_P(B')={{\,\textrm{td}\,}}_P(B)1\). The induction assumption yields that \({{\,\textrm{dd}\,}}(B')\le {{\,\textrm{td}\,}}_P(B)1\) and the definition of the deletiondepth yields that the deletiondepth of M(B) is at most the deletiondepth of \(M(B')\) increased by one. This implies that \({{\,\textrm{dd}\,}}(B)={{\,\textrm{dd}\,}}(M(B))\le {{\,\textrm{td}\,}}_P(B)\) as desired. \(\square \)
Before proceeding with our structural result concerning incidence treedepth, we use the structural results presented in Lemma 1 and Theorem 2 to get a parameterized algorithm for computing an optimal primal treedepth of a matrix over a finite field.
Corollary 1
There exists a fixed parameter algorithm for the parameterization by a finite field \(\mathbb {F}\) and an integer d that for an input matrix A over the field \(\mathbb {F}\),

either outputs that \({{\,\textrm{td}\,}}_P^*(A)>d\), or

computes a matrix \(A'\) rowequivalent to A with \({{\,\textrm{td}\,}}_P(A')\le d\) and also outputs the associated deletiontree of M(A) with height \({{\,\textrm{td}\,}}_P(A')\).
Proof
We first show that the property that a matroid M has deletion depth at most d can be expressed in monadic second order logic. Recall that monadic second order formulas for matroids may contain quantification over elements and subsets of elements of a matroid, and the predicate \(\psi _I(\cdot )\) used to test whether a particular subset is independent in addition to logic connectives and the equality \(=\), the set inclusion \(\in \) and the subset inclusion \(\subseteq \). In the formulas that we present, small letters are used to denote elements of a matroid and capital letters subsets of the elements. We next present a monadic second order formula \(\psi _d(X)\) that describes whether the deletiondepth of the restriction of the matroid M to a subset X of the elements of M is at most d, which would imply the statement. The following formula \(\psi _c(\cdot ,\cdot )\) describes the existence of a circuit containing two distinct elements:
The next formula \(\psi _C(\cdot )\) describes whether a subset X is a component of a matroid (recall that the binary relation of two matroid elements being contained in a common circuit is transitive):
The sought formula \(\psi _d(\cdot )\) is defined inductively as follows (we remark that \(\psi _d(\emptyset )\) is true for all d):
Hliněný [29, 30] proved that all monadic second order logic properties can be tested in a fixed parameter way for matroids represented over a finite field \(\mathbb {F}\) with branchwidth at most d when parameterized by the property, the field \(\mathbb {F}\) and the branchwidth d. Since the branchwidth of a matroid M is at most its deletiondepth, it follows that testing whether the deletiondepth of an input matroid represented over a finite field \(\mathbb {F}\) is at most d is fixed parameter tractable when parameterized by the field \(\mathbb {F}\) and the integer d. This establishes the existence of a fixed parameter algorithm deciding whether \({{\,\textrm{td}\,}}_P^*(A)={{\,\textrm{dd}\,}}(M(A))\le d\) (the equality follows from Theorem 2). To obtain the algorithm claimed to exist in the statement of the corollary, we need to extend the algorithm for testing whether the deletiondepth of an input matroid M represented over \(\mathbb {F}\) is at most d to an algorithm that also outputs a deletiontree of M with height at most d; this would yield an algorithm for computing \(A'\) by Lemma 1.
We now describe the extension of the algorithm from testing to constructing a deletiondecomposition tree as a recursive algorithm. Let d be the computed deletiondepth of an input matroid M. The deletiondepth of an input matroid M is one if and only if every element of M is a loop or a bridge. Since the latter is easy to algorithmically test, if \(d=1\), then the deletiontree of height one consists of a single vertex labeled with all elements of M. If \(d\ge 2\) and the matroid M is not connected, we first identify its components, which can be done in polynomial time even in the oracle model, then proceed recursively with each component of M and eventually merge the roots of all deletiontrees obtained recursively.
Finally, we discuss the case when \(d\ge 2\) and the matroid M is connected. We loop over all elements e of M and test using the monadic second order checking algorithm of Hliněný [29, 30] whether \({{\,\textrm{dd}\,}}(M\setminus e)\le d1\), i.e., whether \(\psi _{d1}(M\setminus e)\) is true. Such an element e must exist (otherwise, the deletiondepth of M cannot be d) and when e is found, we recursively apply the algorithm to \(M\setminus e\) to obtain a deletiontree T of \(M\setminus e\) with height \(d1\). Note that there is a single recursive call as we invoke recursion for a single element e of the matroid M. The tree T returned by the recursive call is extended to a deletiontree of M by introducing a new vertex, joining it by an edge to the root of T, rerooting the tree to the new vertex, and labeling the new edge with the element e. This completes the description of the algorithm for constructing a deletiontree of height at most d if it exists. Observe that the running time of the described procedure for constructing a deletiontree is bounded by the product of the number of elements of M and the running time of the test whether an input matroid is connected and the test whether an input matroid satisfies \(\psi _1(\cdot ),\ldots ,\psi _d(\cdot )\); in particular, it is fixed parameter when parameterized by a finite field \(\mathbb {F}\) and an integer d. \(\square \)
We conclude this section by establishing a link between the optimal incidence treedepth and the contraction\(^*\)deletiondepth of the matroid associated with the matrix.
Proof of Theorem 3
We prove the equality as two inequalities starting with the inequality \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\textrm{td}\,}}_I^*(A)1\). To prove this inequality, we show that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\textrm{td}\,}}_I(A)1\) holds for every matrix A with m rows and n columns by induction on \(m+n\). The base of the induction is formed by the cases when all entries of A are zero, \(n=1\) or \(m=1\). If all entries of A are zero, then \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)=0\) and \({{\,\textrm{td}\,}}_I(A)=1\). If \(n=1\) and A is nonzero, then M(A) has a single nonloop element and so \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)=1\) while the incidence graph of A is formed by a star and possibly some isolated vertices and so \({{\,\textrm{td}\,}}_I(A)=2\). Finally, if \(m=1\) and A is nonzero, then M(A) has rank 1, so contracting any nonloop element of M(A) yields a matroid of rank zero and so \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)=1\). On the other hand, the incidence graph of A is formed by a star and possibly some isolated vertices and so \({{\,\textrm{td}\,}}_I(A)=2\).
We now establish the induction step, i.e., we assume that the matrix A is nonzero, \(m\ge 2\) and \(n\ge 2\). First suppose that the matroid M(A) is not connected. Let \(X_1,\ldots ,X_k\) be the components of M(A) and let \(A_1,\ldots ,A_k\) be the submatrices of A formed by the columns \(X_1,\ldots ,X_k\), respectively. The definition of the contraction\(^*\)deletiondepth implies that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\) is the maximum of \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A_i)\). The induction hypothesis yields that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A_i)\le {{\,\textrm{td}\,}}_I(A_i)1\). Since the incidence graph of \(A_i\) is a subgraph of the incidence graph of A, it follows that \({{\,\textrm{td}\,}}_I(A_i)\le {{\,\textrm{td}\,}}_I(A)\) and so \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A_i)\le {{\,\textrm{td}\,}}_I(A)1\). We conclude that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\textrm{td}\,}}_I(A)1\).
Next suppose that the matroid M(A) is connected but the incidence graph of A is not connected. As the columns associated with vertices contained in different components of the incidence graph of A have disjoint supports, such columns cannot be contained in the same component of the matroid M(A). Hence, if the incidence graph of A is not connected despite the matroid M(A) being connected, then the incidence graph of A consists of a single nontrivial component and isolated vertices associated with zero rows of A. Let x be one such row and let \(A'\) be the matrix obtained from A by deleting the row x. Since the matroids M(A) and \(M(A')\) are the same, it holds that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')\), and since the incidence graph of A is the incidence graph of \(A'\) with an isolated vertex added, it holds \({{\,\textrm{td}\,}}_I(A)={{\,\textrm{td}\,}}_I(A')\). Hence, the induction hypothesis yields that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')\le {{\,\textrm{td}\,}}_I(A')1\), which implies that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\textrm{td}\,}}_I(A)1\).
Finally, suppose that the matroid M(A) is connected and the incidence graph of A is also connected. The definition of the treedepth implies that there exists a vertex w of the incidence graph whose deletion decreases the treedepth of the incidence graph by one. Let \(A'\) be the matrix obtained from A by deleting the row or the column associated with the vertex w and note that \({{\,\textrm{td}\,}}_I(A')={{\,\textrm{td}\,}}_I(A)1\). If the vertex w is associated with a column x, the matroid \(M(A')\) is the matroid obtained from M(A) by deleting the element x. If the vertex w is associated with a row x, the matroid \(M(A')\) is the matroid obtained from M(A) by contracting by the subspace generated by the unit vector with the entry in the row x. In either case, the definition of the contraction\(^*\)deletiondepth implies that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')+1\). The induction hypothesis applied to \(A'\) yields that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')\le {{\,\textrm{td}\,}}_I(A')1\), which yields that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\le {{\,\textrm{td}\,}}_I(A')={{\,\textrm{td}\,}}_I(A)1\).
To complete the proof of the theorem, it remains to show that the inequality \({{\,\textrm{td}\,}}_I^*(A)\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\) holds for every matrix A. The proof proceeds by induction on the number n of columns of A. If \(n=1\) and the only column of A is zero, then the incidence graph of A is formed by isolated vertices and so \({{\,\textrm{td}\,}}_I(A)=1\) while \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)=0\) since the rank of M(A) is zero. If \(n=1\) and the only column of A is not zero, then the incidence graph of A is formed by a star and possibly some isolated vertices and so \({{\,\textrm{td}\,}}_I(A)=2\) while \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)=1\). In either case, it holds that \({{\,\textrm{td}\,}}_I^*(A)\le {{\,\textrm{td}\,}}_I(A)={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\).
We now establish the induction step. First suppose that the matroid M(A) is not connected. Let \(X_1,\ldots ,X_k\) be the sets of columns forming the components of M(A) and let \(A'\) be the matrix rowequivalent to A such that there exist sets of rows \(Y_1,\ldots ,Y_k\) such that \(Y_i=r_{M(A)}(X_i)\) for \(i=1,\ldots ,k\) and the only columns with nonzero entries in the rows \(Y_i\) are those of \(X_i\) and all rows not contained in \(Y_1\cup \cdots \cup Y_k\) are zero (such a matrix \(A'\) exists since the matroid M(A) is union of its restrictions to \(X_1,\ldots ,X_k\)). Let \(A'_i\) be the submatrix of \(A'\) formed by the rows of \(Y_i\) and the columns of \(X_i\). Observe that all entries of the matrix A not contained in one of the matrices \(A'_1,\ldots ,A'_k\) are zero. By the induction hypothesis, for every \(i=1,\ldots ,k\), there exists a matrix \(A''_i\) rowequivalent to \(A'_i\) such that \({{\,\textrm{td}\,}}_I(A''_i)\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M(A)\left[ X_i\right] )+1\), in particular, \({{\,\textrm{td}\,}}_I(A''_i)\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\). Let \(A''\) be the matrix obtained from \(A'\) by replacing \(A'_i\) with \(A''_i\) for \(i=1,\ldots ,k\). Observe that \(A''\) is rowequivalent to \(A'\) and so to A. Since the incidence graph of \(A''\) is the union of the incidence graphs of \(A''_i\), \(i=1,\ldots ,k\), and possibly some isolated vertices (which correspond to zero rows), it follows that \({{\,\textrm{td}\,}}_I(A'')\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\). Hence, it holds that \({{\,\textrm{td}\,}}_I^*(A)\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)+1\).
To complete the proof, we need to consider the case that the matroid M(A) is connected. The definition of the contraction\(^*\)deletiondepth implies that there exists an element x of M(A) such that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M(A){\setminus } x)={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M(A))1={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)1\) or there exists a onedimensional subspace such that the contraction by this subspace yields a matroid \(M'\) such that \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M')={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M(A))1={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)1\). In the former case, let \(A'\) be the matrix obtained from A by deleting the column x. By the induction hypothesis, there exists a matrix \(A''\) rowequivalent to \(A'\) such that \({{\,\textrm{td}\,}}_I(A'')\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')+1={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\), and let \(A'''\) be the matrix obtained from A by the same elementary row operations that \(A''\) is obtained from \(A'\). Observe that the incidence graph of \(A''\) can be obtained from the incidence graph of \(A'''\) by deleting the vertex associated with the column x. Hence, \({{\,\textrm{td}\,}}_I(A''')\le {{\,\textrm{td}\,}}_I(A'')+1\). Since \(A'''\) is rowequivalent to A, it follows that
We now analyze the latter case, i.e., the case that there exists a onedimensional subspace such that the contraction by this subspace yields a matroid \(M'\) with \({{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(M')={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)1\). Let \(A'\) be the matrix obtained from A by elementary row operations such that the contracted subspace used to obtain \(M'\) is generated by the unit vector with the nonzero entry being its first entry, and let B be the matrix obtained from \(A'\) by deleting the first row. By the induction hypothesis, there exists a matrix \(B'\) rowequivalent to B such that \({{\,\textrm{td}\,}}_I(B')\le {{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A')+1={{\,\mathrm{c^{*}\hspace{3pt}dd}\,}}(A)\), and let \(A''\) be the matrix consisting of the first row of A and the matrix \(B'\). Observe that \(A''\) is rowequivalent to A. Since the incidence graph of \(B'\) can be obtained from the incidence graph of \(A''\) by deleting the vertex associated with the first row, it holds that \({{\,\textrm{td}\,}}_I(A'')\le {{\,\textrm{td}\,}}_I(B')+1\). Hence, it follows that
The proof of the theorem is now completed. \(\square \)
4 Primal treedepth
In this section, we present a parameterized algorithm for computing a rowequivalent matrix with small primal treedepth and bounded entry complexity if such a matrix exists.
Proof of Theorem 6
We first find a bound on \(\dot{\kappa }_B\) when B is an integer matrix with \({{\,\textrm{td}\,}}_P(B)\le d\) and \({{\,\textrm{ec}\,}}(B)\le e\) (recall that \(\dot{\kappa }_B\) is the least common multiple of the entries of the circuits of B). Consider such a square invertible matrix C with \({{\,\textrm{td}\,}}_P(C)\le d\) and \({{\,\textrm{ec}\,}}(C)\le e\). By the result of Brand, Ordyniak and the second author [5], the maximum denominator appearing over all entries of \(C^{1}\) can be bounded by a function of d and e; in particular, there exists \(k_0\le (2^e)^{d!}{(d!)}^{d!/2}\) such that every entry of \(C^{1}\) is 1/kintegral for some \(k\le k_0\). Set \(\kappa _0\) to be the least common multiple of the integers \(1, \ldots , k_0\). By [21, Theorem 3.8], \(\dot{\kappa }_B\) is the smallest integer such that every denominator of the inverse of every invertible square submatrix of B divides \(\dot{\kappa }_B\). Since the primal treedepth of any square submatrix of B at most the primal treedepth of B, \(\dot{\kappa }_B\) divides \(\kappa _0\) for every matrix B with \({{\,\textrm{td}\,}}_P(B)\le d\) and \({{\,\textrm{ec}\,}}(B)\le e\). In particular, \(\dot{\kappa }_B\le \kappa _0\) for every matrix B with \({{\,\textrm{td}\,}}_P(B)\le d\) and \({{\,\textrm{ec}\,}}(B)\le e\).
We next describe the algorithm from the statement of the theorem. Without loss of generality, we can assume that the rank of the input matrix A is equal to the number of its rows, in particular, A is nonzero. The algorithm starts with diagonalizing the square submatrix of the input matrix A formed by an arbitrary basis of the column space, i.e., performing elementary row operations so that the selected columns form the identity matrix. The resulting matrix is denoted by \(A_I\). If the numerator or the denominator of any (nonzero) entry of \(A_I\) does not divide \(\kappa _0\), the algorithm arrives at the first conclusion of the theorem as every (nonzero) entry of \(A_I\) is a fraction that can be obtained by dividing two entries of a circuit of A (indeed, consider the circuit of the matrix A with support formed by a column x and some of the columns of the chosen basis, and observe that each entry in the column x is equal to the xentry of the circuit divided by one of its other entries). Hence, we assume that both numerator and denominator of each (nonzero) entry of \(A_I\) divides \(\kappa _0\) in the rest. The algorithm multiplies \(A_I\) by \(\kappa _0\), which yields an integral matrix \(A_0\) with entries between \(\kappa _0^2\) and \(\kappa _0^2\).
Let \(M_{\mathbb {Q}}\) be the column matroid of \(A_0\) when viewed as a matrix over rationals and let \(M_p\) be the column matroid of \(A_0\) when viewed as a matrix over a pelement field \(\mathbb {F}_p\) for a prime \(p>\kappa _0^2\); note that such a prime p can be found algorithmically as the algorithm is parameterized by d and e and \(\kappa _0\) depends on d and e only. Note that the elements of both matroids \(M_{\mathbb {Q}}\) and \(M_p\) are the columns of the matrix \(A_0\), i.e., we can assume that their ground sets are the same, and the matroid \(M_{\mathbb {Q}}\) is the column matroid of A, which is a matrix over rationals.
We now establish the following claim: if A is rowequivalent to a matrix with primal treedepth at most d and entry complexity at most e, then the matroids \(M_{\mathbb {Q}}\) and \(M_p\) are the same. If a set X of columns forms a circuit in \(M_{\mathbb {Q}}\), then there exists a linear combination of the columns of X that has all coefficients integral and coprime, i.e., not all are divisible by p, and that is equal to the zero vector (in fact, there exist such coefficients that they all divide \(\kappa _0\) by the definition of \(\kappa _0\)); it follows that the set X is also dependent in \(M_p\). If a set X of columns is independent in \(M_{\mathbb {Q}}\), let \(B_I\) be an invertible square submatrix of \(A_I\) formed by the columns X and X rows, and let \(B_0\) be the square submatrix of \(A_0\) formed by the same rows and columns. By [21, Lemma 3.3], the matrix \(B_I^{1}\) is \(1/\dot{\kappa }_A\)integral and the absolute value of both numerator and denominator of each entry of \(B_I^{1}\) is at most \(\dot{\kappa }_A\). Note that \(\dot{\kappa }_A\) divides \(\kappa _0\) (here, we use the definition of \(\kappa _0\) and the assumption that A is rowequivalent to a matrix with primal treedepth at most d and entry complexity at most e) and so the matrix \(B_I^{1}\) is \(1/\kappa _0\)integral and the absolute value of both numerator and denominator of each entry of \(B_I^{1}\) is at most \(\kappa _0\). Let \(B'\) be the matrix obtained from \(B_I^{1}\) by multiplying each entry by \(\kappa _0\); note that \(B'\) is an integer matrix with entries between \(\kappa _0^2\) and \(\kappa _0^2\). The definitions of the matrices \(B_I\), \(B_0\) and \(B'\) yield that the product of the matrix \(B'\) when viewed as over \(\mathbb {F}_p\) and the matrix \(B_0\) has numerically the same entries as the matrix \((\kappa _0 B_I^{1})(\kappa _0 B_I)\), which is a diagonal matrix with all diagonal entries equal to \(\kappa _0^2\). Hence, the matrix \(B_0\) is full rank (over the field \(\mathbb {F}_p\)) and so the set X is independent in \(M_p\).
We now continue the description of the algorithm that is asserted to exist in the statement of the theorem. As the next step, we apply the algorithm from Corollary 1 to the matrix \(A_0\) viewed as over the field \(\mathbb {F}_p\). If the algorithm determines that the deletiondepth of \(A_0\) is larger than d, we arrive at the first conclusion of the theorem: either the matroids \(M_{\mathbb {Q}}\) and \(M_p\) are different (and so A is not rowequivalent to a matrix with primal treedepth at most d and entry complexity at most e), or the matroids \(M_{\mathbb {Q}}\) and \(M_p\) are the same but \({{\,\textrm{dd}\,}}(A)={{\,\textrm{td}\,}}_P^*(A)>d\). If the algorithm determines that the deletiondepth of \(A_0\) is at most d, it also outputs a deletiontree of \(M_p\) with height at most d. If the output deletiontree is not valid for the matroid \(M_{\mathbb {Q}}\), which can be verified in polynomial time, the matroids \(M_{\mathbb {Q}}\) and \(M_p\) are different and we again arrive at the first conclusion of the theorem. If the output deletiontree is also a deletiontree of the matroid \(M_{\mathbb {Q}}\), we use the algorithm from Lemma 1 to obtain a matrix \(A'\) rowequivalent to A such that the primal treedepth of \(A'\) at most the height of the deletiontree, i.e., \({{\,\textrm{td}\,}}_P(A')\le d\). As the matrix \(A'\) contains a unit submatrix formed by m rows and m columns, each (nonzero) entry of \(A'\) is a fraction that can be obtained by dividing two entries of a circuit of A (as argued earlier). If the absolute value of the numerator or the denominator of any of these fractions exceeds \(\kappa _0\), then \(c_\infty (A)>\kappa _0\) and we again arrive at the first conclusion of the theorem. Otherwise, we output the matrix \(A'\). Note that the primal treedepth of \(A'\) is at most d and its entry complexity is at most \(2\lceil \log _2\left( \kappa _0+1\right) \rceil \). As \(\kappa _0\) depends on d and e only, the matrix \(A'\) has the properties given in the second conclusion of the theorem. \(\square \)
5 Dual treedepth, circuit complexity and Graver basis
In this section, we link minimum dual treedepth of a matrix to its circuit complexity, and also present related algorithmic results. We start with proving Theorem 5; in fact, we show that a matrix rowequivalent to an input matrix A such that both its dual treedepth and entry complexity bounded by a function of \(c_1(A)\) can be found efficiently. Note that the algorithm presented in the next theorem is not a fixed parameter algorithm, i.e., its running time is polynomial in the size of an input matrix.
Theorem 11
There exists a polynomialtime algorithm that for a given rational matrix A with \(\dim \ker A>0\) outputs a rowequivalent matrix \(A'\) such that \({{\,\textrm{td}\,}}_D(A')\le c_1(A)^2\) and \({{\,\textrm{ec}\,}}(A')\le 2\lceil \log _2 (c_1(A)+1)\rceil \).
Proof
We start with the description of the algorithm from the statement of the theorem. Let A be the input matrix. We apply the algorithm from Theorem 10 to the matroid M(A) given by the columns of the matrix A. Let T be the principal contraction\(^*\)tree output by the algorithm and let X be the set of columns of A that are the labels of the edges of T, i.e., the elements of M(A) used in the contractions. Observe that the definition of the contraction\(^*\)depth and the principal contraction\(^*\)tree yields that the labels of the edges of T form a basis X of M(A) and for every element z of M(A) there is a leaf v of T such that z is contained in the linear hull of the labels of the edges on the path from v to the root of T. Next perform rowoperations on the matrix A in a way that the submatrix formed by the columns of X is an identity matrix (with additional zero rows if the rank of A is smaller than the number of its rows); let \(A'\) be the resulting matrix; see Fig. 6 for an example. The algorithm outputs the matrix \(A'\). Note that the running time of the algorithm is indeed polynomial in the size of the input matrix A.
We next analyze the matrix \(A'\) that is output by the algorithm. Since \(\dim \ker A>0\), the matrix A has at least one circuit. Recall that for every circuit C of the matroid M(A), there exists a circuit of A whose support is exactly formed by the elements of C. This implies that every circuit of M(A) contains at most \(c_1(A)\) elements and so Theorem 10 implies that the depth of the principal contraction\(^*\)tree T is at most \(c_1(A)^2\).
Let F be a rooted forest obtained from the tree T as follows. For each edge e, the vertex of e farther from the root is identified with the (unique) row of \(A'\) that is nonzero in the column that is the label of the edge e (recall that the columns of X form an identity matrix), and then remove the root of T; also add an isolated vertex for each zero row of \(A'\). In this way, we obtain a rooted forest F with vertex set formed by the rows of \(A'\). Note that the height of F is at most \(c_1(A)^2\). We will show that the dual graph of \(A'\) is a subgraph of \({{\,\textrm{cl}\,}}(F)\). As no column of X contributes any edges to the dual graph of \(A'\), it is enough to consider columns not contained in X. Let z be a column of \(A'\) that is not contained in X and let v be a leaf of T such that the column z of A, which is an element of M(A), is contained in the linear hull of the labels of the edges on the path from v to the root of T. Hence, the column z of \(A'\) contains nonzero entries only in the rows with nonzero entries in the columns that are labels of the edges on the path from v to the root of T. Consequently, all edges contained in the dual graph of \(A'\) because of nonzero entries in the column z are between vertices on the path from the vertex v in F to the root of the corresponding tree of F. It follows that the dual graph of \(A'\) is a subgraph of \({{\,\textrm{cl}\,}}(F)\) and so its treedepth is at most the height of F, i.e., it is at most \(c_1(A)^2\). We conclude that \({{\,\textrm{td}\,}}_D(A')\le c_1(A)^2\).
It remains to analyze the entry complexity of \(A'\). The entries of \(A'\) in the columns of X are zero or one. Next consider a column z of \(A'\) that is not contained in X and consider a circuit c of \(A'\) (and so of A) whose support contains z and some elements of X (such a circuit exists as the columns of X form a basis of the column space of \(A'\)). Observe that the entries in the column z are equal to \(c_x/c_z\) (otherwise, c would not be a circuit of \(A'\)). We conclude that the entry complexity of \(A'\) is at most \(2\lceil \log _2 (c_1(A)+1)\rceil \). \(\square \)
We are now ready to prove Theorem 4. Note that the condition \(\dim {\text {Ker}}A>0\) in the statement of the theorem is necessary as otherwise A has no circuit and so \(c_1(A)\) is not defined.
Proof of Theorem 4
Consider a rational matrix A with \(\dim {\text {Ker}}A>0\). Note that \(c_1(A)\le g_1(A)\) as every circuit of A is also an element of the Graver basis of A. To prove the existence of the function \(f_1\), let \(f_D\) be the function from Theorem 9 and note that Theorem 11 implies that \(g_1(A)\le f_D(c_1(A)^2,2\lceil \log _2 (c_1(A)+1)\rceil )\). \(\square \)
We next combine the algorithms from Theorems 7 and 11.
Corollary 2
There exists a function \(f:\mathbb {N}\rightarrow \mathbb {N}\) and a fixed parameter algorithm for the parameterization by k that for a given rational matrix A:

either outputs that \(c_1(A)>k\), or

outputs a matrix \(A'\) that is rowequivalent to A, its dual treedepth is \({{\,\textrm{td}\,}}_D^*(A)\) and its entry complexity is at most f(k).
Proof
If \(\dim {\text {Ker}}A=0\) for an input matrix A, i.e., the rank of A is equal to the number of the columns, which can be easily verified in polynomial time, then A is rowequivalent to the unit matrix possibly with some zero rows added, i.e., to a matrix with dual treedepth one and entry complexity one. If \(\dim {\text {Ker}}A>0\), we apply the algorithm from Theorem 11 to get a matrix \(A'\) rowequivalent to A that has properties given in the statement of Theorem 11. If the dual treedepth of \(A'\) is larger than \(k^2\) or the entry complexity of \(A'\) is larger than \(2\lceil \log _2 (k+1)\rceil \), then \(c_1(A)>k\) (by Theorem 11) and we arrive at the first conclusion. Otherwise, we apply the algorithm from Theorem 7 with parameters \(d=k^2\) and \(e=2\lceil \log _2 (k+1)\rceil \) to compute a matrix \(A''\) rowequivalent to \(A'\) and so to A such that the dual treedepth of \(A''\) is \({{\,\textrm{td}\,}}_D^*(A)\) and the entry complexity of \(A''\) is bounded by a function of k only. \(\square \)
Finally, the previous corollary together with Theorem 9 yields the parameterized algorithm for testing whether an input matrix is rowequivalent to a matrix with small dual treedepth and small entry complexity as given in Theorem 8.
Proof of Theorem 8
Let \(f_D\) be the function from the statement of Theorem 9 and set \(k=f_D(d,e)\); note \(f_D(d,e)\le 2^{2^{(d \log e)^{O(1)}}}\) by Eisenbrand et al. [20]. Apply the algorithm from Corollary 2 with the parameter k to an input matrix A. If the algorithm reports that \(c_1(A)>k\), then A is not rowequivalent to a matrix with dual treedepth at most d and entry complexity at most e. If the algorithm outputs a matrix \(A'\) and \({{\,\textrm{td}\,}}_D(A')>d\), then \({{\,\textrm{td}\,}}_D^*(A)>d\) and so the matrix A is not rowequivalent to a matrix with dual treedepth at most d. Otherwise, the dual treedepth of \(A'\) is at most d and its entry complexity is bounded by \(f(k)=f(f_D(d,e))\) where \(f(\cdot )\) is the function from Corollary 2, i.e., the entry complexity of \(A'\) is bounded by a function of d and e only as required. \(\square \)
6 Computational hardness of depth parameters
In this section, we complement our algorithmic results by establishing computational hardness of matroid depth parameters that we have discussed in this paper. The hardness results apply even when the input matroid is given by its representation over a fixed (finite or infinite) field.
We start with defining a matroid \(M_{\mathbb {F}}(G)\) derived from a graph G. Fix a field \(\mathbb {F}\). For a graph G, we define an \(\mathbb {F}\)represented matroid \(M_{\mathbb {F}}(G)\) as follows. The matroid \(M_{\mathbb {F}}(G)\) contains \(V(G)+E(G)\) elements, each corresponding to a vertex or an edge of G. We associate each element of \(M_{\mathbb {F}}(G)\) with a vector of \(\mathbb {F}^{V(G)}\). An element of \(M_{\mathbb {F}}(G)\) corresponding to a vertex w of G is represented by \(e_w\) and an element of \(M_{\mathbb {F}}(G)\) corresponding to an edge \(ww'\) of G is represented by \(e_we_{w'}\) or \(e_{w'}e_w\) (an arbitrary of the two vectors can be chosen as the choice does not affect the matroid).
We next define a graph G/A for a graph G and a linear subspace A of \(\mathbb {F}^{V(G)}\). Let W be the subset of vertices of V(G) such that \(e_w\in A\) for \(w\in W\), and let F be the set of edges \(ww'\) of G such that neither w nor \(w'\) is contained in W and A contains a vector \(e_w+\alpha e_{w'}\) for a nonzero element \(\alpha \in \mathbb {F}\). The graph G/A is obtained by deleting all vertices of W and then contracting a maximal acyclic subset of edges contained in F (the remaining edges of F become loops and so get removed); note that we use an acyclic subset of edges for contraction so that the resulting graph is welldefined.
The next lemma relates the number of components of the matroid \(M_{\mathbb {F}}(G)/A\) and the number of components of the graph G/A for a graph G and a linear subspace A of \(\mathbb {F}^{V(G)}\).
Lemma 2
Let G be a graph, \(\mathbb {F}\) a field and A a linear subspace of \(\mathbb {F}^{V(G)}\). The number of components of \(M_{\mathbb {F}}(G)/A\) is at most the number of components of the graph G/A.
Proof
Fix a graph G, a field \(\mathbb {F}\) and a linear subspace of \(\mathbb {F}^{V(G)}\). Let W and F be the subsets of vertices and edges of G as in the definition of G/A, respectively. Let \(A'\) be the linear subspace of \(\mathbb {F}^{V(G)}\) generated by the vectors \(e_w\), \(w\in W\), and the vectors \(e_w+\alpha e_{w'}\in A\) for \(ww'\in F\); clearly, \(A'\) is a subspace of A. Note that the sets W and F defined with respect to A would be the same if defined with respect to \(A'\), and so the graphs G/A and \(G/A'\) are the same. We next describe an \(\mathbb {F}\)representation of the matroid \(M_{\mathbb {F}}(G)/A'\) using vectors of \(\mathbb {F}^{V(G/A')}\). The matroid \(M_{\mathbb {F}}(G)\) contains elements corresponding to vertices and to edges of G. Consider a vertex w of V(G). If \(w\in W\), then the element corresponding to w is a loop in \(M_{\mathbb {F}}(G)/A'\) and so represented by the zero vector. If \(w\not \in W\), then the element corresponding to w is represented by the vector \(e_{u}\) where u is the vertex of \(G/A'\) that the vertex w was contracted to. Next consider an edge \(ww'\) of G.

If both w and \(w'\) belong to W, then the element corresponding to \(ww'\) is a loop in \(M_{\mathbb {F}}(G)/A'\) and so represented by the zero vector.

If exactly one of w and \(w'\) belong to W, say \(w\in W\) and \(w'\not \in W\), then the element corresponding to \(ww'\) is represented by the vector \(e_{u}\) where u is the vertex of \(G/A'\) that the vertex \(w'\) was contracted to.

If neither w nor \(w'\) belongs to W and \(e_we_{w'}\in A'\) (and so \(ww'\in F\)), then the element corresponding to \(ww'\) is a loop in \(M_{\mathbb {F}}(G)/A'\) and so represented by the zero vector.

If neither w nor \(w'\) belongs to W, \(e_we_{w'}\not \in A'\) but \(ww'\in F\), then the element corresponding to \(ww'\) is represented by the vector \(e_{u}\) where u is the vertex of \(G/A'\) that the vertex w (and so the vertex \(w'\)) was contracted to.

Finally, if neither w nor \(w'\) belongs to W and \(ww'\not \in F\), the element corresponding to \(ww'\) is the vector \(\alpha e_u+\alpha ' e_{u'}\) where u is the vertex of \(G/A'\) that the vertex w was contracted to, \(u'\) is the vertex of \(G/A'\) that the vertex \(w'\) was contracted to, and the vector \(\alpha e_u+\alpha ' e_{u'}\) corresponds to the vector \(e_we_{w'}\) in \(\mathbb {F}^{V(G)}/A'\); note that \(uu'\) is an edge of \(G/A'\) and both coefficients \(\alpha \) and \(\alpha '\) are nonzero.
It is straightforward to verify that the just described representation is indeed a representation of the matroid \(M_{\mathbb {F}}(G)/A'\); note that each nonloop element of \(M_{\mathbb {F}}(G)/A'\) is associated to a vertex or an edge of \(G/A'\) and each vertex or an edge of \(G/A'\) with at least one (but possibly more) nonloop element of \(M_{\mathbb {F}}(G)/A'\).
We now analyze the matroid \(M_{\mathbb {F}}(G)/A\). The matroid \(M_{\mathbb {F}}(G)/A\) can be viewed as the matroid \((M_{\mathbb {F}}(G)/A')/(A/A')\). Observe that the definition of \(A'\) implies that any nonloop element of \(M_{\mathbb {F}}(G)/A'\) is nonloop in \(M_{\mathbb {F}}(G)/A\). Also observe that the space \(A/A'\) viewed as a subspace of \(\mathbb {F}^{V(G/A')}\) does not contain a vector \(e_w\) for \(w\in V(G/A')\) or a vector \(e_w+\alpha e_{w'}\) for a nonzero \(\alpha \in \mathbb {F}\) such that \(ww'\) is an edge of \(E(G/A')\). In particular, the support of every vector of \(A/A'\) is at least two and if the support has size two, then it does not correspond to an edge of \(E(G/A')\). It follows that if \(ww'\) is an edge of \(E(G/A')\), x is an element of \(M_{\mathbb {F}}(G)/A'\) associated with the vertex w, \(x'\) is an element of \(M_{\mathbb {F}}(G)/A'\) associated with the vertex \(w'\), and \(x''\) is an element of \(M_{\mathbb {F}}(G)/A'\) associated with the edge \(ww'\), then the elements x, \(x'\) and \(x''\) form a circuit of \((M_{\mathbb {F}}(G)/A')/(A/A')\). Since the relation of being contained in a common circuit is transitive, it follows that all elements of \(M_{\mathbb {F}}(G)/A'\) corresponding to the vertices and the edges of the same component of \(G/A'\) are contained in the same component of \((M_{\mathbb {F}}(G)/A')/(A/A')\). In particular, the number of components of the matroid \((M_{\mathbb {F}}(G)/A')/(A/A')\) is at most the number of components of the graph \(G/A'\). Since the graphs G/A and \(G/A'\) are the same and the matroids \(M_{\mathbb {F}}(G)/A\) and \((M_{\mathbb {F}}(G)/A')/(A/A')\) are also the same, the lemma follows. \(\square \)
We next link the existence of a balanced independent set in a bipartite graph to the contraction\(^*\)depth of a suitably defined matroid. We remark that the idea of using a bipartite graph with cliques added between the vertices of its parts was used in [47] to establish that computing treedepth of a graph is NPcomplete.
Lemma 3
Let G be a bipartite graph with parts X and Y, let \(\mathbb {F}\) be a field, and let k be an integer. Let \(G'\) be the graph obtained from G by adding all edges between the vertices of X and between the vertices of Y. The following three statements are rowequivalent.

The graph G has an independent set containing k elements of X and k elements of Y.

The contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(X+Yk\).

The contractiondepth of the matroid \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\).
Proof
Fix a bipartite graph G with parts X and Y, a field \(\mathbb {F}\) and an integer k. We first show that if G has an independent set containing k elements of X and k elements of Y, then the contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(X+Yk\) and the contractiondepth of \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\). Let W be such an independent set and let \(W'\) be the set containing all elements \(e_w\) of \(M_{\mathbb {F}}(G')\) such that \(w\not \in W\). Note that \(W'=X+Y2k\). The matroid \(M_{\mathbb {F}}(G')/W'\) is the matroid obtained from \(M_{\mathbb {F}}(G'[W])\) by adding

a loop for every edge with both end vertices not contained in W, and

an element represented by \(e_w\) for every edge joining a vertex \(w\in W\) to a vertex not contained in W.
In particular, the matroid \(M_{\mathbb {F}}(G')/W'\) has two nontrivial components, each of rank k, and so the contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(W' + k = X + Y  k\). Similarly, the matroid \((2M_{\mathbb {F}}(G'))/W'\) is the matroid obtained from \(2M_{\mathbb {F}}(G'[W])\) by adding

a loop for every vertex not contained in W,

two loops for every edge with both end vertices not contained in W, and

two elements represented by \(e_w\) for every edge joining a vertex \(w\in W\) to a vertex not contained in W.
Since the matroid \((2M_{\mathbb {F}}(G'))/W'\) has two nontrivial components, each of rank k, its contractiondepth is at most \(W'+k+1=X+Yk+1\) (note that any rank r matroid has contractiondepth at most \(r+1\)).
We next argue that if the contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(X+Yk\) or the contractiondepth of \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\), then there exists a subset W of \(V(G)=V(G')\) that is independent in G, \(W\cap X\ge k\) and \(W\cap Y\ge k\). To do so, we first show that there is no linear subspace A such that \(M_{\mathbb {F}}(G')/A\) would have more than two components. Consider a linear subspace A of \(\mathbb {F}^{V(G')}\) such that the matroid \(M_{\mathbb {F}}(G')/A\) is not connected. By Lemma 2, the graph \(G'/A\) is disconnected. Since the graph \(G'/A\) cannot have more than two components (one is formed by some of the vertices of X and another by some of the vertices of Y), it follows that the graph \(G'/A\) has exactly two components and so the matroid \(M_{\mathbb {F}}(G')/A\) has exactly two components, too.
If the contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(X+Yk\), there exists a linear subspace A of \(\mathbb {F}^{V(G')}\) such that the matroid \(M_{\mathbb {F}}(G')/A\) is not connected and the rank of each of its two components is at most \(X+Yk\dim A\). We will prove that the existence of such A is also implied by the assumption that the contractiondepth of \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\). We next use that the matroid \((2M_{\mathbb {F}}(G'))/F\) has at most two nontrivial components for every subset F of the elements of \(2M_{\mathbb {F}}(G')\). If the contractiondepth of \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\), then there exists a subset F of the elements of \(2M_{\mathbb {F}}(G')\) such that the matroid \((2M_{\mathbb {F}}(G'))/F\) is not connected and the rank of each of its two components is at most \(X+Yk{{\,\textrm{rank}\,}}F\) (as the contractiondepth of each of its two components is the rank of the component increased by one because each element is parallel to at least one other element). It follows that there exists a linear subspace A of \(\mathbb {F}^{V(G')}\), which is the hull of the vectors representing the elements of the set F as above, such that the matroid \(M_{\mathbb {F}}(G')/A\) is not connected and the rank of each of its two components is at most \(X+Yk\dim A\). We conclude that if the contraction\(^*\)depth of \(M_{\mathbb {F}}(G')\) is at most \(X+Yk\) or if the contractiondepth of \(2M_{\mathbb {F}}(G')\) is at most \(X+Yk+1\), then there exists a linear subspace A of \(\mathbb {F}^{V(G')}\) such that the matroid \(M_{\mathbb {F}}(G')/A\) is not connected and the rank of each of its two components is at most \(X+Yk\dim A\).
It remains to show that the existence of a subspace A of \(\mathbb {F}^{V(G')}\) such that the matroid \(M_{\mathbb {F}}(G')/A\) is not connected and the rank of each of its two components is at most \(X+Yk\dim A\) implies that there exists an independent set containing k elements of X and k elements of Y. Fix such a subspace A. Let W be the set of vertices w such that \(e_w\) is contained in A and let \(A_W\) be the subspace of A generated by the vectors \(e_w\), \(w\in W\). Since \(G'/A\) is not connected, the graph \(G'\setminus W\) is also not connected (recall that \(G'/A\) is obtained by removing the vertices of W and then contracting some edges). By Lemma 2 the matroid \(M_{\mathbb {F}}(G')/A_W\) is also not connected. Since the space \(A_W\) is a subspace of A, the rank of each component of \(M_{\mathbb {F}}(G')/A_W\) is larger by at most \(\dim A\dim A_W\) compared to the corresponding component of \(M_{\mathbb {F}}(G')/A\). Hence, the rank of each of the two components of \(M_{\mathbb {F}}(G')/A_W\) is at most \(X+Yk\dim A_W=X+YkW\). It follows that each component of the graph \(G'/A_W=G'\setminus W\) contains at most \(X+YkW\) vertices. Since the sum of the sizes of the two components of \(G'\setminus W\) is \(X+YW\), each component of \(G'\setminus W\) has at least k vertices. In addition, the vertex set of each component of \(G'\setminus W\) is either a subset of X or a subset of Y, which implies that there is no edge joining a vertex of \(X\setminus W\) and a vertex of \(Y\setminus W\) and both sets \(X{\setminus } W\) and \(Y{\setminus } W\) have at least k vertices. Hence, the graph G has an independent set containing k elements of X and k elements of Y (such an independent set is a subset of \(V(G)\setminus W\)). \(\square \)
We are now ready to state our hardness result.
Theorem 12
For every field \(\mathbb {F}\), each of the following five decision problems, whose input is an \(\mathbb {F}\)represented matroid M and an integer d, is NPcomplete:

Is the contractiondepth of M at most d?

Is the contraction\(^*\)depth of M at most d?

Is the contractiondeletiondepth of M at most d?

Is the contraction\(^*\)deletiondepth of M at most d?

Is the deletiondepth of M at most d?
Proof
It is NPcomplete to decide for a bipartite graph G with parts X and Y and an integer k whether there exist kelement subsets \(X'\subseteq X\) and \(Y'\subseteq Y\) such that \(X'\cup Y'\) is independent [47]. For an input bipartite graph G, let \(G'\) be the graph obtained from G by adding all edges between the vertices of X and between the vertices of Y. We claim that the existence of such subsets \(X'\) and \(Y'\) is equivalent to each of the following four statements:

The matroid \(2M_{\mathbb {F}}(G')\) has contractiondepth at most \(X+Yk+1\).

The matroid \(M_{\mathbb {F}}(G')\) has contraction\(^*\)depth at most \(X+Yk\).

The matroid \((V(G')+1)M_{\mathbb {F}}(G')\) has contractiondeletiondepth at most \(X+Yk+1\).

The matroid \((V(G')+1)M_{\mathbb {F}}(G')\) has contraction\(^*\)deletiondepth at most \(X+Yk\).
The equivalences to the first and second statements follow directly from Lemma 3. Since the rank of the matroid \((V(G')+1)M_{\mathbb {F}}(G')\) is \(G'\), its contractiondeletiondepth is at most \(G'+1\) and its contraction\(^*\)deletiondepth is at most \(G'\). As each element of the matroid \((V(G')+1)M_{\mathbb {F}}(G')\) is parallel to (at least) \(V(G')\) elements of the matroid, it follows that the contractiondeletiondepth of \(M_{\mathbb {F}}(G')\) is the same as its contractiondepth and its contraction\(^*\)deletiondepth is the same as its contraction\(^*\)depth. Lemma 3 now implies the equivalence of the third and fourth statements. As the matroids \(2M_{\mathbb {F}}(G')\), \(M_{\mathbb {F}}(G')\) and \((V(G')+1)M_{\mathbb {F}}(G')\) can be easily constructed from the input graph G in time polynomial in V(G), the NPcompleteness of the first four problems listed in the statement of the theorem follows.
For an \(\mathbb {F}\)represented matroid M, it is easy to construct an \(\mathbb {F}\)represented matroid \(M^*\) that is dual to M in time polynomial in the number of the elements of M [46, Chapter 2]. Since the contractiondepth of M is equal to the deletiondepth of \(M^*\), it follows that the fifth problem listed in the statement of the theorem is also NPcomplete. \(\square \)
7 Concluding remarks
We would like to conclude with addressing three natural questions related to the work presented in this paper.
In Sect. 5, we have given a structural characterization of matrices A with \(g_1(A)\) bounded by showing that \(g_1(A)\) is bounded if and only if A is rowequivalent to a matrix with small dual treedepth and small entry complexity. Unfortunately, a similar (if and only if) characterization of matrices A with \(g_{\infty }(A)\) bounded does not seem to be in our reach.
Problem 1
Find a structural characterization of matrices A with \(g_{\infty }(A)\) bounded.
In view of Theorem 9, it may be tempting to think that such a characterization can involve matrices with bounded incidence treedepth as if a matrix A has bounded primal treedepth or it has bounded dual treedepth, then \(g_{\infty }(A)\) is bounded. However, the following matrix A has incidence treedepth equal to 4 and yet \(g_{\infty }(A)\) grows with the number t of its columns; in particular, the vector \((t1,1,1,\ldots ,1)\) is an element of its Graver basis as it can be readily verified. We remark that a similar matrix was used by Eiben et al. [18] in their NPcompleteness argument.
In Sect. 3, we have given structural characterizations of matrices that are rowequivalent to a matrix with small primal treedepth or small incidence treedepth, which complements the characterization of matrices rowequivalent to a matrix with small dual treedepth from [8, 9]. We have also presented fixed parameter algorithms (Theorems 6 and 8) for finding such a rowequivalent matrix with bounded entry complexity if one exists; both of these algorithms are based on fixed parameter algorithms for finding deletiondepth decompositions and contraction\(^*\)depth decompositions of matroids over finite fields, which are presented in Corollary 1 in the case of deletiondepth and in [8, 9] in the case of contraction\(^*\)depth. We believe that similar techniques would lead to a fixed parameter algorithm for contraction\(^*\)deletiondepth decompositions of matroids represented over a finite field (note that contraction\(^*\)deletiondepth does not have an obvious description in monadic second order logic and so the algorithmic results of Hliněný [29, 30] do not readily apply in this setting). However, it is unclear whether such an algorithm would yield a fixed parameter algorithm for rational matrices as we do not have structural results on the circuits of rational matrices with small incidence treedepth, which would reduce the case of rational matrices to those over finite fields.
Another natural question is whether the upper bound on the depth of the principal contraction\(^*\)tree given in Theorem 10, which is quadratic in the length of the longest circuit of a represented matroid, can be improved. However, this turns out to be impossible as we now argue. Since the minimum depth of a principal contraction\(^*\)tree of a matroid M differs from \({{\,\textrm{cd}\,}}(M)\), i.e. the minimum height of a contractiontree of M, by at most one, it is enough to construct a sequence of matroids \(M_n\) such that

the length of the longest circuit of \(M_n\) is is at most \(\mathcal {O}(n)\), and

the contractiondepth of \(M_{n}\) is at least \(\Omega (n^2)\).
Hence, the quadratic dependence of the minimum depth in Theorem 10 is optimal up to a constant factor. Still, it can be the case that the bound on the contraction\(^*\)depth can be improved.
The matroids \(M_{n}\) are the graphic matroids of graphs \(G_n\), which are constructed inductively. To facilitate the induction we will require slightly stronger properties. Each of the graphs \(G_n\) contains two distinguished vertices, denoted by \(r_n\) and \(b_n\), and the following holds:

1.
The length of any path in \(G_n\) between the vertices \(r_n\) and \(b_n\) is between n and \(2n\).

2.
The length of any circuit in \(M_n\) is at most \(4n\).

3.
The contractiondepth of \(M_n\) is at least \(n\atopwithdelims ()2\).
If \(n=1\), we set \(G_1\) to be the twovertex graph formed by two parallel edges, and \(r_1\) and \(b_1\) are chosen as the two vertices of \(G_1\). Note that the graph \(G_1\) and the matroid \(M_1=M(G_1)\) has the properties (7), (7), and (7). To obtain \(G_n\), we start with a cycle of length 2n and choose any two vertices at distance n to be \(r_n\) and \(b_n\). This cycle containing the vertices \(r_n\) and \(b_n\) will be referred to as the root cycle. We then add \(n\) copies of \(G_{n  1}\), connect the vertex \(r_{n  1}\) in each copy to the vertex \(r_n\), and connect the vertex \(b_{n  1}\) in each copy to \(b_{n}\). The construction is illustrated in Fig. 7.
Assuming that the matroid \(M_{n1}\) and the graph \(G_{n1}\) have the properties (7), (7), and (7), and we will show that the matroid \(M_n\) and the graph \(G_n\) also have these properties.
We start with showing that \(G_n\) has the property (7). Indeed, a path from \(r_n\) to \(b_n\) is either contained in the root cycle or consists of a path between \(r_{n  1}\) and \(b_{n  1}\) in one of the copies of \(G_{n  1}\), whose length is between \(n1\) and \(2(n1)\), together with two edges joining \(r_{n  1}\) to \(r_{n}\) and \(b_{n  1}\) to \(b_{n}\). In either of the cases, the length of the path is between n and 2n as required.
Having established the property (7), we prove the property (7). Any circuit of the matroid \(M_{n}\) corresponds to a cycle in the graph \(G_n\), thus we can simply investigate the lengths of cycles in \(G_n\). First observe that a cycle of \(G_n\) contains either both vertices \(r_n\) and \(b_n\) or neither of them. Every cycle containing \(r_n\) and \(b_n\) consists of two paths between \(r_n\) and \(b_n\) and so its length is at most 4n, and every cycle containing neither \(r_n\) nor \(b_n\) is contained entirely within a copy of \(G_{n1}\) and so its length is at most \(4(n1)\le 4n\).
Finally, we argue that contractiondepth of \(M_n\) is at least \({n} \atopwithdelims ()2\). Recall that contracting an element of \(M_n\) corresponds to contracting the associated edge in the graph \(G_n\), and components of a graphic matroid correspond to blocks, i.e., maximal 2edgeconnected components, of an associated graph. Since the length of any path between \(r_n\) to \(b_n\) is at least n, until at least n edge contractions are performed in graph \(G_n\), the vertices \(r_n\) and \(b_n\) are distinct and are contained in the same block. Hence, after \(n1\) edge contractions followed by deleting all blocks not containing the vertices \(r_n\) and \(b_n\) (if such blocks appear), the graph still contains an intact copy \(G_{n1}\). It follows that \({{\,\textrm{cd}\,}}(M_n)\ge (n1)+{{\,\textrm{cd}\,}}(M_{n1})\), which implies that \({{\,\textrm{cd}\,}}(M_n)\ge (n1)+{n1\atopwithdelims ()2}={n\atopwithdelims ()2}\).
References
Aschenbrenner, M., Hemmecke, R.: Finiteness theorems in stochastic integer programming. Found. Comput. Math. 7(2), 183–227 (2007)
Aykanat, C., Pinar, A., Çatalyürek, Ü.V.: Permuting sparse rectangular matrices into blockdiagonal form. SIAM J. Sci. Comput. 25(6), 1860–1879 (2004)
Bergner, M., Caprara, A., Ceselli, A., Furini, F., Lübbecke, M.E., Malaguti, E., Traversi, E.: Automatic Dantzig–Wolfe reformulation of mixed integer programs. Math. Program. 149(1–2), 391–424 (2015)
Borndörfer, R., Ferreira, C.E., Martin, A.: Decomposing matrices into blocks. SIAM J. Optim. 9(1), 236–269 (1998)
Brand, C., Koutecký, M., Ordyniak, S.: Parameterized algorithms for MILPs with small treedepth. Proc. AAAI Conf. Artif. Intell. 35(14), 12249–12257 (2021)
Bredereck, R., Figiel, A., Kaczmarczyk, A., Knop, D., Niedermeier, R.: Highmultiplicity fair allocation made more practical. In: Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS’21, pp. 260–268. International Foundation for Autonomous Agents and Multiagent Systems (2021)
Bredereck, R., Kaczmarczyk, A., Knop, D., Niedermeier, R.: Highmultiplicity fair allocation: Lenstra empowered by nfold integer programming. In: Proceedings of the 2019 ACM Conference on Economics and Computation, EC’19, pp. 505–523. Association for Computing Machinery (2019)
Chan, T.F.N., Cooper, J.W., Koutecký, M., Král’, D., Pekárková, K.: Matrices of optimal treedepth and rowinvariant parameterized algorithm for integer programming. In: 47th International Colloquium on Automata, Languages, and Programming (ICALP 2020), Leibniz International Proceedings in Informatics (LIPIcs), vol. 168, pp. 26:1–26:19 (2020)
Chan, T.F.N., Cooper, J.W., Koutecký, M., Král’, D., Pekárková, K.: Matrices of optimal treedepth and a rowinvariant parameterized algorithm for integer programming. SIAM J. Comput. 51(3), 664–700 (2022)
Chen, H., Chen, L., Zhang, G.: FPT algorithms for a special blockstructured integer program with applications in scheduling. preprint arXiv:2107.01373 (2021)
Chen, L., Marx, D.: Covering a tree with rooted subtrees–parameterized and approximation algorithms. In: 29th Annual ACMSIAM Symposium on Discrete Algorithms (SODA 2018), pp. 2801–2820. SIAM (2018)
Cslovjecsek, J., Eisenbrand, F., Hunkenschröder, C., Rohwedder, L., Weismantel, R.: Blockstructured integer and linear programming in strongly polynomial and near linear time. In: 32nd Annual ACMSIAM Symposium on Discrete Algorithms (SODA 2021), pp. 1666–1681. SIAM (2021)
Cslovjecsek, J., Eisenbrand, F., Pilipczuk, M., Venzin, M., Weismantel, R.: Efficient Sequential and Parallel Algorithms for Multistage Stochastic Integer Programming Using Proximity. In: 29th Annual European Symposium on Algorithms (ESA 2021), Leibniz International Proceedings in Informatics (LIPIcs), vol. 204, pp. 33:1–33:14 (2021)
Cygan, M., Fomin, F.V., Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M., Pilipczuk, M., Saurabh, S.: Parameterized Algorithms. Springer, Berlin (2015)
De Loera, J.A., Hemmecke, R., Onn, S., Weismantel, R.: \({N}\)fold integer programming. Discret. Optim. 5(2), 231–241 (2008)
DeVos, M., Kwon, O., Oum, S.: Branchdepth: Generalizing treedepth of graphs. Eur. J. Comb. 90, 103186 (2020)
Ding, G., Oporowski, B., Oxley, J.: On infinite antichains of matroids. J. Comb. Theory Ser. B 63(1), 21–40 (1995)
Eiben, E., Ganian, R., Knop, D., Ordyniak, S., Pilipczuk, M., Wrochna, M.: Integer programming and incidence tree depth. In: Integer Programming and Combinatorial Optimization—20th International Conference (IPCO), LNCS vol. 11480, pp. 194–204. Springer International Publishing (2019)
Eisenbrand, F., Hunkenschröder, C., Klein, K.: Faster algorithms for integer programs with block structure. In: 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018), Leibniz International Proceedings in Informatics (LIPIcs), pp. 49:1–49:13 (2018)
Eisenbrand, F., Hunkenschröder, C., Klein, K., Koutecký, M., Levin, A., Onn, S.: An algorithmic theory of integer programming. preprint arXiv:1904.01361 (2019)
Ekbatani, F., Natura, B., Végh, L.A.: Circuit imbalance measures and linear programming. preprint arXiv:2108.03616 (2021)
Ferris, M.C., Horn, J.D.: Partitioning mathematical programs for parallel solution. Math. Program. 80(1), 35–61 (1998)
Gamrath, G., Lübbecke, M.E.: Experiments with a generic Dantzig–Wolfe decomposition for integer programs. Exp. Algorithms 6049, 239–252 (2010)
Ganian, R., Ordyniak, S.: The complexity landscape of decompositional parameters for ILP. Artif. Intell. 257, 61–71 (2018)
Halmos, P.: FiniteDimensional Vector Spaces. Undergraduate Texts in Mathematics, Springer, Berlin (1993)
Hemmecke, R., Onn, S., Romanchuk, L.: \({N}\)fold integer programming in cubic time. Math. Program. 137, 325–341 (2013)
Hemmecke, R., Schultz, R.: Decomposition of test sets in stochastic integer programming. Math. Program. 94, 323–341 (2003)
Hermelin, D., Molter, H., Niedermeier, R., Shabtay, D.: Equitable scheduling for the total completion time objective. preprint arXiv:2112.13824 (2021)
Hliněný, P.: Branchwidth, parse trees, and monadic secondorder logic for matroids. In: H. Alt, M. Habib (eds.) 20th Annual Symposium on Theoretical Aspects of Computer Science (STACS), LNCS, vol. 2607, pp. 319–330 (2003)
Hliněný, P.: Branchwidth, parse trees, and monadic secondorder logic for matroids. J. Comb. Theory Ser. B 96(3), 325–351 (2006)
Jansen, K., Klein, K., Lassota, A.: The double exponential runtime is tight for 2stage stochastic ILPs. In: M. Singh, D.P. Williamson (eds.) Integer Programming and Combinatorial Optimization—22nd International Conference (IPCO), LNCS vol. 12707, Lecture Notes in Computer Science, vol. 12707, pp. 297–310. Springer (2021)
Jansen, K., Klein, K., Maack, M., Rau, M.: Empowering the configurationIP: new PTAS results for scheduling with setup times. Math. Program. (2021)
Jansen, K., Lassota, A., Maack, M.: Approximation algorithms for scheduling with class constraints. In: Proceedings of the 32nd ACM Symposium on Parallelism in Algorithms and Architectures, pp. 349–357. Association for Computing Machinery (2020)
Jansen, K., Lassota, A., Rohwedder, L.: Nearlinear time algorithm for \(n\)fold ILPs via color coding. SIAM J. Discret. Math. 34(4), 2282–2299 (2020)
Kannan, R.: Minkowski’s convex body theorem and integer programming. Math. Oper. Res. 12(3), 415–440 (1987)
Kardoš, F., Král’, D., Liebenau, A., Mach, L.: First order convergence of matroids. Eur. J. Comb. 59, 150–168 (2017)
Karp, R.M.: Reducibility among combinatorial problems. In: Miller, R.E., Thatcher, J.W., Bohlinger, J.D. (eds.) Complexity of Computer Computations. The IBM Research Symposia Series, pp. 85–103. Springer, Berlin (1972)
Khaniyev, T., Elhedhli, S., Erenay, F.S.: Structure detection in mixedinteger programs. INFORMS J. Comput. 30(3), 570–587 (2018)
Klein, K.: About the complexity of twostage stochastic IPs. Math. Program. 192(1), 319–337 (2022)
Klein, K., Reuter, J.: Collapsing the tower—on the complexity of multistage stochastic IPs. In: 33rd Annual ACMSIAM Symposium on Discrete Algorithms (SODA 2022), pp. 348–358. SIAM (2022)
Knop, D., Koutecký, M.: Scheduling kernels via configuration LP. preprint arXiv:2003.02187 (2018)
Knop, D., Koutecký, M.: Scheduling meets \(n\)fold integer programming. J. Sched. 21(5), 493–503 (2018)
Knop, D., Koutecký, M., Mnich, M.: Combinatorial nfold integer programming and applications. In: 25th Annual European Symposium on Algorithms (ESA), Leibniz International Proceedings in Informatics (LIPIcs), vol. 87, pp. 54:1–54:14 (2017)
Koutecký, M., Levin, A., Onn, S.: A parameterized strongly polynomial algorithm for block structured integer programs. In: 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018), Leibniz International Proceedings in Informatics (LIPIcs), vol. 107, pp. 85:1–85:14 (2018)
Lenstra, H.W., Jr.: Integer programming with a fixed number of variables. Math. Oper. Res. 8(4), 538–548 (1983)
Oxley, J.: Matroid Theory. Oxford Graduate Texts in Mathematics, Oxford University Press, Oxford (2011)
Pothen, A.: The complexity of optimal elimination trees. Technical Report CS8813, Pennsylvania State University (1988)
Schultz, R., Stougie, L., van der Vlerk, M.H.: Solving stochastic programs with integer recourse by enumeration: a framework using gröbner basis reductions. Math. Program. 83, 229–252 (1998)
Vanderbeck, F., Wolsey, L.A.: Reformulation and decomposition of integer programs. In: 50 Years of Integer Programming 1958–2008, pp. 431–502. Springer (2010)
Wang, J., Ralphs, T.: Computational experience with hypergraphbased methods for automatic decomposition in discrete optimization. In: Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, pp. 394–402. Springer (2013)
Weil, R.L., Kettler, P.C.: Rearranging matrices to blockangular form for decomposition (and other) algorithms. Manag. Sci. 18(1), 98–108 (1971)
Acknowledgements
All five authors would like to thank the Schloss Dagstuhl—Leibniz Center for Informatics for hospitality during the workshop “Sparsity in Algorithms, Combinatorics and Logic” in September 2021 where the work leading to the results contained in this paper was started. The authors are also indebted to the two anonymous reviewers for their detailed comments on the manuscript, which have helped to improve the presentation significantly and made the manuscript more accessible to a wider audience.
Funding
Open access publishing supported by the National Technical Library in Prague.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
The first author was partially supported by the Polish National Science Center grant (BEETHOVEN; UMO2018/31/G/ST1/03718). The second author was partially supported by Charles University project UNCE 24/SCI/008 and by the project 1927871X of GA ČR. The third author was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 648509). This publication reflects only its authors’ view; the ERC Executive Agency is not responsible for any use that may be made of the information it contains. The third and fourth authors were supported by the MUNI Award in Science and Humanities (MUNI/I/1677/2018) of the Grant Agency of Masaryk University.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Briański, M., Koutecký, M., Král’, D. et al. Characterization of matrices with bounded Graver bases and depth parameters and applications to integer programming. Math. Program. (2024). https://doi.org/10.1007/s1010702302048x
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s1010702302048x