Solve this specific large sparse system of linear equations The 2019 Stack Overflow Developer Survey Results Are InSolve: This System of equations for $X$ (does a real solution, exist?)Solving large, sparse system of linear equationsUsing QR decomposition to solve a system of equations with a singular matrixFinding eigenvalues of a block matrixIs it possible to compute row and column sums of $A^-1$ given row and column sums of $A$?Analytical solution to a system of quadratic equationsAccelerating linear solve in MATLAB for a specific type of matricesSquare MatricesDoes this system of equations has a solution?Solving a system of linear equations by solving subsystems

What is the motivation for a law requiring 2 parties to consent for recording a conversation

How to create dashed lines/arrows in Illustrator

How can I create a character who can assume the widest possible range of creature sizes?

Carnot-Caratheodory metric

Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?

What is the use of option -o in the useradd command?

Can't find the latex code for the ⍎ (down tack jot) symbol

How to make payment on the internet without leaving a money trail?

How can I fix this gap between bookcases I made?

Unbreakable Formation vs. Cry of the Carnarium

How to deal with fear of taking dependencies

Pristine Bit Checking

In microwave frequencies, do you use a circulator when you need a (near) perfect diode?

Access elements in std::string where positon of string is greater than its size

On the insanity of kings as an argument against Monarchy

Does it makes sense to buy a new cycle to learn riding?

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

Inflated grade on resume at previous job, might former employer tell new employer?

Idomatic way to prevent slicing?

Extreme, unacceptable situation and I can't attend work tomorrow morning

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Poison Arrows Piercing damage reduced to 0, do you still get poisoned?

Time travel alters history but people keep saying nothing's changed

Is there a name of the flying bionic bird?



Solve this specific large sparse system of linear equations



The 2019 Stack Overflow Developer Survey Results Are InSolve: This System of equations for $X$ (does a real solution, exist?)Solving large, sparse system of linear equationsUsing QR decomposition to solve a system of equations with a singular matrixFinding eigenvalues of a block matrixIs it possible to compute row and column sums of $A^-1$ given row and column sums of $A$?Analytical solution to a system of quadratic equationsAccelerating linear solve in MATLAB for a specific type of matricesSquare MatricesDoes this system of equations has a solution?Solving a system of linear equations by solving subsystems










3












$begingroup$


I want to solve the system $Ax = b$ where $A in mathbb R^n times n$ and $b in mathbb R^n$ with $n approx 10^6$. If $A$ would be a fully dense matrix this would be hopeless of course but luckily the matrix is sparse and highly structured.



The matrix $A$ can be written as



beginalign
A = beginpmatrix
B_0 & B_1 & & & \
& C_1 & B_2 & & \
& & C_2 & B_3 & \
& & & C_3 & B_4 \
D & & & & C_4 \
endpmatrix
endalign



where $B_i$ are upper triangular matrices, $C_i$ are diagonal with each entry being equal to $-1$, and $D$ is a square matrix. The figure below provides a schematic overview of $A$ where every possibly nonzero entry is green and all zeroes are gray.



The upper triangular matrices $B_i$ have approximately the same structure but do not necessarily have the same entry values. The submatrices $B_i$, $C_i$, and $D$ typically have dimension $mtimes m$ with $m approx 10^5$.



I don't know whether it is useful, but we also know for all non-zeroes with $i neq j$ that $a_ij in (0, 1]$ and the entries on the diagonal equal $-1$ except for the part that overlaps with $B_0$, i.e., we have $C_i = -I$.



Note that the corresponding system $(A + I)y = b$, where $I$ is an identity matrix, is relatively easy to solve as the submatrices $C_i$ become null matrices. Then we can first solve $D hat x = hat b$ where $hat x$ and $hat b$ are the last entries of $x$ and $b$. Next, we can iteratively solve the triangular matrices one by one starting with the one closest to the bottom. Maybe we can use the solution $y$ (or a transformation of $y$) as an initial solution for $x$ for an iterative approach.



Is there a better way to solve this system compared to naively feeding the system to a solver such as Matlab or LAPACK?



EDIT 1: Green entries indicate a possibly positive value. However, for the square at the bottom, around half of the entries are expected to be zero.



EDIT 2: Given the enormous size of this problem, approximate methods are also more than welcome.



Schematic overview of matrix A










