COCOON 2017: Computing and Combinatorics pp 420-432

# Linear Representation of Transversal Matroids and Gammoids Parameterized by Rank

• Pranabendu Misra
• M. S. Ramanujan
• Saket Saurabh
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10392)

## Abstract

Given a bipartite graph $$G=(U\uplus V,E)$$, a linear representation of the transversal matroid associated with G on the ground set U, can be constructed in randomized polynomial time. In fact one can get a linear representation deterministically in time $$2^{{\mathcal {O}}(m^2n)}$$, where $$m=\vert U\vert$$ and $$n=|V|$$, by looping through all the choices made in the randomized algorithm. Other important matroids for which one can obtain linear representation deterministically in time similar to the one for transversal matroids include gammoids and strict gammoids. Strict gammoids are duals of transversal matroids and gammoids are restrictions of strict gammoids. We give faster deterministic algorithms to construct linear representations of transversal matroids, gammoids and strict gammoids. All our algorithms run in time $$\left( {\begin{array}{c}m\\ r\end{array}}\right) m^{{\mathcal {O}}(1)}$$, where m is the cardinality of the ground set and r is the rank of the matroid. In the language of parameterized complexity, we give an $$\mathsf{XP}$$ algorithm for finding linear representations of transversal matroids, gammoids and strict gammoids parameterized by the rank of the given matroid.

## 1 Introduction

Matroids are important mathematical objects in the theory of algorithms and combinatorial optimization. Often an algorithm for a class of matroids gives us an algorithmic meta theorem, which gives a unified solution to several problems. For example, it is known that any problem which admits a greedy algorithm can be embedded into a matroid and finding minimum (maximum) weighted independent set in this matroid corresponds to finding a solution to the problem. Other important examples are the Matroid Intersection and Matroid Parity problems, which encompass several combinatorial optimization problems such as Bipartite Matching, 2-Edge Disjoint Spanning Trees and Arborescence. A matroid M is defined as a pair $$(E,\mathcal {I})$$, where E is called the ground set and $$\mathcal {I}$$ is a family of subsets of E, called independent sets, with following three properties: (i) $$\emptyset \in \mathcal {I}$$, (ii) if $$A\in \mathcal {I}$$ and $$A'\subseteq A$$, then $$A'\in \mathcal {I}$$ and (iii) If $$A,B \in \mathcal {I}$$ and $$\vert A \vert < \vert B \vert$$, then there is a $$e\in B\setminus A$$ such that $$A\cup \{e\}\in \mathcal {I}$$. As the cardinality of $$\mathcal {I}$$ could be exponential in $$\vert E \vert$$, as it is in many applications, explicitly listing $$\mathcal {I}$$ for algorithms is highly inefficient both in terms of time complexity as well as space complexity. Thus, during the early works of algorithms using matroids, algorithms were designed using the oracle model. An independence oracle for a matroid is a black box algorithm which takes as input a subset of the ground set and returns Yes if the set is independent in the matroid and No otherwise. Many algorithms are designed using these oracles. These oracle based algorithms lead to efficient algorithms for problems where we have good algorithms that can act as an oracles. A few matroids for which we have efficient oracles include, but are not limited to, graphic matroids, co-graphic matroids, transversal matroids and linear matroids.

Another way of representing a matroid succinctly is by encoding the information about the family of independent sets in a matrix. A matrix A over a field $${\mathbb F}$$ is called a linear representation of a matroid $$M=(E,\mathcal {I})$$, if there is a bijection between the columns of A and E and a subset $$S\subseteq E$$ is independent in M if and only if the corresponding columns in A are linearly independent over the field $${\mathbb F}$$. Note that while not all matroids admit a linear representation, a number of important classes of matroids do. Recently, several algorithmic results have been obtained in the fields of Parameterized Complexity and Exact Algorithms, which require a linear representations of certain classes of matroids [2, 3, 4, 5, 6, 10, 11, 13, 15]. This naturally motivates the question of constructing linear representations for various classes of matroids efficiently. Deterministic polynomial time algorithms were known for linear representations of many important classes of matroids such as uniform matroids, partition matroids, graphic matroids and co-graphic matroids. In all these algorithms the running time is polynomial in the size of the ground set. However, for transversal matroids and gammoids, only randomized polynomial time algorithms are known for constructing its linear representations. These matroids feature in many of the results mentioned above, and deterministic algorithms to compute linear representations for them will derandomize several algorithms in literature. In this paper we give a modest improvement over the naïve algorithm for constructing deterministic linear representations for transversal matroids and gammoids.

Let $$G=(U\uplus V,E)$$ be a bipartite graph, the transversal matroid$$M_G$$ on the ground set U has the following family of independent sets: $$U'\subseteq U$$ is independent in $$M_G$$ if and only if there is a matching in G saturating $$U'$$. Furthermore assume that $$\vert U \vert = \vert V\vert =m$$ and G has a perfect matching. A natural question in this direction is as follows.

Question 1: Could we exploit the fact that G has a perfect matching to design a deterministic polynomial time algorithm to find a linear representation for $$M_G$$, where we can test whether a subset is independent or not in deterministic polynomial time?

The answer to this question is of course, Yes! An $$m\times m$$ identity matrix is a linear representation of $$M_G$$. This naturally leads to the following question.

Question 2: Suppose G has a matching of size $$m-\ell$$, where $$\ell$$ is a constant. Can we design a deterministic polynomial time algorithm to find a linear representation for $$M_G$$, where we can test whether a subset is independent or not in deterministic polynomial time?

