


can_256.mat'         
cancer_dataset.mat'  
load('can_256.mat')


A = Problem.A;
spy(A)
[Warning: MATLAB has disabled some advanced graphics
rendering features by switching to software OpenGL. For
more information, click <a
href="matlab:opengl('problems')">here</a>.] 

A = A + diag(abs(A)*ones(256,1));

[L U] = lu(A);
spy(L+U)
nnz(L+U)
ans =
       36660
p = symrcm(A);


B  = A(p,p);
spy(B)


[L U] = lu(B);
spy(L+U)
nnz(L+U)
ans =
       13186

nnz(L+U)
ans =
       13186



p=symamd(A);
B  = A(p,p);
[L U] = lu(B);
spy(L+U)
nnz(L+U)
ans =
        6418
help syrcm
--- syrcm not found. Showing help for symrcm instead. ---

 SYMRCM Symmetric reverse Cuthill-McKee permutation.
    p = SYMRCM(S) returns a permutation vector p such that S(p,p)
    tends to have its diagonal elements closer to the diagonal than S.
    This is a good preordering for LU or Cholesky factorization of
    matrices that come from "long, skinny" problems.  It works for
    both symmetric and nonsymmetric S.  When S is nonsymmetric, SYMRCM
    works on the structure of S + S'.
 
    See also AMD, COLAMD, COLPERM.

    Documentation for symrcm
       doc symrcm

p = bfs(A,1);

B = A(p,p);
[L U] = lu(B);
nnz(L+U)
ans =
       32204
spy(L+U)
spy(B)
n = 256;
q = p(n:-1:1);
B = A(q,q);
[L U] = lu(B);
spy(L+U)
nnz(L+U)
ans =
       13634
diary off
