I've the following Matlab code:
r = symrcm(A(2:end, 2:end)); prcm = [1 r + 1]; spy(A(prcm, prcm));
A should be sparse connectivity matrix.
I understood what it does:
Finds a permutation vector
rof the submatrix of
A(2:end, 2:end)(produced by the reverse Cuthill-McKee algorithm)
Creates a vector
prcmwhich is basically a vector with a $1$ in the first position and all other elements of
rincreased by $1$.
prcmvector applied to
A(prcm, prcm)logically means that we're going to permutate all rows and columns of
Aaccording to the reverse Cuthill-McKee algorithm except the first row and the first column. So the resulting matrix would look something like this:
Ignore the specific numbers that you see in the plot.
Why would one want such a permutation of the rows and columns of a matrix?
From what I've been reading and I've observed applying, for example, the guassian elimination to this matrix would produce a disastrous fill-in after trying to remove all entries of the first row (Check chapter 5.7 from "A first course in numerical methods" by Ascher and Greif). So, who wrote this code definitely didn't want to find a permutation of $A$ to apply the guassian elimination...