This question is the starting point of the present work. As mentioned earlier, there is a randomized polynomial time algorithm to obtain a linear representation of a transversal matroid for any bipartite graph. Let $$G=(U\uplus V,E)$$ be a bipartite graph, where $$U=\{u_1,\ldots ,u_m\}$$ and $$V=\{v_1,\ldots ,v_n\}$$. Let $$X=\{x_{i,j}~|~i\in [n], j\in [m]\}$$. Define an $$n\times m$$ matrix A as follows: for each $$i\in [n],j\in [m], A[i,j]=0$$ if $$v_iu_j\notin E$$ and $$x_{i,j}$$ otherwise. Then for any $$R\subseteq [n], C\subseteq [m], \vert R\vert =\vert C\vert$$, $$\mathsf{det}(A[R,C])\not \equiv 0$$ if and only if there is a perfect matching in $$G[\{v_i~|~i\in R\}\cup \{u_j~|~j\in C\}]$$. This implies that A is in fact a linear representation of the transversal matroid $$M_G$$ on the ground set U over the field of fractions $${\mathbb F}(\mathbf{X})$$, where $${\mathbb F}$$ is any field of size at least 2. Notice that the above construction can be done in deterministic polynomial time.

However, in the representation above, to check whether a set is linearly independent we need to test if the corresponding determinant polynomial, which is a multivariate polynomial, is identically non-zero. This is a case of the well known polynomial identity testing (PIT) problem, and we do not know of a deterministic polynomial time algorithm for this problem. Hence, this representation is difficult to use in deterministic algorithms for many applications [10, 13]. Furthermore, it rather difficult to carry out field operations over the field of fractions $${\mathbb F}(\mathbf{X})$$ in polynomial time. As a result, even though we get the above linear representation in deterministic polynomial time, we are not able to use it for deterministic algorithms efficiently. We can obtain another representation, by substituting random values for each $$x_{i,j} \in X$$ from a field of size at least $$2^p m 2^m$$, where $$p\in {\mathbb N}$$, and succeed with probability at least $$\left( 1-\frac{1}{2^p}\right)$$. This leads to a randomized polynomial time algorithm [13], to obtain a representation over a finite field or a field such as $$\mathbb R$$, where field operations can be carried out efficiently. It appears that derandomizing the above approach has some obstacles, as this will have some important consequences on lower bounds in complexity theory [9]. Observe that the above approach implies a deterministic algorithm of running time $$2^{\mathcal{O}(m^2n)}$$, that tests all possible assignments of at most mn variables from a field of size $$m 2^m$$ (setting $$p={\mathcal {O}}(1)$$), since one of them will certainly be a linear representation of $$M_G$$. Although we have not been able to obtain polynomial time deterministic algorithms for computing linear representations of transversal matroids and gammoids, our results do imply an affirmative answer to Question 2. Our main theorem is the following.

### Theorem 1

There is a deterministic algorithm that, given a bipartite graph $$G=(U\uplus V,E)$$ with a maximum matching of size r, outputs a linear representation of the transversal matroid $$M_G=(U,\mathcal{I})$$ over a field $${\mathbb F}$$ of size $$>\left( {\begin{array}{c}\vert U \vert \\ r\end{array}}\right)$$, in time $${\mathcal {O}}(\left( {\begin{array}{c}\vert U \vert \\ r\end{array}}\right) \cdot \vert E\vert \sqrt{\vert V\vert } + N)$$, where N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}\vert U\vert \\ r\end{array}}\right) \vert V\vert \cdot \vert U\vert )$$ operations over $${\mathbb F}$$.

An XP algorithm for a parameterized problem $$\varPi \subseteq \varSigma ^* \times {\mathbb {N}}$$, takes as input $$(I,k)\in \varSigma ^* \times {\mathbb {N}}$$ and decides whether $$(I,k)\in \varPi$$ in time $$|I|^{g(k)}$$, where g(k) is a computable function in k alone. Thus, in the language of parameterized complexity, Theorem 1 gives an XP algorithm for finding a linear representation of transversal matroids parameterized by the rank of the given matroid. Observe that if r is the rank of the matroid then the maximum matching of the graph is r. That is, $$r=|U|-\ell$$ and hence $$\ell =|U|-r$$. This together with the fact that $${m \atopwithdelims ()a}={m \atopwithdelims ()m-a}$$ implies that Theorem 1 gives a polynomial time algorithm for Question 2, whenever $$\ell$$ is a constant.

Transversal matroids are closely related to the class of gammoids. A gammoid is defined by a digraph D and two vertex subsets S and T of V(D). Here, T is the ground set and a subset X of T is independent if and only if X is reachable from S by a collection of |X| vertex disjoint paths. It was shown by Ingleton and Piff [8], that a subclass of gammoids, called strict gammoids where $$T=V(D)$$, are the duals of transversal matroids. Thus, one can also view gammoids as matroids obtained from strict gammoids by deleting some of the elements from the ground set. Therefore the task of designing an algorithm to construct a linear representation for gammoids is at least as hard as constructing one for transversal matroids. In this work we prove the following theorem.

### Theorem 2

There is a deterministic algorithm that, given an n-vertex digraph D and $$S,T\subseteq V(D)$$ such that $$|S|=r$$ and $$|T|=n'$$, outputs a linear representation of the gammoid defined in D with ground set T, over a field $${\mathbb F}$$ of size strictly greater than $$\left( {\begin{array}{c}n'\\ r\end{array}}\right)$$ in time $${\mathcal {O}}(\left( {\begin{array}{c}n'\\ r\end{array}}\right) n^3 + N)$$, where N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}n'\\ r\end{array}}\right) n^3)$$ operations over $${\mathbb F}$$.

## 2 Preliminaries

For $$n\in {\mathbb N}$$, we use [n] to denote the set $$\{1,2,\ldots ,n\}$$. Let U be a set. We use $$\vert U \vert$$ to denote the cardinality of U and $$2^U$$ to denote the set of subsets of U. For $$i\in [\vert U \vert ]$$, $$\left( {\begin{array}{c}U\\ i\end{array}}\right)$$ denotes the set $$\{S\subseteq U~|~\vert S\vert =i\}$$.