share|cite|improve this question











$endgroup$











  • $begingroup$
    If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    @YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
    $endgroup$
    – Michiel
    13 hours ago










  • $begingroup$
    Are your $B_k, k>0$ truly triangular ?
    $endgroup$
    – Yves Daoust
    10 hours ago











  • $begingroup$
    @YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
    $endgroup$
    – Michiel
    10 hours ago
















3












$begingroup$


I want to solve the system $Ax = b$ where $A in mathbb R^n times n$ and $b in mathbb R^n$ with $n approx 10^6$. If $A$ would be a fully dense matrix this would be hopeless of course but luckily the matrix is sparse and highly structured.



The matrix $A$ can be written as



beginalign
A = beginpmatrix
B_0 & B_1 & & & \
& C_1 & B_2 & & \
& & C_2 & B_3 & \
& & & C_3 & B_4 \
D & & & & C_4 \
endpmatrix
endalign



where $B_i$ are upper triangular matrices, $C_i$ are diagonal with each entry being equal to $-1$, and $D$ is a square matrix. The figure below provides a schematic overview of $A$ where every possibly nonzero entry is green and all zeroes are gray.



The upper triangular matrices $B_i$ have approximately the same structure but do not necessarily have the same entry values. The submatrices $B_i$, $C_i$, and $D$ typically have dimension $mtimes m$ with $m approx 10^5$.



I don't know whether it is useful, but we also know for all non-zeroes with $i neq j$ that $a_ij in (0, 1]$ and the entries on the diagonal equal $-1$ except for the part that overlaps with $B_0$, i.e., we have $C_i = -I$.



Note that the corresponding system $(A + I)y = b$, where $I$ is an identity matrix, is relatively easy to solve as the submatrices $C_i$ become null matrices. Then we can first solve $D hat x = hat b$ where $hat x$ and $hat b$ are the last entries of $x$ and $b$. Next, we can iteratively solve the triangular matrices one by one starting with the one closest to the bottom. Maybe we can use the solution $y$ (or a transformation of $y$) as an initial solution for $x$ for an iterative approach.



Is there a better way to solve this system compared to naively feeding the system to a solver such as Matlab or LAPACK?



EDIT 1: Green entries indicate a possibly positive value. However, for the square at the bottom, around half of the entries are expected to be zero.



EDIT 2: Given the enormous size of this problem, approximate methods are also more than welcome.



Schematic overview of matrix A










share|cite|improve this question











$endgroup$











  • $begingroup$
    If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    @YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
    $endgroup$
    – Michiel
    13 hours ago










  • $begingroup$
    Are your $B_k, k>0$ truly triangular ?
    $endgroup$
    – Yves Daoust
    10 hours ago











  • $begingroup$
    @YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
    $endgroup$
    – Michiel
    10 hours ago














3












3








3





$begingroup$


I want to solve the system $Ax = b$ where $A in mathbb R^n times n$ and $b in mathbb R^n$ with $n approx 10^6$. If $A$ would be a fully dense matrix this would be hopeless of course but luckily the matrix is sparse and highly structured.



The matrix $A$ can be written as



beginalign
A = beginpmatrix
B_0 & B_1 & & & \
& C_1 & B_2 & & \
& & C_2 & B_3 & \
& & & C_3 & B_4 \
D & & & & C_4 \
endpmatrix
endalign



where $B_i$ are upper triangular matrices, $C_i$ are diagonal with each entry being equal to $-1$, and $D$ is a square matrix. The figure below provides a schematic overview of $A$ where every possibly nonzero entry is green and all zeroes are gray.



The upper triangular matrices $B_i$ have approximately the same structure but do not necessarily have the same entry values. The submatrices $B_i$, $C_i$, and $D$ typically have dimension $mtimes m$ with $m approx 10^5$.



I don't know whether it is useful, but we also know for all non-zeroes with $i neq j$ that $a_ij in (0, 1]$ and the entries on the diagonal equal $-1$ except for the part that overlaps with $B_0$, i.e., we have $C_i = -I$.



Note that the corresponding system $(A + I)y = b$, where $I$ is an identity matrix, is relatively easy to solve as the submatrices $C_i$ become null matrices. Then we can first solve $D hat x = hat b$ where $hat x$ and $hat b$ are the last entries of $x$ and $b$. Next, we can iteratively solve the triangular matrices one by one starting with the one closest to the bottom. Maybe we can use the solution $y$ (or a transformation of $y$) as an initial solution for $x$ for an iterative approach.



