Northeastern University, [email protected] \CopyrightXuangui Huang \ccsdesc[500]Theory of computation Problems, reductions and completeness \supplement\fundingSupported by NSF CCF award 1813930.
Acknowledgements.
The author thanks Emanuele Viola for helpful discussions.\EventEditorsJohn Q. Open and Joan R. Access \EventNoEds2 \EventLongTitle42nd Conference on Very Important Topics (CVIT 2016) \EventShortTitleCVIT 2016 \EventAcronymCVIT \EventYear2016 \EventDateDecember 24–27, 2016 \EventLocationLittle Whinging, United Kingdom \EventLogo \SeriesVolume42 \ArticleNo23Space Hardness of Solving Structured Linear Systems
Abstract
We show that if the probabilistic logarithmic-space solver or the deterministic nearly logarithmic-space solver for undirected Laplacian matrices can be extended to solve slightly larger subclasses of linear systems, then they can be use to solve all linear systems with similar space complexity. Previously Kyng and Zhang [7] proved similar results in the time complexity setting using reductions between approximate solvers. We prove that their reductions can be implemented using constant-depth, polynomial-size threshold circuits.
keywords:
linear system solver, logarithmic space, threshold circuitcategory:
\relatedversion1 Introduction
One of the oldest mathematical problems is to solve a linear system, that is to find a solution satisfying given an matrix and a -dimensional vector as input. In the RealRAM model this can be done in time, where [4] is the matrix multiplication constant. Much faster algorithms exist for approximately solving linear systems when is the Laplacian of undirected graphs. Indeed recent breakthroughs showed that it can be done in nearly linear time [13, 2]. Kyng and Zhang [7] further showed that if such solvers can be extended to nearly linear time solvers for some classes slightly larger than undirected Laplacians, we can also solve general linear systems in nearly linear time.
In this paper we are interested in the space complexity of this problem. For general linear systems Ta-shma gave a quantum algorithm using logarithmic space [14]. For undirected Laplacian, Doron et al. showed that it has a probabilistic logarithmic-space algorithm [3] and hence a deterministic -space algorithm by a well-known space-efficient derandomization result [12]. This was improved later to by Murtagh et al [10].
1.1 Our results
We prove a space hardness version of Kyng and Zhang’s results [7], showing space hardness of approximate linear system solvers for some classes slightly larger than undirected Laplacians, namely multi-commodity Laplacians, 2D Truss Stiffness Matrices, and Total Variation Matrices.
Theorem 1.1.
Suppose that for multi-commodity Laplacians, 2-D Truss Stiffness Matrices, or Total Variation Matrices, the linear system can be approximately solved in (nearly) logarithmic space with logarithmic dependence on condition number and accuracy (even if it only works in expectation or with high probability), then any linear systems with polynomially bounded integers and condition number can be solved in (nearly) logarithmic space with high accuracy (in expectation or with high probability, respectively).
This shows that if the probabilistic logspace solver for undirected Laplacian in [3], or the deterministic -space one in [10], can be extended to solve any of these three slightly larger subclasses of linear systems, we would have a surprising result that all linear systems can be approximately solved in probabilistic logspace or in deterministic -space. Pessimistically speaking the theorem means that it is very hard to get space efficient algorithms for these subclasses, as it is as difficult as solving all linear systems in a space efficient way. On the bright side, we actually prove that any progress on solving these subclasses using less space will immediately translate into similar progress for solving all linear system using less space.
Kyng and Zhang [7] proved their results via reductions from approximate solvers of general linear systems to those of three subclasses. In this paper we prove Theorem 1.1 by proving that their reductions can be carried out in a space efficient manner. Indeed we prove a much stronger result that their reductions can be implemented in circuits, which are constant-depth polynomial-size unbounded-fan in circuits with and gates. It shows that these reductions are actually highly parallelizable.
We denote as the class of all matrices with integer valued entries. In the context of solving linear systems, an all-zero row or column can be trivially handled, so we can assume without loss of generality that matrices in has at least one non-zero entry in every row and column. For 2-commodity matrices , we have two set of variables and of the same size, and the equations are scalings of , , and , where and . This generalizes undirected Laplacians, as the incidence matrices of undirected Lapacians only have equations of the form for .
Our main technical result proves that the reduction from to in [7] is -computable.
Theorem 1.2.
There is a -reduction from approximately solving to approximately solving .
In [7] it is shown that the matrix produced by this reduction is also a 2D Truss Stiffness Matrix as well as a Total Variation Matrix, therefore Theorem 1.2 also works for these classes. Also note that this reduction is a Karp-style reduction, i.e. it requires only one linear system solve and uses the solution in a black-box way. That is why Theorem 1.1 still applies if the solver only works in expectation or with high probability.
We also show -computability of the reductions in [7] to some more restrictive subclasses of , including , the exact class we have to solve when we use Interior Point Methods for 2-commodity problems, as explained in the Kyng and Zhang’s full paper [8]. They also showed that the promise problem of deciding if a vector is in the image of a matrix or -far from the image can be directly reduced to approximately solving linear systems. Combining with the above results, this shows that the promise problem can be reduced to approximately solving the above-mentioned subclasses in .
2 Simplified reductions in : the easy parts
Throughout this paper we use the sign-magnitude representation to encode a -bit signed integer into a sign bit, for positive and for negative, and bits for in binary. Note that in this method, has two representations and we accept both.
For simplicity we first prove the special case for the reduction from exact solver of to exact solver of .
Theorem 2.1.
Given an -bit matrix and a vector as input, we can compute in an -bit matrix and a vector such that:
-
•
has a solution if and only if has a solution;
-
•
if has a solution , then we can compute in from so that .
As in [7], this reduction is split into several steps using the following classes of matrices.
Definition 2.2 ([7]).
-
•
Let denote the class of matrices with integer valued entries such that every row has zero row sum;
-
•
Let denote the class of matrices with integer valued entries such that every row has zero row sum, and for each row the sum of positive coefficients is a power of .
Lemma 2.3.
There are -reductions for exact solvers of the following classes:
-
(i)
from to ;
-
(ii)
from to ;
-
(iii)
from to .
Lemma 2.3 (iii) is the main reduction in this paper (same as in [7]), which will be proved in the next section. In the remaining of this section we prove Lemma 2.3 (i) and (ii).
From to
Proof 2.4 (Proof sketch).
Given a matrix , we can define a matrix with one more column by . Obviously , and has a solution if and only if has a solution. We can also recover from by taking the first rows of and minus each of them by . The following results about additions imply that can be calculated in , and we can recover from in (for simplicity we ignore the precision problem here).
From to
Proof 2.5 (Proof sketch).
Given an -bit signed-integer matrix , we just need to add two more columns to make the sum of positive (and negative) entries in each row to the closet power of . This can be done in in the following way. For each row , we calculate the sum of positive entries by checking the sign bit then do the iterated addition in by Fact 1. We then take , which can be computed in given ’s. has at most bits so given by searching brute-forcely in we can find the minimum s.t. . Therefore by Fact 1 we can calculate in given . Then for each row we add and to the last two columns of to get . Additionally we need to add a new row to (and to accordingly) to zero out the last two variables we just added: set the last two entries into and , and set all other entries , and also add a entry to to get .
Obviously we have , and has a solution iff has a solution. We can easily recover from by taking the first rows.
For the next section we need the following definition.
Definition 2.6.
We say a matrix is -bounded if for each row the sum of positive coefficients is at most . Note that in such matrix every entry is a -bit signed integer.
Note that the reduction from to reduces an -bit matrix into an -bounded matrix , then the reduction from to reduces into an -bounded matrix .
3 Simplified main reduction in
The main reduction in [7] uses the pair-and-replace scheme to transform a linear system in to a -commodity equation system. The main idea is to use s consisting of equations to replace pairs of variables in the original linear system round-by-round according to the bit representation of their coefficients. A simplified version of the gadget, implicitly given in [7], is as follows.
Definition 3.1 (Simplified ).
Define to be the following set of 2-commodity linear equations representing “”:
For convenience we use an extra parameter to keep track of new variables that are only used in the gadgets.
Correctness of this gadget can be easily verified by summing up all the equations in it.
We now present a simplified reduction from exactly solving to exactly solving in Algorithm 1. We use to denote the -th row of .
Note that in we have two input variables sets , of the same size. That is why we have to multiply by 2 at last in the reduction. But here we will only use variables in in the s, and all the other variables are unused. For convenience we arrange the variables in the following way.
Remark 3.2 (Arrangement of variables).
In we put all the variables in before those in . More importantly, we put those variables that are only used in the gadgets behind all those in Line 1. Equivalently it can be viewed as the following process. We first run Algorithm 1 virtually before Line 1 to get , which is the number of variables ignoring those only used in the gadgets. Then we run it again on the original input, starting with being this value, and in Line 1 we use instead.
We give an example showing how the reduction works under this arrangement.
Example 3.3.
We show how the reduction runs on :
We are only eliminating the positive coefficient variables in this example for simplicity. In the first round we use new variables (and the corresponding gadgets) and to eliminate the first bit, getting the equation . These two generated variables are then eliminated in the second round by , in addition to for the second bit. In the third round we use and . Finally in the fourth round we use and get the equation after the reduction , with s representing , , , , , , and .
Correctness of this simplified reduction follows easily by correctness of the gadget, as our transformation preserves the original solution. Moreover, given a solution such that where and are obtained from running Algorithm 1 on input and , we can easily get the solution to the original equation system by simply taking the first elements in . It is also easy to get from if we can calculate in .
In the remaining of this section we are going to prove that Algorithm 1 can be implemented in . For , , we define
and similarly , , for the negative coefficient variables.
Example 3.4.
For the above example, we have , and the following values for each .
We have the following simple but crucial properties for these values.
Claim 2.
-
(i)
for all , ;
-
(ii)
for all , , ;
-
(iii)
For all , ,
thus ;
-
(iv)
;
-
(v)
.
Proof 3.5.
(i) and (ii) are trivial by definition. (iv) and (v) are straightforward from Algorithm 1 and (iii). For (iii), note that in each round for we will eliminate all the variables generated in the previous round for by construction (ignoring those variables that are only used in the gadgets), therefore we have and for . Here we rely on the property that the sum of positive (and negative) coefficients in each row is a power of to ensure that as calculated in this way are always integers. Then by induction we get the formula.
Note that in (iii) and are just right and left shifts, which can be easily implemented in the circuit model. Combining Claim 2 and Fact 1, we can see that all of these values can be computed in for all , i.e. the depths of the circuits are absolute constants independent of , , and .
Lemma 3.6 (Informal).
-
•
, , and have circuits of size for all ;
-
•
has circuits of size .
Now we can prove that the reduction from to can be done in . We represent the input matrix explicitly by giving all its entries in sign-magnitude form, and the output matrix implicitly by outputting the entry of in row column with , as additional inputs.
Theorem 3.7.
There is a circuit family of size with -bit input and -bit output such that:
-
•
the first bits of input represent a -bounded matrix in sign-magnitude form, the next bits of input represent an index , and the last bits represent another index ;
- •
Proof 3.8.
Consider the -th row of , we need to know the equation it corresponds to. Because we put those equations of s behind the modified equations of , we have two cases:
-
•
: in this case, the equation is after the transformation, which has the form with in binary since our transformation does not change the sum of positive (and negative) coefficients in . What remains is to calculate the indices and in .
Let for all and . For each , there are two cases:
-
–
No new variable is added, i.e. : there is only one entry in the original with the corresponding sign thus is the index of this entry. We search for this entry to get its index, which can be implemented in because there are possibilities.
-
–
Some new variables are added: then is the index of the last added new variable, ignoring those only in s. It can be calculated by
-
–
-
•
: in this case, this equation is in an gadget for some . We need to calculate , and in then it is easy to recover the equation from the offset in the gadget.
We can first calculate in the gadget’s index as is just ignoring the three least significant bits. By Algorithm 1 and Remark 3.2, we know thus it is -computable, and we can also calculate in by Fact 1.
Then we can calculate the number , , sign , and number such that this gadget is the -th gadget we created to eliminate the -th bit of for variables with sign . More specifically, we want to find the minimum , , (where we treat ‘’ ‘’) such that
where
There are possible choices for , , and each condition is a prefix sum of ’s, therefore this can be done in by a parallel comparison of to the prefix sums of ’s. After getting , , and , we can get by Fact 1.
What remains is to calculate and from , , , and . Note that when eliminating the -th bit of for variables with sign , we first eliminate in pairs those variables in the original that have in the -th bit before the reduction (we call them original pairs), then eliminate in pairs those generated in the previous round for , , and . The number of original pairs is given by , computable in . There are two cases:
-
–
: and is the indices of variables in the -th original pairs, which are the indices of the -th and -th variables in that have in the -th bit. Similarly as above, this can be done by a simple parallel comparison to prefix sums of the -th bits of variables in .
-
–
: then and are the -th and -th new variables generated in the previous round, therefore and .
However the second case above only works for even . When it is odd, corresponds to a pair with the last original variable in this round and the first generated variables in the previous round, thus can be calculated as in the first case and . Then for , we have and .
-
–
In conclusion, given as input, we can first check if in by Lemma 3.6 and if so compute coefficients of in , therefore with as input, we check if in and if so compute the entry of in row column in .
4 Genearlization to approximate solvers, and more restrictive classes
Now we are going to generalize the above results of reductions for exact solvers into those for approximate solvers, thus proving Theorem 1.2. First we need the following result showing the power of .
Fact 3.
Proof 4.1 (Proof sketch of Theorem 1.2).
Based on our proofs on the simplified reductions, we are going to prove that the original reductions from to in [7] can be computed in . In the context of approximate solvers, the error that solvers are required to achieve is also part of the instance. By Fact 3, all the errors in the reduced instances, as defined in the reductions in Kyng and Zhang’s full paper [8], can be computed in given the size, condition number, and bit-complexity of the original matrix as parameters.
-
•
From to : this reduction remains the same, but now knowing the accuracy we can recover from using fix-point arithmetic in .
-
•
From to : the only difference (besides the calculation of accuracy) is that in the original reduction in [8, Section 7.2], in the last row of the reduced matrix the last two entries are set to be and for some value , instead of and as in our simplified version. However is computable in by Fact 3 so the reduction is still computable in .
-
•
From to : for approximate solvers we will have to use the original in [8, Section 4] consisting of ten -commodity equations instead of eight and with additional variables. So we need to modify the corresponding numbers in our calculation, and in particular the gedget’s index becomes , which is still -computable. Besides, the equations in the for eliminating the -th bit of variables with sign in will be multiplied by a factor , where , as specified in Algorithm 1 of [8]. These factors can be calculated with desired accuracy in by Fact 3. Therefore the reduction is still computable in .
Additionally in the second and third reduction, when recovering from we need to check if the original matrix and vector satisfy and simply return if so. This can be done in by Fact 1. In conclusion, we can reduce the problem of approximately solving equations in to approximately solving equations in in .
In [7] they also considered some more restrictive subclasses of . Intuitively, the set of strict -commodity matrices is the class of 2-commodity equations such that for every pair , equation iff equation iff equation . The set of strict -commodity matrices with integer entries is denoted by . They showed that reductions from approximately solving to approximately solving , and from to . We are going to show that these reductions can be computed in .
From to
Proof 4.2 (Proof sketch).
The reduction, as defined in [8, Section 5.1], runs by checking for each pair that are involved in some equation in if any of the three types of equations is missing and add it if so. The added equations will be multiplied by a factor that is computable in . Obviously the resulting equation systems is in . It is easy to see that the number of added equations for each pair can be computed in , thus all the prefix sums of these numbers can be calculated in simultaneously, and so we can determine the equations in the reduced instance in .
From to
References
- [1] Peter Clote and Evangelos Kranakis. Boolean Functions and Computation Models. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2002.
- [2] Michael B. Cohen, Rasmus Kyng, Gary L. Miller, Jakub W. Pachocki, Richard Peng, Anup B. Rao, and Shen Chen Xu. Solving SDD linear systems in nearly mlogn time. In Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014, pages 343–352, 2014.
- [3] Dean Doron, François Le Gall, and Amnon Ta-Shma. Probabilistic logarithmic-space algorithms for laplacian solvers. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2017, August 16-18, 2017, Berkeley, CA, USA, pages 41:1–41:20, 2017.
- [4] François Le Gall. Powers of tensors and fast matrix multiplication. In International Symposium on Symbolic and Algebraic Computation, ISSAC ’14, Kobe, Japan, July 23-25, 2014, pages 296–303, 2014.
- [5] William Hesse, Eric Allender, and David A. Mix Barrington. Uniform constant-depth threshold circuits for division and iterated multiplication. J. Comput. Syst. Sci., 65(4):695–716, 2002.
- [6] Neil Immerman and Susan Landau. The complexity of iterated multiplication. In Proceedings: Fourth Annual Structure in Complexity Theory Conference, University of Oregon, Eugene, Oregon, USA, June 19-22, 1989, pages 104–111, 1989.
- [7] Rasmus Kyng and Peng Zhang. Hardness results for structured linear systems. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 684–695, 2017.
- [8] Rasmus Kyng and Peng Zhang. Hardness results for structured linear systems. CoRR, abs/1705.02944, 2017. arXiv:1705.02944.
- [9] Alexis Maciel and Denis Thérien. Efficient threshold circuits for power series. Inf. Comput., 152(1):62–73, 1999.
- [10] Jack Murtagh, Omer Reingold, Aaron Sidford, and Salil P. Vadhan. Derandomization beyond connectivity: Undirected laplacian systems in nearly logarithmic space. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 801–812, 2017.
- [11] John H. Reif and Stephen R. Tate. On threshold circuits and polynomial computation. SIAM J. Comput., 21(5):896–908, 1992.
- [12] Michael E. Saks and Shiyu Zhou. RSPACE(S) \subseteq dspace(s). In 36th Annual Symposium on Foundations of Computer Science, Milwaukee, Wisconsin, USA, 23-25 October 1995, pages 344–353, 1995.
- [13] Daniel A. Spielman and Shang-Hua Teng. Nearly linear time algorithms for preconditioning and solving symmetric, diagonally dominant linear systems. SIAM J. Matrix Analysis Applications, 35(3):835–885, 2014.
- [14] Amnon Ta-Shma. Inverting well conditioned matrices in quantum logspace. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 881–890, 2013.