Graphs. We use G to denote a graph and D to denote a digraph. The vertex set and edge (arc) set of a graph (digraph) are denoted as V(G) (V(D)) and E(G) (A(D)) respectively. We also use $$G=(V,E)$$ (or $$D=(V,A)$$) to denote a graph (digraph) with vertex set V and edge set E (arc set A). We use standard notations from graph theory [1]. For a graph G, and $$u,v\in V(G)$$ we use uv to denote the edge with end vertices u and v. An induced subgraph of G on the vertex set $$V'\subseteq V(G)$$ is written as $$G[V']$$. A matching in a graph G is a collection of edges such that no two edges share a common end vertices. We say a matching M in a graph Gsaturates$$V'\subseteq V(G)$$, if all the vertices in $$V'$$ are end vertices of edges in M. For a digraph D and $$u,v\in V(D)$$, a path from u to v is a sequence of vertices $$u_1,u_2,\ldots ,u_{k}$$ such that $$u_1=u,u_k=v$$ and for all $$i\in [k-1]$$, $$u_iu_{i+1}\in A(D)$$.

Matrices and Linear algebra. For a finite field $${\mathbb F}$$, $${\mathbb F}[X]$$ denotes the ring of polynomials in X over $${\mathbb F}$$ and $${\mathbb F}(X)$$ denotes the field of fractions of $${\mathbb F}[X]$$. A vector v over a field $${\mathbb F}$$ is an array of elements from $${\mathbb F}$$. A set of vectors $$\{v_1, v_2, \ldots , v_k\}$$ are said to be linearly dependent if there exist elements $$a_1, a_2, \ldots , a_k \in {\mathbb F}$$, not all zero, such that $$\sum _{i=1}^{k} a_i v_i = 0$$. Otherwise these vectors are called linearly independent. We say a matrix A has dimension $$n \times m$$ (or $$n \times m$$ matrix A) if A has n rows and m columns. For a matrix A (or a vector v) we use $$A^T$$ (or $$v^T$$) to denote its transpose. The determinant of an $$n\times n$$ matrix A is denoted by $$\mathsf{det}(A)$$. For a matrix A, with rows indexed by elements from the set R and columns indexed by elements from the set C, $$R'\subseteq R$$ and $$C'\subseteq C$$, we use $$A[R',C']$$ to denote the matrix A restricted to rows $$R'$$ and columns $$C'$$. The rank of a matrix is the cardinality of a maximum sized set of columns which are linearly independent. Equivalently, the rank of a matrix A is the maximum number r such that there is a $$r \times r$$ submatrix whose determinant is non-zero.

Matroids. We recall a few definitions related to matroids. For a broader overview on matroids, we refer to [14].

### Definition 1

A matroid M is a pair $$(E,\mathcal {I})$$, where E is a set, called ground set and $$\mathcal {I}$$ is a family of subsets of E, called independent sets, with the following three properties: (i) $$\emptyset \in \mathcal {I}$$, (ii) if $$I\in \mathcal {I}$$ and $$I'\subseteq I$$, then $$I'\in \mathcal {I}$$, and (iii) if $$I,J\in \mathcal {I}$$ and $$\vert I\vert <\vert J\vert$$, then there is $$e\in J\setminus I$$ such that $$I\cup \{e\}\in \mathcal {I}$$.

Any set $$F\subseteq E$$, $$F\notin \mathcal {I}$$, is called a dependent set and an inclusion wise maximal set B such that $$B\in \mathcal {I}$$ is called a basis. The cardinality of a basis in a matroid M is called the rank of M and is denoted by $$\mathsf{rank}(M)$$. The rank function of M, denoted by $$r_M$$, is a function from $$2^E$$ to $${\mathbb N}\cup \{0\}$$ and is defined as, $$r_M(S)=\max _{S'\subseteq S, S'\in \mathcal {I}} \vert S'\vert$$ for any $$S\subseteq E.$$

### Proposition 1

Let $$M=(E,\mathcal {I})$$ be a matroid. If $$A\in \mathcal {I}$$, $$B\subseteq E$$ and $$r_M$$$$(A\cup B)=\ell$$ then there is a subset $$B'\subseteq B$$, $$\vert B'\vert =\ell -\vert A\vert$$ such that $$A\cup B' \in \mathcal {I}$$.

### Definition 2

Let A be a matrix over a field $$\mathbb F$$ and E be the set of columns of A. The pair $$(E,\mathcal {I})$$, where $$\mathcal {I}$$ defined as follows, is a matroid, called linear matroid and is denoted by M[A]. For any $$X \subseteq E$$, $$X\in \mathcal I$$ if and only if the columns of A corresponding to X are linearly independent over $$\mathbb F$$. If a matroid M can be defined by a matrix A over a field $$\mathbb F$$, then we say that the matroid is representable over $$\mathbb F$$ and A is a linear representation of M.

A matroid $$M=(E,\mathcal{I})$$ is called representable or linear if it is representable over some field $$\mathbb F$$.

### Definition 3

The dual of a matroid $$M=(E,\mathcal {I})$$, is a matroid, denoted by $$M^*$$, on the same ground set E, in which a set S is independent if and only if there is basis of M fully contained in $$E\setminus S$$.

### Definition 4

Let $$M=(E,\mathcal{I})$$ be a matroid and $$F\subseteq E$$. Then the deletion of F in M, is a matroid, denoted by $$M$$$$\setminus$$$$F$$, whose independent sets are the independent sets of M that are contained in $$E\setminus F$$.

### Definition 5

Let $$M=(E,\mathcal{I})$$ be a matroid and $$F\subseteq E$$. Then the contraction of M by F, is a matroid, denoted by M/F, on the ground set $$E\setminus F$$, whose rank function is defined as, $$r_{M/F}(A)=r_M(A\cup F)-r_M(F)$$ for any $$A\subseteq E\setminus F$$.

### Proposition 2

([14]). Let $$M=(E,\mathcal{I})$$ be a matroid and $$F\subseteq E$$. Then $$M^*\setminus F= (M/F)^*$$.

### Proposition 3

([14]). Given a matroid $$M=(E,\mathcal{I})$$ with an $$n\times m$$ matrix A over a field $${\mathbb F}$$ as its linear representation and $$F\subseteq E$$. Then linear representations of $$M^*$$, $$M\setminus F$$ and M/F over the same field $${\mathbb F}$$ can be computed by using only polynomially (in n and m) many operations over $${\mathbb F}$$.