Is there a better way to solve this system compared to naively feeding the system to a solver such as Matlab or LAPACK?



EDIT 1: Green entries indicate a possibly positive value. However, for the square at the bottom, around half of the entries are expected to be zero.



EDIT 2: Given the enormous size of this problem, approximate methods are also more than welcome.



Schematic overview of matrix A










share|cite|improve this question











$endgroup$




I want to solve the system $Ax = b$ where $A in mathbb R^n times n$ and $b in mathbb R^n$ with $n approx 10^6$. If $A$ would be a fully dense matrix this would be hopeless of course but luckily the matrix is sparse and highly structured.



The matrix $A$ can be written as



beginalign
A = beginpmatrix
B_0 & B_1 & & & \
& C_1 & B_2 & & \
& & C_2 & B_3 & \
& & & C_3 & B_4 \
D & & & & C_4 \
endpmatrix
endalign



where $B_i$ are upper triangular matrices, $C_i$ are diagonal with each entry being equal to $-1$, and $D$ is a square matrix. The figure below provides a schematic overview of $A$ where every possibly nonzero entry is green and all zeroes are gray.



The upper triangular matrices $B_i$ have approximately the same structure but do not necessarily have the same entry values. The submatrices $B_i$, $C_i$, and $D$ typically have dimension $mtimes m$ with $m approx 10^5$.



I don't know whether it is useful, but we also know for all non-zeroes with $i neq j$ that $a_ij in (0, 1]$ and the entries on the diagonal equal $-1$ except for the part that overlaps with $B_0$, i.e., we have $C_i = -I$.



Note that the corresponding system $(A + I)y = b$, where $I$ is an identity matrix, is relatively easy to solve as the submatrices $C_i$ become null matrices. Then we can first solve $D hat x = hat b$ where $hat x$ and $hat b$ are the last entries of $x$ and $b$. Next, we can iteratively solve the triangular matrices one by one starting with the one closest to the bottom. Maybe we can use the solution $y$ (or a transformation of $y$) as an initial solution for $x$ for an iterative approach.



Is there a better way to solve this system compared to naively feeding the system to a solver such as Matlab or LAPACK?



EDIT 1: Green entries indicate a possibly positive value. However, for the square at the bottom, around half of the entries are expected to be zero.



EDIT 2: Given the enormous size of this problem, approximate methods are also more than welcome.



Schematic overview of matrix A







linear-algebra matrices systems-of-equations block-matrices sparse-matrices






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 10 hours ago







Michiel

















asked 15 hours ago









MichielMichiel

291214




291214











  • $begingroup$
    If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    @YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
    $endgroup$
    – Michiel
    13 hours ago










  • $begingroup$
    Are your $B_k, k>0$ truly triangular ?
    $endgroup$
    – Yves Daoust
    10 hours ago











  • $begingroup$
    @YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
    $endgroup$
    – Michiel
    10 hours ago

















  • $begingroup$
    If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
    $endgroup$
    – Yves Daoust
    14 hours ago











  • $begingroup$
    @YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
    $endgroup$
    – Michiel
    13 hours ago










  • $begingroup$
    Are your $B_k, k>0$ truly triangular ?
    $endgroup$
    – Yves Daoust
    10 hours ago











  • $begingroup$
    @YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
    $endgroup$
    – Michiel
    10 hours ago
















$begingroup$
If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
$endgroup$
– Yves Daoust
14 hours ago





$begingroup$
If I am right, you can decompose in blocks where the blocks are diagonal or quasi-triangular (presumably, there remains a single element of the bottom left corner). Plus the full block.
$endgroup$
– Yves Daoust
14 hours ago













$begingroup$
You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
$endgroup$
– Yves Daoust
14 hours ago





$begingroup$
You can get rid of the corner elements by decomposing in blocks and single rows/columns to isolate them. The benefit is that the inverses of the pure triangular matrices are easily obtained. I guess that the resolution can be virtually reduced to that of the full square, though the latter is still huge.
$endgroup$
– Yves Daoust
14 hours ago













