1
$\begingroup$

I asked this question in the programming forum, but thought I might have better luck here.

I have a set of N (N is very large) linear equations with W variables (W may or may not be as large as N). The matrix of coefficients can be considered sparse.

For efficiency sake, I need to find the smallest number of linear equations that are solvable (have a unique solution). It can be assumed that a set of X equations containing Y variables has a unique solution when X == Y.

For example, if I have the following as input:

2a - b + c = 0
a - 0.5b = 0
-a + b = 2 

or

[[2 -1 1][1 -0.5 0][-1 1 0]]

I want to identify the equation set:

a - 0.5b = 0
-a + b = 2 

Currently, I have an implementation that uses some heuristics. I create a matrix, columns are variables and rows are equations. I search the matrix to find a set of fully connected equations, and then one-by-one try removing equations to see if the remaining set of equations is still solvable, if it is than continue, if not, return the set of equations. This method fails in some cases, when removing a single equation make the set unsolvable but removing multiple equations gives a solvable set.

Is there a better way to do this?

Thanks.

  • 0
    It looks like you want to find a smallest set $S$ of rows such that all nonzero entries in these rows are in a set of columns with the same cardinality as $S$ and the submatrix for these rows and columns is nonsingular. It wouldn't surprise me if this problem was NP-hard.2017-01-24

0 Answers 0