### Definition 6

(Truncation of a matroid). Let $$M=(E,\mathcal{I})$$ be a matroid and $$k\in {\mathbb N}$$. Then the k-truncation of M is a matroid $$M'=(E',\mathcal{I}')$$ such that for any $$F\subseteq E$$, $$F\in \mathcal{I}'$$ if and only if $$\vert F \vert \le k$$ and $$F\in \mathcal{I}$$.

The following theorem proved in [12] implies that there is an algorithm which given a linear representation of a matroid M over a field $${\mathbb F}$$, outputs a linear representation of a truncation of M over the field $${\mathbb F}(Y)$$ using only polynomially many operations over $${\mathbb F}$$.

### Theorem 3

([12]). There is an algorithm that, given an $$n\times m$$ matrix M of rank n over a field $${\mathbb F}$$ and a number $$k \le n$$, uses $${{\mathcal {O}}}(mnk)$$ field operations over $${\mathbb F}$$ and computes a matrix $$M_k$$ over the field $${\mathbb F}(Y)$$, which represents the k-truncation of M. Furthermore, given $$M_k$$ and a set of columns in $$M_k$$, we can test whether they are linearly independent using $${{\mathcal {O}}}(n^2k^3)$$ field operations over $${\mathbb F}$$.

Note that, in the above theorem Y is a single variable, rather than a set of variables. Hence testing if a determinant is non-zero over this field is simply a matter of checking if a univariate polynomial in the variable Y is non-zero. Furthermore, in many cases the output of the above theorem lies in a finite degree extension of $$\mathbb F$$. The two important matroids we are interested in this work are transversal matroids and gammoids.

### Definition 7

Let $$G=(U\uplus V,E)$$ be a bipartite graph. The transversal matroid associated with G, denoted by $$M_G$$, has ground set U and a set $$U'\subseteq U$$ is independent in $$M_G$$ if and only if there is a matching in G saturating $$U'$$.

### Definition 8

Let D be a digraph and $$S,T\subseteq V(D)$$. Then a gammoid with respect to D and S on ground set T is a matroid $$(T,\mathcal {I})$$, where $$\mathcal {I}$$ is defined as follows. For any $$T'\subseteq T$$, $$T'\in \mathcal {I}$$, if and only if there are $$\vert T'\vert$$ vertex disjoint paths whose start vertices are in S and end vertices are in $$T'$$. When $$T=V(D)$$, the gammoid is called a strict gammoid. In other words, for any $$T\subseteq V(D)$$ a gammoid on the ground set T is obtained from the strict gammoid by deleting $$V(D)\setminus T$$.

As mentioned earlier, there is a randomized polynomial time algorithm to construct a linear representation of transversal matroids [13]. The following useful result is proved by Ingleton and Piff in 1972 [8] (see also [13, 14]), shows that strict gammoids and transversal matroids are duals.

### Lemma 1

Let D be a digraph and $$S\subseteq V(D)$$. Let $$T=V(D)$$ and $$V'=V(D)\setminus S$$ be two copies of vertex subsets. Then there is bipartite graph $$G=(T\uplus V',E)$$ such that the strict gammoid with respect to D and S is the dual of the transversal matroid $$M_G$$ on the ground set T. Moreover, there is a polynomial time algorithm that, given D and S, outputs the graph G.

## 3 The Algorithm for Representing Transversal Matroids

In this section, we first give a deterministic algorithm to compute a linear representation of transversal matroids. That is, we give a deterministic algorithm to construct a linear representation of transversal matroids, and moreover, one can test whether a subset of the ground set is independent or not, in polynomial time. In the next section, we show that this algorithm may be modified to obtain more efficient algorithms for other classes of matroids that are related to transversal matroids.

Let $$G=(U\uplus V, E)$$ be a bipartite graph such that U and V contain m and n vertices, respectively. Let $$U=\{u_1,\ldots ,u_m\}$$ and $$V=\{v_1,\ldots ,v_n\}$$. Let $$M_G=(U,\mathcal{I})$$ be the transversal matroid associated with G where the ground set is U. That is, $$S\subseteq U$$ is independent in $$M_G$$ if and only if there is a matching in G, saturating S. Let $$A'$$ be the bipartite adjacency matrix of G. That is, the rows of $$A'$$ are indexed with elements from V, columns of $$A'$$ are indexed with elements from U, and for any $$v\in V, u\in U$$, $$A'[v,u]=1$$ if and only if $$vu\in E$$. Let A be an $$n\times m$$ matrix defined as follows. For any $$v_i\in V,u_j\in U$$, $$A[v_i,u_j]= A'[v_i,u_j]\cdot x_{i,j}$$, where $$X=\{x_{i,j}~|~i\in [n], j\in [m]\}$$ is a set of variables. Notice that for any $$v\in V,u\in U$$, $$A[v,u]=0$$ if and only if $$vu\notin E$$. Also, note that each variable $$x_{i,j}$$ appears at most once in the matrix A.

Now we describe our algorithm to find a linear representation of transversal matroids. We call this algorithm, Algorithm $$\mathcal{A}$$. For each $$j\in [m]$$, we define a set $$X_j=\{x_{i,j} \mid i\in [n]\}$$. Our algorithm is an iterative algorithm that produces values for $$X_1, X_2, \ldots , X_m$$ in order, by solving a system of linear inequations in the variables in $$X_i$$ in the i-th iteration. Let r be the size of a maximum matching in G. Now we define a family of subsets of U as $$\mathcal{B}=\{S\in \left( {\begin{array}{c}U\\ r\end{array}}\right) ~|~\textit{there is a matching in}\,\, G \,\,\textit{saturating}\,\, S\}.$$ That is $$\mathcal{B}$$ is the set of bases in $$M_G$$ and let $$\mathcal{B}=\{S_1,\ldots ,S_t\}$$. Notice that $$t=\vert \mathcal{B}\vert$$, is the number of bases in $$M_G$$. Now, for any $$S\in \mathcal{B}$$, we fix a matching $${{\mathsf {M}}}(S)$$ saturating S. For any $$S\in \mathcal{B}$$, let R(S) be the set of vertices from V, saturated by $${{\mathsf {M}}}(S)$$. Note that $$R(S)\in \left( {\begin{array}{c}V\\ r\end{array}}\right)$$, and $$G[S\cup R(S)]$$ has a perfect matching (a matching of size r). Our goal is to assign values to all the variables in X from a field such that for any $$S\in \mathcal{B}$$, $$\mathsf{det}(A[R(S),S])\ne 0$$. We will then show that this is enough to produce a linear representation of $$M_G$$ (the details may be found in the correctness proof presented later in this section).