$begingroup$
@YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
$endgroup$
– Michiel
13 hours ago




$begingroup$
@YvesDaoust Thanks for your comments. Could you elaborate a bit more on the decomposition you propose in an answer?
$endgroup$
– Michiel
13 hours ago












$begingroup$
Are your $B_k, k>0$ truly triangular ?
$endgroup$
– Yves Daoust
10 hours ago





$begingroup$
Are your $B_k, k>0$ truly triangular ?
$endgroup$
– Yves Daoust
10 hours ago













$begingroup$
@YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
$endgroup$
– Michiel
10 hours ago





$begingroup$
@YvesDaoust Yes $B_k, k geq 0$ (indeed also $B_0$) are all upper triangular matrices.
$endgroup$
– Michiel
10 hours ago











3 Answers
3






active

oldest

votes


















7












$begingroup$

The key is the fact that $C_i = - I$, i.e., the appropriately size identity matrix is trivially nonsingular and can be used to nullify the blocks above each copy. We have the following row equivalence
$$
A =
beginpmatrix
B_0 & B_1 & & & \
& -I & B_2 & & \
& & -I & B_3 & \
& & & -I & B_4 \
D & & & & -I \
endpmatrix
sim
beginpmatrix
B_0 & B_1 & & & \
& -I & B_2 & & \
& & -I & B_3 & \
B_4D & & & -I & \
D & & & & -I \
endpmatrix sim
beginpmatrix
B_0 & B_1 & & & \
& -I & B_2 & & \
B_3B_4D & & -I & & \
B_4D & & & -I & \
D & & & & -I \
endpmatrixsim
beginpmatrix
B_0 & B_1 & & & \
B_2B_3B_4D & -I & & & \
B_3B_4D & & -I & & \
B_4D & & & -I & \
D & & & & -I \
endpmatrixsim
beginpmatrix
B_0+B_1B_2B_3B_4D & & & & \
B_2B_3B_4D & -I & & & \
B_3B_4D & & -I & & \
B_4D & & & -I & \
D & & & & -I \
endpmatrix
$$

You can now factor the block $B_0 + B_1B_2B_3B_4D$ and compute $x_0$. The rest will be just be forward substitution, but compute them in descending order $x_4$, $x_3$, $x_2$, $x_1$ so that you do not have to regenerate the spike on the left.






share|cite|improve this answer











