Generic Cospark of a Matrix Can Be Computed in Polynomial Time
Sichen Zhong, Yue Zhao

TL;DR
This paper proves that the generic cospark of a matrix, based on its sparsity pattern, can be computed efficiently in polynomial time, despite the NP-hardness of the general problem.
Contribution
The paper introduces a polynomial-time algorithm to compute the generic cospark of a matrix from its sparsity pattern, linking probabilistic properties to computational efficiency.
Findings
The generic cospark equals the maximum cospark over matrices with the same sparsity pattern.
With probability one, the cospark matches the generic cospark for matrices with entries drawn from continuous distributions.
The proposed algorithm computes the generic cospark in polynomial time.
Abstract
The cospark of a matrix is the cardinality of the sparsest vector in the column space of the matrix. Computing the cospark of a matrix is well known to be an NP hard problem. Given the sparsity pattern (i.e., the locations of the non-zero entries) of a matrix, if the non-zero entries are drawn from independently distributed continuous probability distributions, we prove that the cospark of the matrix equals, with probability one, to a particular number termed the generic cospark of the matrix. The generic cospark also equals to the maximum cospark of matrices consistent with the given sparsity pattern. We prove that the generic cospark of a matrix can be computed in polynomial time, and offer an algorithm that achieves this.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSparse and Compressive Sensing Techniques · Blind Source Separation Techniques · Advanced Optimization Algorithms Research
Generic Cospark of a Matrix Can Be Computed in Polynomial Time
Sichen Zhong1 and Yue Zhao2
1Department of Applied Mathematics and Statistics, 2Department of Electrical and Computer Engineering
Stony Brook University, Stony Brook, NY, 11794, USA
Emails: {sichen.zhong, yue.zhao.2}@stonybrook.edu
Abstract
The cospark of a matrix is the cardinality of the sparsest vector in the column space of the matrix. Computing the cospark of a matrix is well known to be an NP hard problem. Given the sparsity pattern (i.e., the locations of the non-zero entries) of a matrix, if the non-zero entries are drawn from independently distributed continuous probability distributions, we prove that the cospark of the matrix equals, with probability one, to a particular number termed the generic cospark of the matrix. The generic cospark also equals to the maximum cospark of matrices consistent with the given sparsity pattern. We prove that the generic cospark of a matrix can be computed in polynomial time, and offer an algorithm that achieves this.
I Introduction
The cospark of a matrix 111We note that the results in this paper can be straightforwardly generalized to complex numbers., denoted by cospark(), is defined to be the cardinality of the sparsest vector in the column space of [1]. In other words, cospark() is the optimum value of the following -minimization problem:
[TABLE]
where is the number of nonzero elements in the vector . It is well known that solving (1) is an NP-hard problem. Indeed, it is equivalent to computing the spark of an orthogonal complement of [1], where the spark of a matrix is defined to be the smallest number of linearly dependent columns of it [2]. Specifically, for with a full column rank, we can find an orthogonal complement of it, and (1) is equivalent to
[TABLE]
and the optimal value of (2) is the spark of , denoted by spark(). Computing spark is known to be NP hard [3].
The role of has been studied in decoding under sparse measurement errors where is the coding matrix [1]. In particular, gives the maximum number of errors that an ideal decoder can tolerate for exact recovery. Closely related to this is the role of in characterizing the ability to perform compressed sensing [1] [2]. Spark is also related to notions such as mutual coherence [2][4] and Restrict Isometry Property (RIP) [1] [5] which provide conditions under which sparse recovery can be performed using -1 relaxation. Last but not least, in addition to its role in the sparse recovery literature, cospark (1) also plays a central role in security problems in cyber-physical systems (see [6] among others).
In this paper, we study the problem of computing the cospark of a matrix. Although it is proven that is an NP hard problem, we show that the cospark that a matrix “generically” has can in fact be computed in polynomial time. Specifically, given the “sparsity pattern”, (i.e., the locations of all the non-zero entries of ,) equals, with probability one, to a particular number which we termed the generic cospark of , if the non-zero entries of are drawn from independent continuous probability distributions. Then, we develop an efficient algorithm that computes the generic cospark in polynomial time.
II Preliminaries
II-A Generic Rank of a Matrix
For a matrix , we define its sparsity pattern . Given a sparsity pattern , we denote to be the set of all matrices with sparsity pattern over the field . Since there is a one to one mapping between and , we use and interchangeably to denote a sparsity pattern in the remainder of the paper.
The generic rank of a matrix with sparsity pattern is defined as follows.
Definition 1** (Generic Rank).**
Given , the generic rank of is .
Clearly, if , the optimal value of (1) is zero. We will thus focus on the case for the remainder of the paper.
The following lemma states that the generic rank indeed “generically” equals to the rank of a matrix [7].
Lemma 1**.**
Given , with probability one, if the non-zero entries of are drawn from independently distributed continuous probability distributions.
II-B Matching Theory Basics
We now introduce some basics from classical matching theory [8] which are necessary for us to introduce the results in the remainder of the paper.
For a bipartite graph , a subset of edges is a matching if all the edges in are vertex disjoint. A max matching from onto is a matching with the maximum cardinality. A perfect matching from onto is a max matching where every vertex in is incident to an edge in the matching.
Consider a (not necessarily maximum) matching . A vertex is called matched if it is incident to some edge in , and unmatched otherwise. An alternating path with respect to is a path which alternates between using edges in and edges in , or vice versa. An augmenting path w.r.t is an alternating path w.r.t. which starts and ends at unmatched vertices. With an augmenting path , it can be easily shown that the symmetric difference222The symmetric difference of two sets and is defined as . gives a matching with size .
II-C Generic Rank as Max Matching
We now introduce an equivalent definition of generic rank via matching theory. A sparsity pattern can be represented as a bipartite graph as follows [7]. Let be a bipartite graph whose a) vertices correspond to all the row indices of , b) vertices correspond to all the column indices of , and c) edges in correspond to all the non-zero entries of . Accordingly, we also denote the bipartite graph for a sparsity pattern by .
The following lemma states the equality between and the max matching of [7].
Lemma 2**.**
Given , the generic rank equals to the cardinality of the maximum bipartite matching on .
Accordingly, finding a max matching on this graph using the Hopcroft-Karp algorithm allows us to find the generic rank with complexity [9].
III Generic Cospark
Similarly to the supremum definition of generic rank (cf. Definition 1), given the sparsity pattern of a matrix, we define generic cospark as follows.
Definition 2** (Generic Cospark).**
Given , the generic cospark of is .
In a spirit similar to the multiple interpretations of generic rank as in Section II, we provide a probabilistic view and a matching theory based view of generic cospark as follows.
III-A Cospark Equals to Generic Cospark With Probability One
For any , let and represent the matrix and the set of matrices restricted to the rows respectively. A class of matrices which has cospark equal to generic cospark are those which satisfy the following property:
Lemma 3**.**
Given any sparsity pattern so that for , for any , if , then .
Proof.
Let , and suppose , where is the th row of . Since , . Now consider another matrix with sparsity pattern . Since , is also nonempty, meaning there exists a nonzero vector such that . Because has no zero entries, we also have . This means . Hence, if , it follows , which proves the lemma. ∎
We note that the property is known as the matching property of matrix [10].
Now, we have the following theorem showing that the generic cospark indeed “generically” equals to the cospark.
Theorem 1**.**
Given , with probability one, if the non-zero entries of are drawn from independently distributed continuous probability distributions.
Proof.
If we have a matrix with sparsity pattern whose nonzeros are drawn from independent continuous distributions, then every submatrix of rows has rank equaling generic rank w. p. 1 (cf. Lemma 1). This immediately implies w. p. 1 by Lemma 3. ∎
III-B A Matching Theory based Definition of Generic Cospark
Let be the bipartite graph corresponding to . For a subset of vertices , we define the induced subgraph as the bipartite graph , where denotes the vertices in adjacent to the set . is essentially a bipartite graph corresponding to the submatrix . We then have the following.
Lemma 4**.**
Given G(X, Y, S), let be a largest subset such that the induced subgraph has a max matching of size . We have that \textit{spcospark(A^{S})}=m-|OPT|.
The intuition behind this matching theory based definition of spcospark() is the following. To find the sparsest vector in the image of , it is equivalent to find a largest set of rows in , , which span an dimensional subspace. With such a subset , we can find a vector that satisfies , and it is clear that . Furthermore, based on the equivalence between generic rank and max matching from Lemma 2, we arrive at the matching theory based definition of generic cospark in Lemma 4.
IV Efficient Algorithm for Computing Generic Cospark
In this section, we introduce an efficient algorithm that computes the generic cospark. This algorithm is based on a greedy approach motivated by Lemma 4.
Given , for any size subset of vertices , we define . In other words, is the index set of rows of with a zero entry in the remaining coordinate .
We use as a basis to construct a candidate solution for . The idea is to add a maximal subset of vertices to , such that has a matching of size onto . Specifically, we keep adding vertices to as long as the submatrix corresponding to the index set has generic rank no greater than . The following lemma shows that adding a vertex to can only increase the generic rank of by at most one.
Lemma 5**.**
Given , and , .
Remark 1**.**
*For a given , depending on the order we visit the vertices in , we could end up with different sets , possibly of different sizes. However, we will prove that the optimal solution is recovered regardless. *
are the candidate solutions for OPT, and we obtain the optimal solution by choosing the with the largest cardinality, i.e. . The generic cospark of then equals to .
The detailed algorithm is presented in Algorithm 1.
V Proof of Optimality of Algorithm 1
In this section, we prove that Algorithm 1 indeed solves the generic cospark. It is sufficient to prove that the set returned by the Algorithm satisfies the definition of in Lemma 4, i.e., is a subset of vertices of the largest size such that the induced subgraph has a max matching of size . Since by construction has a max matching of size , it is sufficient to prove that has the largest size, i.e., .
To prove this, let us consider an optimal set . We denote by the set of edges of a max matching of . We denote by the set of vertices in corresponding to this max matching, and denote by the remaining vertex in . We will show that, starting with , Algorithm 1 will return an such that , and hence . As the notations for this section are quite involved, an illustrative diagram is plotted in Figure 1 to help clarify the proof procedure in the following.
We first partition into , , where is the set of vertices in corresponding to the max matching . Hence, perfectly matches onto with . consists of the remaining vertices in unmatched by .
WLOG, we assume is nonempty. This is because, if is empty, we then immediately have .
We then have the following lemma about and .
Lemma 6**.**
For any such partition , we have that , and is nonempty.
Proof.
Let be partitioned into . Suppose . If , then is incident to , which means has a perfect matching onto . This contradicts has no perfect matching onto . Now suppose is empty. This means every vertex in is incident to . Since has a perfect matching onto and vertices in are incident to vertices in , it follows there exists an augmenting path from any vertex in to , which is a contradiction to . ∎
Accordingly, we can partition , with . Starting from here, the general idea of proving is to lower bound
[TABLE]
We immediately have the following lower bound on :
[TABLE]
This is because a) Algorithm 1 guarantees that , and b) every time we add a new vertex into (cf. Line 7 in Algorithm 1), increases by at most one (cf. Lemma 5). Since the initial generic cospark is , we need at least vertices added into to reach .
We next devote the majority of this section to provide a lower bound on .
V-A Lower Bounding
The key result we will rely on in this subsection is the following:
Theorem 2**.**
For the induced bipartite graph , there exists a max matching that does not touch any vertices in .
To prove Theorem 2, we start with a partial matching consisting only edges that touch . In other words, . The idea is that we will build a max matching starting from , and this max matching will not touch any vertices in , thus proving Theorem 2.
We have the following two lemmas.
Lemma 7**.**
For the induced bipartite graph with as a (not necessarily max) matching, any vertex in is incident to some edge in , i.e., already matched.
Proof.
First, note any is not incident to , so any vertex is in . Now, for any and any , we want to prove is incident to some edge in . Since , is incident to some edge . is the perfect matching from to , so certainly, is in . On the other hand, cannot be incident to , or there will exist a length augmenting path from to to to . Hence, , and the claim is proven. ∎
Lemma 8**.**
For the induced bipartite graph with as a (not necessarily max) matching, there exists no augmenting path starting from any .
Proof.
For any vertex that is unmatched w. r. t. , suppose there is an augmenting path from to using edges in . If is unmatched in the induced graph w.r.t and , then there exists an edge which is incident to . Because , must be incident to . This means if there exists an augmenting path from to w.r.t , then there must exist an augmenting path from to w.r.t , which contradicts vertices in do not have augmenting paths to . ∎
Lemma 8 implies that all augmenting paths w. r. t. the partial matching are from unmatched vertices in (where ) to unmatched vertices in . A corollary which will prove useful is the following:
Corollary 1**.**
Suppose is an augmenting path from to w. r. t. the matching . Then for any , there exists no alternating path w. r. t. from to any vertex in .
Proof.
Let be an augmenting path from to w.r.t. . Suppose there exists an alternating path from to a vertex , where is the first vertex in encountered when traversing . must have odd number of edges, since is a matched vertex in and is unmatched. Since is odd, . Hence, if is the restriction of from to , then the alternating path must also have odd length. The total length of must be odd since is an augmenting path, which means the length of the alternating path from to in must be even.
Since is an odd alternating path from to , and the alternating path from to in is even, then the alternating path from to is odd. Furthermore, and are unmatched, so this path is actually an augmenting path, which immediately contradicts Lemma 8. ∎
From Corollary 1, any alternating path starting from w. r. t. is vertex disjoint to any augmenting path . This implies that a) any alternating path from w. r. t. remains an alternating path, and b) there remains no augmenting path starting from w. r. t. , i.e., Lemma 8 continues to hold for with a new matching .
We are now ready to prove Theorem 2.
Proof of Theorem 2.
Take to be an initial matching onto . By Lemma 7, all vertices in are now matched, and Lemma 8 tells us we are left with augmenting paths starting from unmatched vertices in to unmatched vertices in . If is one such augmenting path, then is a matching with one greater cardinality. By Corollary 1, all alternating paths w.r.t starting from are vertex disjoint to , which implies alternating paths starting from remain unchanged. Furthermore, Corollary 1 tells us does not have augmenting paths starting from . Hence, the only remaining augmenting paths are still from vertices to vertices . If is such an augmenting path, we can now repeat the above procedure and compute the matching . Again, alternating paths starting from remain unchanged, and contains no augmenting paths starting from . We can repeat this procedure until all augmenting paths from to are eliminated. Since the final matching obtained this way has no augmenting paths, this final matching is optimal, and its edges are incident to no vertices in . ∎
As a result of Theorem 2, there exists a max matching of the bipartite graph that, on the “left hand side” of the graph, only touches vertices in . Since the size of the max matching of equals to (cf. Lemma 2), we arrive at the following lower bound on :
[TABLE]
V-B Proof of the Optimality of Algorithm 1
We now show that Algorithm 1 indeed returns the generic cospark as in the following theorem.
Theorem 3**.**
For the that Algorithm 1 returns, we have that .
Proof.
By the definition of , . To prove , starting from (3),
[TABLE]
where (7) is from (5), and (8) is from (4). ∎
VI Algorithm Complexity
We now show that Algorithm 1 is efficient, and provide an upper bound on its computational complexity.
Theorem 4**.**
Given any , Algorithm 1 computes in time.
Proof.
Observe in the pseudocode above, step 3 is over iterations. For each iteration, steps 4 to 9 are the most computationally expensive. Step 4 requires a scan of the rows of , and step 5 requires us to compute a perfect matching using Hopcroft-Karp algorithm, which can be done in time.
For the loop in steps 6 to 9, we do not need to recalculate every iteration. Given we know the max matching from the previous iteration, we only need to check if the new vertex added to has an augmenting path to an unmatched vertex in . Searching for this augmented path requires us to use breadth first search (BFS) or depth first search (DFS), which can be computed in time. Since there are iterations in the while loop, the total cost of steps 6 to 9 is .
Hence, for every iteration of step 3, the total cost is since . It follows immediately our total running time is . ∎
From Theorem 4, if is extremely sparse, the running time of Algorithm 1 is essentially quadratic.
Remark 2**.**
The algorithm’s bottleneck is in steps 6-9. For each row to add, we need to use a BFS. Since we need to add such vertices, the total complexity for these steps is as in the above proof. To improve this complexity, we would like to detect multiple candidate rows to add to using a single BFS. Indeed, it can be shown further that steps 6-9 of Algorithm 1 can be improved to based on an idea similar to Hopcroft-Karp matching [9]. This will improve the total running time of Algorithm 1 to . Details are omitted here.
VII Experimental Results for Verification
We compare the results from our algorithm of finding the generic cospark to a brute force algorithm of finding the cospark. Because the brute force algorithm has a computational complexity of , we limit the size of the test matrices to and .
We run our comparison over 10 different sparsity levels spaced equally between zero and one. For each sparsity level, we generate 50 matrices, where the locations of the nonzero entries are chosen uniformly at random given the sparsity level, and the values of the non-zero entries are drawn from independent uniform distributions in . For each of these 50 matrices, we compare the generic cospark given by Algorithm 1 versus that given by the brute force method. In every case, the solutions of both algorithms match. These results support the fact that our algorithm not only computes the generic cospark in polynomial time, but also obtains the actual cospark w. p. 1 if the non-zero entries are drawn from independent continuous probability distributions.
VIII Conclusion
We have shown that, although computing the cospark of a matrix is an NP hard problem, computing the generic cospark can be done in polynomial time. We have shown that, given any sparsity pattern of a matrix, the cospark is always upper bounded by the generic cospark, and is equal to the generic cospark with probability one if the nonzero entries of the matrix are drawn from independent continuous probability distributions. An efficient algorithm is developed that computes generic cospark in polynomial time.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] E. J. Candes and T. Tao, “Decoding by linear programming,” IEEE Transactions on Information Theory , vol. 51, no. 12, pp. 4203–4215, 2005.
- 2[2] D. L. Donoho and M. Elad, “Optimally sparse representation in general (nonorthogonal) dictionaries via l-1 minimization,” Proceedings of the National Academy of Sciences , vol. 100, no. 5, pp. 2197–2202, 2003.
- 3[3] A. M. Tillmann and M. E. Pfetsch, “The computational complexity of the restricted isometry property, the nullspace property, and related concepts in compressed sensing,” IEEE Transactions on Information Theory , vol. 60, no. 2, pp. 1248–1259, 2014.
- 4[4] R. Gribonval and M. Nielsen, “Sparse representations in unions of bases,” IEEE Transactions on Information Theory , vol. 49, no. 12, pp. 3320–3325, 2003.
- 5[5] E. J. Candes, J. K. Romberg, and T. Tao, “Stable signal recovery from incomplete and inaccurate measurements,” Communications on pure and applied mathematics , vol. 59, no. 8, pp. 1207–1223, 2006.
- 6[6] Y. Zhao, A. Goldsmith, and H. V. Poor, “Minimum sparsity of unobservable power network attacks,” IEEE Transactions on Automatic Control, to appear .
- 7[7] K. Reinschke, Multivariable Control - A Graph-Theoretic Approach . New York: Springer-Verlag, Lecture Notes in Control and Information Sciences, vol. 108, 1988.
- 8[8] R. Diestel, D. Král, and P. Seymour, “Graph theory,” Oberwolfach Reports , vol. 13, no. 1, pp. 51–86, 2016.