Let us now describe the steps of our algorithm. Recall that for each $$j\in [m]$$, $$X_j=\{x_{i,j}~|~i\in [n]\}$$. Let $$X_{<j}=\bigcup _{j'=1}^{j-1} X_{j'}$$ for any $$j\in [m]\setminus \{1\}$$ and $$X_{<1}=\emptyset$$. For $$S\subseteq U$$, and $$j \in [m]$$, we define $$S(j)=\{u_{j'}\in S~|~j'\in [j]\}$$. Let $${\mathbb F}$$ be a field of size strictly more than $$\left( {\begin{array}{c}m\\ r\end{array}}\right)$$. Our algorithm assigns values for the variables in $$X_j$$ in the increasing order of j. In the j-th iteration, for $$j \ge 1$$, the algorithm will assign values for variables in $$X_j$$ as follows. Note that at this stage, all the variables in $$X_{<j}$$ have been assigned values already. We denote by $$A_{j-1}$$ the matrix A instantiated with the values for $$X_{<j}$$.

For any $$S_i\in \mathcal{B}$$, recall that $${{\mathsf {M}}}(S_i)$$ is a fixed matching. Let $${{\mathsf {M}}}_{ij}$$ be the set of edges in $${{\mathsf {M}}}(S_i)$$ which saturate the vertices in $$S_i(j)$$. Let $$R_{ij}$$ be the subset of V saturated by $${{\mathsf {M}}}_{ij}$$. Notice that the matching $${{\mathsf {M}}}_{ij}$$ saturates the vertices $$S_i(j)\cup R_{ij}$$. Now the algorithm obtains values for $$X_j$$ by solving the following inequalities.
\begin{aligned}&\mathsf{det}(A_{j-1}[R_{ij},S_i(j)])\ne 0 \end{aligned}
(1)
Observe that for each $$i\in [t]$$, $$\mathsf{det}(A_{j-1}[R_{ij},S_i(j)])$$ is a linear function of the variables in $$X_j$$, since all the entries in $$A_{j-1}[R_{ij},S_i(j)]$$ are elements from $${\mathbb F}$$ except the entries in the last column which are either 0 or variables from $$X_j$$. Therefore, (1) can be stated as a system of linear inequations in the variables in $$X_j$$.
\begin{aligned}&DX_j\ne \mathbf {0} \end{aligned}
(2)
where D is a $$t'\times n$$ matrix for some $$t'\le t$$ and $$\mathbf {0}$$ is a zero column vector of length $$t'$$. The entries in $$DX_j$$ are linear functions, and note that the constraints require that every one of these linear functions is non-zero. We also know that $$\vert {\mathbb F}\vert > t'$$. Now our algorithm will execute the following algorithm (Lemma 2) to find a solution to the system (2).

### Lemma 2

Let $${\mathbb F}$$ be a field of size $$>t$$ and let D be a $$t\times n$$ matrix over $${\mathbb F}$$ such that no row vector in D contains only zeros. Then there is an n-length column vector $$Y^*$$ such that $$DY^*\ne \mathbf {0}$$. Moreover such a vector can be computed using $${\mathcal {O}}(t\cdot n)$$ operations over the field $${\mathbb F}$$.

### Proof

Let $$Y=[y_1,\ldots ,y_n]^T$$ be a column vector containing n variables. We will directly give an n step iterative process to compute $$Y^*$$, an instantiation of Y satisfying the system of linear inequations $$DY\ne \mathbf {0}$$. Initially, set all the variables in Y to be 0 and we use Y(0) to denote this assignment. In other words, Y(0) is a n length zero column vector. At each step we find out new assignment for Y. In step i we find out an assignment Y(i) for Y and prove that indeed $$D\cdot Y(i)\ne \mathbf {0}$$. Now for any $$i\in [n]$$, at step i, Y(i) is computed as follows. Note that at this step we have the assignment $$Y(i-1)$$ for Y. In other words, $$Y(i-1)$$ is an n-length column vector such that the $$j^{th}$$ entry is same as the value assigned for $$y_j$$ in step $$i-1$$. Let $$Z_i$$ be an n-length column vector where all entries are same as the entries in $$Y(i-1)$$, except the $$i^{th}$$ entry which is the variable $$y_i$$. That is, in $$Z_i$$, we did not assign any value to $$y_i$$, but all other variables are assigned the same value as in the assignment $$Y(i-1)$$. Now consider the entries in the column vector $$DZ_i$$. Some entries are elements in the field $${\mathbb F}$$ and some are linear functions on variable $$y_i$$. Let $$P_1(y_i)=p_1 y_i+q_{1},\ldots , P_{t'}(y_i)=p_{t'}y_i+q_{t'}$$ be the entries in $$DZ_j$$ which are linear functions. Notice that $$t'\le t$$. Since the size of the field $${\mathbb F}$$ is strictly larger than $$t\ge t'$$, there is an element $$a\in {\mathbb F}$$ such that for all $$j\in [t']$$, $$P_j(y_i)\ne 0$$, because for any linear function $$P_j(y_i)$$, $$P_j(y_i)=0$$ only when $$y_i=-q_j/p_j$$. Now we set Y(i) as follows. Each entry in Y(i) is same as each entry in $$Y(i-1)$$, except the $$i^{th}$$ entry which is set to a. Our algorithm will output Y(n) as the required column vector. The correctness of the algorithm follows from the claim below.

### Claim

($$\star$$1). For all $$i\in \{0,1,\ldots ,n\}$$, Y(i) satisfies the set of inequalities in $$DY\ne \mathbf {0}$$, containing variables only from $$\{y_{1},\ldots ,y_i\}$$.

At step i, the algorithm computes $$DZ_i$$ and chooses a value for $$y_i$$ by looking at a linear function of $$y_i$$ in the t-length column vector $$DZ_i$$. Since $$Z_{i-1}$$ and $$Z_i$$ differ only in two entries, $$DZ_i$$ can be computed from $$DZ_{i-1}$$, and the $$(i-1)^{st}$$ and $$i^{th}$$ columns of D, using $${\mathcal {O}}(t)$$ operations over $${\mathbb F}$$. Since algorithm has n iterations, the number of field operations performed is $${\mathcal {O}}(t\cdot n)$$.    $$\square$$

Our algorithm iterates over all values of j from $$1, 2, \ldots m$$, and produces an assignment of values from the field $$\mathbb F$$ for the variables in $$X_j$$ in the j-th iteration. After m iterations an assignment for all variables will have been computed, and we let $$A_m$$ be the instantiation of the matrix A with this assignment. Our algorithm outputs $$A_m$$ as the representation of the transversal matroid $$M_G$$. This completes the description of Algorithm $${\mathcal {A}}$$. The following two lemmata are required for proving the correctness of Algorithm $$\mathcal{A}$$.

### Lemma 3

($$\star$$). For any $$j\in [m]$$ and $$S_i\in \mathcal{B}$$, let $${{\mathsf {M}}}_{ij}$$ be the set of edges in $${{\mathsf {M}}}(S_i)$$ which saturates $$S_i(j)$$. Let $$R_{ij}\subseteq V$$ be the set of vertices in V saturated by $${{\mathsf {M}}}_{ij}$$. Then $$\mathsf{det}(A_{j}[R_{ij},S_i(j)])\ne 0$$.

### Lemma 4

($$\star$$). Let $$S'\subseteq U$$ such that there is no matching saturating $$S'$$ (or in other words $$S'\notin \mathcal {I}$$). Then the columns corresponding to $$S'$$ in $$A_m$$ are linearly dependent.

### Lemma 5

The matrix $$A_m$$ is a linear representation of the matroid $$M_G=(U,\mathcal{I})$$.

### Proof

We need to show that for any $$U'\subseteq U$$, $$U'\in \mathcal{I}$$ if and only if the columns in $$A_m$$ indexed with elements from $$U'$$ are linearly independent. If $$U'\notin \mathcal {I}$$, then by Lemma 4, the columns in $$A_m$$ indexed with elements from $$U'$$ are linearly dependent. Now we need to show that if $$U'\in \mathcal{I}$$, then the corresponding columns in $$A_m$$ are linearly independent. Since $$(U,\mathcal{I})$$ is a matroid, there is a set $$S\in \mathcal{B}$$ such that $$U'\subseteq S$$. Note that $$S(m)=S$$ and $${{\mathsf {M}}}(S)$$ is a fixed matching. Let R be the subset of V, saturated by the matching $${{\mathsf {M}}}(S)$$. By Lemma 3, $$\mathsf{det}(A_{m}[R,S])\ne 0$$. This implies that the columns of $$A_m$$ corresponding to S are linearly independent and since $$U'\subseteq S$$, the columns of $$A_m$$ corresponding to $$U'$$ are also linearly independent. This completes the proof of the lemma.    $$\square$$

### Lemma 6

Algorithm $$\mathcal{A}$$ runs in time $${\mathcal {O}}(\left( {\begin{array}{c}m\\ r\end{array}}\right) \cdot \vert E\vert \sqrt{n} + N)$$, where N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}m\\ r\end{array}}\right) n\cdot m)$$ operations over $${\mathbb F}$$.

