symrcm
- :
p =symrcm(S)¶ Compute a reverse Cuthill-McKee permutation for the square sparse matrix S.
The returned vector p reorders the rows and columns of S so that
S(p, p)gathers its nonzero entries nearer the main diagonal, which usually shrinks the matrix bandwidth. The permutation is derived from the symmetric adjacency pattern of S: every connected component is traversed breadth-first from a vertex of minimum degree, neighbors are appended in order of increasing degree, and the accumulated sequence is reversed at the end. S must be square; an empty input yields an empty p.