There is a lot of info about how to use the sparsity pattern of A in order to solve $Ax = b$. However I can't find much about using the sparsity pattern of b. Let me take a concrete example:
Let us assume A is a large $N \times N$ matrix ($N > 10^6$) with a known sparsity pattern. Now let us assume I want to solve repeatedly linear systems of the form $Ax = b$ in which $b$ is a column vector with only one non-zero entry. (this seems to be a similar problem as computing some given columns of the matrix inverse $A^{-1}$).
I know I can either through direct or iterative solvers compute the solution of the linear system and at the same time take advantage of the known sparsity structure of A (which can be precomputed if needed), however what about $b$ ? Doing this feels like I am going to spend as much computing time as solving $Ax=c$ where c is a full vector, but here only one element of b is non-zero, is there a way to take advantage of that specifically ?
For example, I can think of a way if using a direct LU decomposition: if $b = e_N$ , the unit column vector with the last element equal to 1, for example (and we can always apply a permutation on A to make it that way I believe), then the forward substitution $L(Ux) = e_N$ consists indeed of only one operation. I assume that there might be other "tricks" like this out there that I am not aware of, hopefully included in some packages (I personnally like using petsc), so any link towards a reference on that topic would be greatly appreciated.