### Proof

Algorithm $$\mathcal{A}$$ first computes $$\mathcal{B}$$ and for each $$S\in \mathcal{B}$$ a matching $${{\mathsf {M}}}(S)$$. This can be done by executing the bipartite maximum matching algorithm for each r-vertex subset of U. Since there are $$\left( {\begin{array}{c}m\\ r\end{array}}\right)$$ such subsets and each execution of the bipartite maximum matching algorithm is on a bipartite graph having at most $$r+n\le 2n$$ vertices, this step takes time $${\mathcal {O}}(\left( {\begin{array}{c}m\\ r\end{array}}\right) \cdot \vert E\vert \sqrt{n})$$ [7]. Following this, Algorithm $$\mathcal{A}$$ executes the algorithm of Lemma 2 once for each $$X_i$$, where $$i\in [m]$$. Since each execution of this algorithm takes $${\mathcal {O}}(\left( {\begin{array}{c}m\\ r\end{array}}\right) n)$$ field operations, the total number of field operations required for the second phase of Algorithm $$\mathcal A$$ is $${\mathcal {O}}(\left( {\begin{array}{c}m\\ r\end{array}}\right) mn)$$. This completes the proof of the lemma.    $$\square$$

The correctness and running time bounds we have obtained for Algorithm $$\mathcal A$$ imply Theorem 1.

## 4 Representing Matroids Related to Transversal Matroids

In this section, we give deterministic algorithms for constructing linear representations of gammoids and strict gammoids. These algorithms utilize the algorithm for constructing linear representation of transversal matroids.