$endgroup$




















    3












    $begingroup$

    You could try formulating it as a feasibility optimization problem such as
    $$beginequation
    beginarrayrrclcl
    displaystyle min_x &0 \
    textrms.t. & A x & = & b \
    endarray
    endequation$$



    and feed it into a linear programming solver based on a branch-and-price algorithm such as GCG. Such algorithms are usually designed to exploit structured variables via a Dantzig-Wolfe decomposition. In fact, GCG is a branch-price-and-cut solver, meaning it also adds cutting planes in addition to the column generation approach via DW-decomposition. Very often such structured problems like yours can be solved fast via such a decomposition algorithm.



    In the above problem formulation you can use any objective function as you are only looking for a feasible solution of your system $Ax=b$. Technically, you could replace the 0-objective function with any other objective function but why not just keep it simple?






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      I'll try this approach and will give an update once some results are there (expected at the end of next week).
      $endgroup$
      – Michiel
      14 hours ago


















    2












    $begingroup$

    The easiest quite fast way is probably to use Carl-Christians algebraic solution.



    If you are interested in low-level calculational tricks for these matrices you can keep reading below line.




    Given the matrix structure there are some key matrix elements at the tips of the triangles. If you let the solution diffuse from there as in forward-substitution-like scheme or implicitly with CG you will gain a lot.



    Maybe you can get some inspiration from another question of mine, if I can find it. Any triangular matrix you can factor into sparse di-diagonal matrix "in-place" multiplication. This saves calculations. But I don't remember where I wrote this question right now so I will try explain.



    You can factor:
    $$B_i = F_1F_2cdots F_m$$



    Where each $F_i$ is an identity matrix except for the entries (i,i) and (i,i+1) which need to be determined.



    Whooops $m$ matrices you think, but $m$ is huge, but since we only need store 2 values for each, it will only need $2m$ in total for each $B_i$, compared to $m^2/2$ which the tridiagonal $B_i$ ones need.



    In practice for $m=10^5$ you could reduce memory fingerprint from tens gigabytes to singles of megabytes.






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
      $endgroup$
      – Carl Christian
      7 hours ago











    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3180688%2fsolve-this-specific-large-sparse-system-of-linear-equations%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7












    $begingroup$

    The key is the fact that $C_i = - I$, i.e., the appropriately size identity matrix is trivially nonsingular and can be used to nullify the blocks above each copy. We have the following row equivalence
    $$
    A =
    beginpmatrix
    B_0 & B_1 & & & \
    & -I & B_2 & & \
    & & -I & B_3 & \
    & & & -I & B_4 \
    D & & & & -I \
    endpmatrix
    sim
    beginpmatrix
    B_0 & B_1 & & & \
    & -I & B_2 & & \
    & & -I & B_3 & \
    B_4D & & & -I & \
    D & & & & -I \
    endpmatrix sim
    beginpmatrix
    B_0 & B_1 & & & \
    & -I & B_2 & & \
    B_3B_4D & & -I & & \
    B_4D & & & -I & \
    D & & & & -I \
    endpmatrixsim
    beginpmatrix
    B_0 & B_1 & & & \
    B_2B_3B_4D & -I & & & \
    B_3B_4D & & -I & & \
    B_4D & & & -I & \
    D & & & & -I \
    endpmatrixsim
    beginpmatrix
    B_0+B_1B_2B_3B_4D & & & & \
    B_2B_3B_4D & -I & & & \
    B_3B_4D & & -I & & \
    B_4D & & & -I & \
    D & & & & -I \
    endpmatrix
    $$

    You can now factor the block $B_0 + B_1B_2B_3B_4D$ and compute $x_0$. The rest will be just be forward substitution, but compute them in descending order $x_4$, $x_3$, $x_2$, $x_1$ so that you do not have to regenerate the spike on the left.






    share|cite|improve this answer











    $endgroup$

















      7












      $begingroup$

      The key is the fact that $C_i = - I$, i.e., the appropriately size identity matrix is trivially nonsingular and can be used to nullify the blocks above each copy. We have the following row equivalence
      $$
      A =
      beginpmatrix
      B_0 & B_1 & & & \
      & -I & B_2 & & \
      & & -I & B_3 & \
      & & & -I & B_4 \
      D & & & & -I \
      endpmatrix
      sim
      beginpmatrix
      B_0 & B_1 & & & \
      & -I & B_2 & & \
      & & -I & B_3 & \
      B_4D & & & -I & \
      D & & & & -I \
      endpmatrix sim
      beginpmatrix
      B_0 & B_1 & & & \
      & -I & B_2 & & \
      B_3B_4D & & -I & & \
      B_4D & & & -I & \
      D & & & & -I \
      endpmatrixsim
      beginpmatrix
      B_0 & B_1 & & & \
      B_2B_3B_4D & -I & & & \
      B_3B_4D & & -I & & \
      B_4D & & & -I & \
      D & & & & -I \
      endpmatrixsim
      beginpmatrix
      B_0+B_1B_2B_3B_4D & & & & \
      B_2B_3B_4D & -I & & & \
      B_3B_4D & & -I & & \
      B_4D & & & -I & \
      D & & & & -I \
      endpmatrix
      $$

      You can now factor the block $B_0 + B_1B_2B_3B_4D$ and compute $x_0$. The rest will be just be forward substitution, but compute them in descending order $x_4$, $x_3$, $x_2$, $x_1$ so that you do not have to regenerate the spike on the left.






      share|cite|improve this answer











      $endgroup$















        7












        7








        7





        $begingroup$

        The key is the fact that $C_i = - I$, i.e., the appropriately size identity matrix is trivially nonsingular and can be used to nullify the blocks above each copy. We have the following row equivalence
        $$
        A =
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        & & -I & B_3 & \
        & & & -I & B_4 \
        D & & & & -I \
        endpmatrix
        sim
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        & & -I & B_3 & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrix sim
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrixsim
        beginpmatrix
        B_0 & B_1 & & & \
        B_2B_3B_4D & -I & & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrixsim
        beginpmatrix
        B_0+B_1B_2B_3B_4D & & & & \
        B_2B_3B_4D & -I & & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrix
        $$

        You can now factor the block $B_0 + B_1B_2B_3B_4D$ and compute $x_0$. The rest will be just be forward substitution, but compute them in descending order $x_4$, $x_3$, $x_2$, $x_1$ so that you do not have to regenerate the spike on the left.






        share|cite|improve this answer











        $endgroup$



        The key is the fact that $C_i = - I$, i.e., the appropriately size identity matrix is trivially nonsingular and can be used to nullify the blocks above each copy. We have the following row equivalence
        $$
        A =
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        & & -I & B_3 & \
        & & & -I & B_4 \
        D & & & & -I \
        endpmatrix
        sim
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        & & -I & B_3 & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrix sim
        beginpmatrix
        B_0 & B_1 & & & \
        & -I & B_2 & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrixsim
        beginpmatrix
        B_0 & B_1 & & & \
        B_2B_3B_4D & -I & & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrixsim
        beginpmatrix
        B_0+B_1B_2B_3B_4D & & & & \
        B_2B_3B_4D & -I & & & \
        B_3B_4D & & -I & & \
        B_4D & & & -I & \
        D & & & & -I \
        endpmatrix
        $$

        You can now factor the block $B_0 + B_1B_2B_3B_4D$ and compute $x_0$. The rest will be just be forward substitution, but compute them in descending order $x_4$, $x_3$, $x_2$, $x_1$ so that you do not have to regenerate the spike on the left.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited 12 hours ago









        Rodrigo de Azevedo

        13.2k41962




        13.2k41962










        answered 12 hours ago









        Carl ChristianCarl Christian

        6,0961723




        6,0961723





















            3












            $begingroup$

            You could try formulating it as a feasibility optimization problem such as
            $$beginequation
            beginarrayrrclcl
            displaystyle min_x &0 \
            textrms.t. & A x & = & b \
            endarray
            endequation$$



            and feed it into a linear programming solver based on a branch-and-price algorithm such as GCG. Such algorithms are usually designed to exploit structured variables via a Dantzig-Wolfe decomposition. In fact, GCG is a branch-price-and-cut solver, meaning it also adds cutting planes in addition to the column generation approach via DW-decomposition. Very often such structured problems like yours can be solved fast via such a decomposition algorithm.



            In the above problem formulation you can use any objective function as you are only looking for a feasible solution of your system $Ax=b$. Technically, you could replace the 0-objective function with any other objective function but why not just keep it simple?






            share|cite|improve this answer









            $endgroup$












            • $begingroup$
              I'll try this approach and will give an update once some results are there (expected at the end of next week).
              $endgroup$
              – Michiel
              14 hours ago















            3












            $begingroup$

            You could try formulating it as a feasibility optimization problem such as
            $$beginequation
            beginarrayrrclcl
            displaystyle min_x &0 \
            textrms.t. & A x & = & b \
            endarray
            endequation$$



            and feed it into a linear programming solver based on a branch-and-price algorithm such as GCG. Such algorithms are usually designed to exploit structured variables via a Dantzig-Wolfe decomposition. In fact, GCG is a branch-price-and-cut solver, meaning it also adds cutting planes in addition to the column generation approach via DW-decomposition. Very often such structured problems like yours can be solved fast via such a decomposition algorithm.



            In the above problem formulation you can use any objective function as you are only looking for a feasible solution of your system $Ax=b$. Technically, you could replace the 0-objective function with any other objective function but why not just keep it simple?






            share|cite|improve this answer









            $endgroup$












            • $begingroup$
              I'll try this approach and will give an update once some results are there (expected at the end of next week).
              $endgroup$
              – Michiel
              14 hours ago













            3












            3








            3





            $begingroup$

            You could try formulating it as a feasibility optimization problem such as
            $$beginequation
            beginarrayrrclcl
            displaystyle min_x &0 \
            textrms.t. & A x & = & b \
            endarray
            endequation$$



            and feed it into a linear programming solver based on a branch-and-price algorithm such as GCG. Such algorithms are usually designed to exploit structured variables via a Dantzig-Wolfe decomposition. In fact, GCG is a branch-price-and-cut solver, meaning it also adds cutting planes in addition to the column generation approach via DW-decomposition. Very often such structured problems like yours can be solved fast via such a decomposition algorithm.



            In the above problem formulation you can use any objective function as you are only looking for a feasible solution of your system $Ax=b$. Technically, you could replace the 0-objective function with any other objective function but why not just keep it simple?






            share|cite|improve this answer









            $endgroup$



            You could try formulating it as a feasibility optimization problem such as
            $$beginequation
            beginarrayrrclcl
            displaystyle min_x &0 \
            textrms.t. & A x & = & b \
            endarray
            endequation$$



            and feed it into a linear programming solver based on a branch-and-price algorithm such as GCG. Such algorithms are usually designed to exploit structured variables via a Dantzig-Wolfe decomposition. In fact, GCG is a branch-price-and-cut solver, meaning it also adds cutting planes in addition to the column generation approach via DW-decomposition. Very often such structured problems like yours can be solved fast via such a decomposition algorithm.



            In the above problem formulation you can use any objective function as you are only looking for a feasible solution of your system $Ax=b$. Technically, you could replace the 0-objective function with any other objective function but why not just keep it simple?







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered 14 hours ago









            YukiJYukiJ

            2,1632928




            2,1632928











            • $begingroup$
              I'll try this approach and will give an update once some results are there (expected at the end of next week).
              $endgroup$
              – Michiel
              14 hours ago
















            • $begingroup$
              I'll try this approach and will give an update once some results are there (expected at the end of next week).
              $endgroup$
              – Michiel
              14 hours ago















            $begingroup$
            I'll try this approach and will give an update once some results are there (expected at the end of next week).
            $endgroup$
            – Michiel
            14 hours ago




            $begingroup$
            I'll try this approach and will give an update once some results are there (expected at the end of next week).
            $endgroup$
            – Michiel
            14 hours ago











            2












            $begingroup$

            The easiest quite fast way is probably to use Carl-Christians algebraic solution.



            If you are interested in low-level calculational tricks for these matrices you can keep reading below line.




            Given the matrix structure there are some key matrix elements at the tips of the triangles. If you let the solution diffuse from there as in forward-substitution-like scheme or implicitly with CG you will gain a lot.



            Maybe you can get some inspiration from another question of mine, if I can find it. Any triangular matrix you can factor into sparse di-diagonal matrix "in-place" multiplication. This saves calculations. But I don't remember where I wrote this question right now so I will try explain.



            You can factor:
            $$B_i = F_1F_2cdots F_m$$



            Where each $F_i$ is an identity matrix except for the entries (i,i) and (i,i+1) which need to be determined.



            Whooops $m$ matrices you think, but $m$ is huge, but since we only need store 2 values for each, it will only need $2m$ in total for each $B_i$, compared to $m^2/2$ which the tridiagonal $B_i$ ones need.



            In practice for $m=10^5$ you could reduce memory fingerprint from tens gigabytes to singles of megabytes.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
              $endgroup$
              – Carl Christian
              7 hours ago















            2












            $begingroup$

            The easiest quite fast way is probably to use Carl-Christians algebraic solution.



            If you are interested in low-level calculational tricks for these matrices you can keep reading below line.




            Given the matrix structure there are some key matrix elements at the tips of the triangles. If you let the solution diffuse from there as in forward-substitution-like scheme or implicitly with CG you will gain a lot.



            Maybe you can get some inspiration from another question of mine, if I can find it. Any triangular matrix you can factor into sparse di-diagonal matrix "in-place" multiplication. This saves calculations. But I don't remember where I wrote this question right now so I will try explain.



            You can factor:
            $$B_i = F_1F_2cdots F_m$$



            Where each $F_i$ is an identity matrix except for the entries (i,i) and (i,i+1) which need to be determined.



            Whooops $m$ matrices you think, but $m$ is huge, but since we only need store 2 values for each, it will only need $2m$ in total for each $B_i$, compared to $m^2/2$ which the tridiagonal $B_i$ ones need.



            In practice for $m=10^5$ you could reduce memory fingerprint from tens gigabytes to singles of megabytes.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
              $endgroup$
              – Carl Christian
              7 hours ago













            2












            2








            2





            $begingroup$

            The easiest quite fast way is probably to use Carl-Christians algebraic solution.



            If you are interested in low-level calculational tricks for these matrices you can keep reading below line.




            Given the matrix structure there are some key matrix elements at the tips of the triangles. If you let the solution diffuse from there as in forward-substitution-like scheme or implicitly with CG you will gain a lot.



            Maybe you can get some inspiration from another question of mine, if I can find it. Any triangular matrix you can factor into sparse di-diagonal matrix "in-place" multiplication. This saves calculations. But I don't remember where I wrote this question right now so I will try explain.



            You can factor:
            $$B_i = F_1F_2cdots F_m$$



            Where each $F_i$ is an identity matrix except for the entries (i,i) and (i,i+1) which need to be determined.



            Whooops $m$ matrices you think, but $m$ is huge, but since we only need store 2 values for each, it will only need $2m$ in total for each $B_i$, compared to $m^2/2$ which the tridiagonal $B_i$ ones need.



            In practice for $m=10^5$ you could reduce memory fingerprint from tens gigabytes to singles of megabytes.






            share|cite|improve this answer











            $endgroup$



            The easiest quite fast way is probably to use Carl-Christians algebraic solution.



            If you are interested in low-level calculational tricks for these matrices you can keep reading below line.




            Given the matrix structure there are some key matrix elements at the tips of the triangles. If you let the solution diffuse from there as in forward-substitution-like scheme or implicitly with CG you will gain a lot.



            Maybe you can get some inspiration from another question of mine, if I can find it. Any triangular matrix you can factor into sparse di-diagonal matrix "in-place" multiplication. This saves calculations. But I don't remember where I wrote this question right now so I will try explain.



            You can factor:
            $$B_i = F_1F_2cdots F_m$$



            Where each $F_i$ is an identity matrix except for the entries (i,i) and (i,i+1) which need to be determined.



            Whooops $m$ matrices you think, but $m$ is huge, but since we only need store 2 values for each, it will only need $2m$ in total for each $B_i$, compared to $m^2/2$ which the tridiagonal $B_i$ ones need.



            In practice for $m=10^5$ you could reduce memory fingerprint from tens gigabytes to singles of megabytes.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited 11 hours ago

























            answered 12 hours ago









            mathreadlermathreadler

            15.5k72263




            15.5k72263











            • $begingroup$
              How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
              $endgroup$
              – Carl Christian
              7 hours ago
















            • $begingroup$
              How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
              $endgroup$
              – Carl Christian
              7 hours ago















            $begingroup$
            How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
            $endgroup$
            – Carl Christian
            7 hours ago




            $begingroup$
            How do you propose to obtain and apply the many factorization into products of bidiagonal matrices using level-3 BLAS operations?
            $endgroup$
            – Carl Christian
            7 hours ago

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3180688%2fsolve-this-specific-large-sparse-system-of-linear-equations%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ружовы пелікан Змест Знешні выгляд | Пашырэнне | Асаблівасці біялогіі | Літаратура | НавігацыяДагледжаная версіяправерана1 зменаДагледжаная версіяправерана1 змена/ 22697590 Сістэматыкана ВіківідахВыявына Вікісховішчы174693363011049382

            ValueError: Error when checking input: expected conv2d_13_input to have shape (3, 150, 150) but got array with shape (150, 150, 3)2019 Community Moderator ElectionError when checking : expected dense_1_input to have shape (None, 5) but got array with shape (200, 1)Error 'Expected 2D array, got 1D array instead:'ValueError: Error when checking input: expected lstm_41_input to have 3 dimensions, but got array with shape (40000,100)ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (0,)Keras exception: ValueError: Error when checking input: expected conv2d_1_input to have shape (150, 150, 3) but got array with shape (256, 256, 3)Steps taking too long to completewhen checking input: expected dense_1_input to have shape (13328,) but got array with shape (317,)ValueError: Error when checking target: expected dense_3 to have shape (None, 1) but got array with shape (7715, 40000)Keras exception: Error when checking input: expected dense_input to have shape (2,) but got array with shape (1,)

            Illegal assignment from SObject to ContactFetching String, Id from Map - Illegal Assignment Id to Field / ObjectError: Compile Error: Illegal assignment from String to BooleanError: List has no rows for assignment to SObjectError on Test Class - System.QueryException: List has no rows for assignment to SObjectRemote action problemDML requires SObject or SObject list type error“Illegal assignment from List to List”Test Class Fail: Batch Class: System.QueryException: List has no rows for assignment to SObjectMapping to a user'List has no rows for assignment to SObject' Mystery