Truncations of transversal matroids. Several algorithmic applications require a linear representation of the k-truncation of matroids [2, 5, 12]. While, we can obtain a representation of the k-truncation of a transversal matroid $$M_G$$, by applying Theorem 3 to a representation of $$M_G$$, it very inefficient when $$k \ll n$$ which is usually the case in many applications. We can get a faster algorithm for this problem by slightly modifying Algorithm $$\mathcal{A}$$ and using Theorem 3. In the new algorithm, call it Algorithm $$\mathcal{A}'$$, we define $$\mathcal{B}$$ as $$\mathcal{B}=\{S\in \left( {\begin{array}{c}U\\ k\end{array}}\right) ~|~\textit{there is a matching in}\,\, G\,\, \textit{saturating}\,\, S\}.$$ That is, $$\mathcal{B}$$ is directly defined to be the set of bases in the k-truncation of $$M_G$$. Then we follow the steps of algorithm $$\mathcal{A}$$. This algorithm will output an $$n\times m$$ matrix $${\hat{A}}$$ over a field of size strictly more than $$\left( {\begin{array}{c}\vert U \vert \\ k\end{array}}\right)$$. Lemmata 3 and 4 are clearly true for Algorithm $$\mathcal{A}'$$ as well. That is, all the columns corresponds to a basis in k-truncation of $$M_G$$ form a set of linearly independent vectors. But there may be a set of columns of size strictly greater than k which are also linearly independent. To get rid of this, we apply Theorem 3 to obtain the k-truncation of $${\hat{A}}$$, which gives us a linear representation of the k-truncation of $$M_G$$.

### Theorem 4

There is a deterministic algorithm that, given a bipartite graph $$G=(U\uplus V,E)$$ and $$k\in {\mathbb N}$$, outputs a linear representation of the k-truncation of the transversal matroid $$M_G=(U,\mathcal{I})$$ over a field $${\mathbb F}(Y)$$ where $${\mathbb F}$$ has size strictly greater than $$\left( {\begin{array}{c}\vert U \vert \\ k\end{array}}\right)$$, in time $${\mathcal {O}}(\left( {\begin{array}{c}\vert U \vert \\ k\end{array}}\right) \vert V \vert \cdot \vert E\vert + N)$$, where N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}\vert U\vert \\ k\end{array}}\right) \vert V\vert \cdot \vert U\vert )$$ operations over $${\mathbb F}$$.

Contractions of transversal matroids. Here, we give a faster algorithm to compute a linear representation for a contracted transversal matroid by modifying Algorithm $$\mathcal{A}$$. We will use this linear representation to obtain a linear representation of gammoids. Let $$M_G=(U,\mathcal{I})$$ be the transversal matroid associated with the graph $$G=(U\uplus V,E)$$ on ground set U. Let $$F\subseteq U$$. One way of getting a representation of $$M_G/F$$ is to find a linear representation of $$M_G$$ and then find a linear representation of $$M_G/F$$ by applying Proposition 3, but we can do better. Let r be the size of a maximum matching in G, that is $$r_{M_G}(U)=r$$. Let $$r_{M_G}(F)=\ell$$ and $$k=r_{M_G}(U)-r_{M_G}(F)$$. Note that the rank of $$M_G/F$$ is k. Now we explain how to modify Algorithm $$\mathcal{A}$$ to get an algorithm, $$\mathcal{A}''$$, for computing a linear representation of $$M_G/F$$. Towards that we first define $$\mathcal{B}$$ as $$\mathcal{B}=\{S\in \left( {\begin{array}{c}U\\ r\end{array}}\right) ~|~\textit{there is a matching in} \,\,G\,\, \textit{saturating}\,\, S\,\, \textit{and } \vert S\setminus F\vert =k \}.$$ Now, Algorithm $$\mathcal{A}''$$ follows the steps of Algorithm $$\mathcal{A}$$ and it constructs an $$n\times m$$ matrix $$A_m$$. Lemmata 3 and 4 are true in this case as well. Let $$M[A_m]=(E,\mathcal{I}'')$$ be the matroid represented by the matrix $$A_m$$. Now Algorithm $$\mathcal{A}''$$ run the algorithm mentioned in Proposition 3 to compute a linear representation C of $$M[A_m]/F$$.

### Lemma 7

($$\star$$). The matrix C is a linear representation of $$M_G/F$$.

Now consider the running time of Algorithm $$\mathcal{A}''$$. Let M be a maximum matching in $$G[F\cup V]$$ and the $$F'$$ be the set of vertices from F saturated by M. By Proposition 1, for any $$S' \subseteq U\setminus F$$ of cardinality k, there is a matching of size r in $$G[F\cup S']$$ if and only if there is a matching of size r in $$G[F'\cup S']$$. This implies that algorithm $$\mathcal{A}''$$ can construct $$\mathcal{B}$$, by running the bipartite maximum matching algorithm at most $$\left( {\begin{array}{c}n-\vert F \vert \\ k\end{array}}\right)$$ times. Thus, we get the following theorem.

### Theorem 5

There is a deterministic algorithm that, given a bipartite graph $$G=(U\uplus V,E)$$ and a vertex set $$F\subseteq U$$, outputs a linear representation of $$M_G/F$$ over a field $${\mathbb F}$$ of size strictly greater than $$\left( {\begin{array}{c}\vert U \vert -|F|\\ k\end{array}}\right)$$, in time $${\mathcal {O}}(\left( {\begin{array}{c}\vert U \vert \\ k\end{array}}\right) \vert V \vert \cdot \vert E\vert + N)$$, where $$k=\mathsf{rank}(M_G/F)$$ and N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}\vert U\vert -|F|\\ k\end{array}}\right) \vert V\vert \cdot \vert U\vert )$$ operations over $${\mathbb F}$$.

Gammoids. Now we give an algorithm to compute a linear representation of a gammoid efficiently. By Lemma 1, we know that there is a polynomial time algorithm which given a digraph D and $$S\subseteq V(D)$$, outputs a bipartite graph $$G=(T\uplus V',E)$$, where $$T=V(D)$$ and $$V'=V(D)\setminus S$$, such that the strict gammoid with respect to D and S is the dual of the transversal matroid $$M_G$$ on the ground set T. Thus by Lemma 1, Theorem 1 and Proposition 3, we get the following theorem.

### Theorem 6

Let D be an n-vertex digraph, $$S\subseteq V(D)$$, $$\vert S\vert =r$$ and $${\mathbb F}$$ be a field of size strictly greater than $$\left( {\begin{array}{c}n\\ n-r\end{array}}\right)$$. Then there is a deterministic algorithm which outputs a linear representation of the strict gammoid with respect to D and S, over $${\mathbb F}$$ in time $${\mathcal {O}}(\left( {\begin{array}{c}n\\ n-r\end{array}}\right) n^3 + N)$$, where N is the time required to perform $${\mathcal {O}}(\left( {\begin{array}{c}n\\ n-r\end{array}}\right) n^2)$$ operations over $${\mathbb F}$$.

One way to get a representation of a gammoid is to first construct a representation of the strict gammoid in the graph and then delete some elements from the strict gammoid. However, observe that if we compute the representation of the strict gammoid via the algorithm of Theorem 6, the running time depends on the total number of vertices in the graph. We can obtain a much faster algorithm as follows. Let D be a digraph and let S and W be subsets of V(D). Let M be the gammoid in D with ground set $$W \subseteq V(D)$$, with respect to $$S \subseteq V(D)$$ of rank r. We may assume that $$r = |S|$$. Otherwise, we construct the graph $$D'$$ obtained from D by adding $$S'$$, a set of r new vertices, and all possible edges from $$S'$$ to S. Now consider the gammoid in $$D'$$ with ground set W with respect to $$S'$$. It is easy to see that, for any subset of X of W, there are |X| vertex disjoint paths from $$S'$$ to X in $$D'$$ if and only if there are |X| vertex disjoint paths from S to X in D. So these two gammoids are the same and our assumption holds. Now let $$M_S$$ be the strict gammoid in D with respect to S and note that the rank of $$M_S$$ and M are same. Let $$M^*_S$$ be the transversal matroid which is the dual of $$M_S$$ and it is defined on the bipartite graph $$G = (V(D) \uplus V', E)$$, where $$V' = V(D) \setminus S$$. Now let N be the matroid obtained from $$M^*_S$$ by contracting $$V(D) \setminus W$$. It is easy to see the following lemma.

### Lemma 8

$$M=N^*$$.

### Proof

Since N is a matroid obtained by contracting $$V(D) \setminus W$$ in $$M^*_S$$, Proposition 2 implies that $$N^*$$ is the matroid $$M_S\setminus (V(D) \setminus W)$$. That is $$N^*=M$$.    $$\square$$

Combining Lemma 8, Theorem 5 and Proposition 3 we obtain Theorem 2.

## Footnotes

1. 1.

Proof of results marked ($$\star$$) have been omitted due to space constraints.

### References

1. 1.
Diestel, R.: Graph Theory. Graduate Texts in Mathematics, vol. 173, 3rd edn. Springer, Berlin (2005)
2. 2.
Fomin, F.V., Golovach, P.A., Panolan, F., Saurabh, S.: Editing to connected f-degree graph. In: 33rd Symposium on Theoretical Aspects of Computer Science, STACS 2016, 17–20 February 2016, Orléans, France, pp. 36:1–36:14 (2016)Google Scholar
3. 3.
Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Representative sets of product families. In: Schulz, A.S., Wagner, D. (eds.) ESA 2014. LNCS, vol. 8737, pp. 443–454. Springer, Heidelberg (2014). doi:10.1007/978-3-662-44777-2_37 Google Scholar
4. 4.
Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Efficient computation of representative families with applications in parameterized and exact algorithms. J. ACM 63(4), 29:1–29:60 (2016)
5. 5.
Goyal, P., Misra, P., Panolan, F., Philip, G., Saurabh, S.: Finding even subgraphs even faster. In: 35th IARCS Annual Conference on Foundation of Software Technology and Theoretical Computer Science, FSTTCS 2015, 16–18 December 2015, Bangalore, India, pp. 434–447 (2015)Google Scholar
6. 6.
Hols, E.C., Kratsch, S.: A randomized polynomial kernel for subset feedback vertex set. In: 33rd Symposium on Theoretical Aspects of Computer Science, STACS 2016, 17–20 February 2016, Orléans, France, pp. 43:1–43:14 (2016)Google Scholar
7. 7.
Hopcroft, J.E., Karp, R.M.: An $$n^{5/2}$$ algorithm for maximum matchings in bipartite graphs. SIAM J. Comput. 2, 225–231 (1973)
8. 8.
Ingleton, A., Piff, M.: Gammoids and transversal matroids. J. Comb. Theory Ser. B 15(1), 51–68 (1973)
9. 9.
Kabanets, V., Impagliazzo, R.: Derandomizing polynomial identity tests means proving circuit lower bounds. Comput. Complex. 13(1–2), 1–46 (2004)
10. 10.
Kratsch, S., Wahlström, M.: Representative sets and irrelevant vertices: new tools for kernelization. In: Proceedings of the 53rd Annual Symposium on Foundations of Computer Science (FOCS), pp. 450–459 (2012)Google Scholar
11. 11.
Kratsch, S., Wahlström, M.: Compression via matroids: a randomized polynomial kernel for odd cycle transversal. ACM Trans. Algorithms 10(4), 20:1–20:15 (2014)
12. 12.
Lokshtanov, D., Misra, P., Panolan, F., Saurabh, S.: Deterministic truncation of linear matroids. In: Halldórsson, M.M., Iwama, K., Kobayashi, N., Speckmann, B. (eds.) ICALP 2015. LNCS, vol. 9134, pp. 922–934. Springer, Heidelberg (2015). doi:10.1007/978-3-662-47672-7_75
13. 13.
Marx, D.: A parameterized view on matroid optimization problems. Theor. Comput. Sci. 410(44), 4471–4479 (2009)
14. 14.
Oxley, J.G.: Matroid Theory. Oxford Graduate Texts in Mathematics, vol. 21, 2nd edn. Oxford University Press, Cambridge (2010)
15. 15.
Shachnai, H., Zehavi, M.: Representative families: a unified tradeoff-based approach. In: Schulz, A.S., Wagner, D. (eds.) ESA 2014. LNCS, vol. 8737, pp. 786–797. Springer, Heidelberg (2014). doi:10.1007/978-3-662-44777-2_65 Google Scholar

© Springer International Publishing AG 2017

## Authors and Affiliations

• Pranabendu Misra
• 1