% Matlab diary for CS 240A Wednesday, May 4, 2011 % % Routines and matrix files are from the meshpart toolbox: % http://www.cerfacs.fr/algor/Softs/MESHPART/ % or from the CS 240A matlab directory: % http://www.cs.ucsb.edu/~gilbert/cs240aSpr2011/matlab/ % % Some output lines are omitted. >> G = grid5(100); >> size(G) ans = 10000 10000 >> spy(G) >> [G,xy] = grid5(100); >> size(xy) ans = 10000 2 >> xy >> gplotg(G,xy),shg >> load CGmats >> whos Name Size Bytes Class Attributes A 10000x10000 873608 double sparse Airfoil 4253x4253 563376 double sparse Airfoil2 4720x4720 552392 double sparse Airfoil2info 1x51 102 char Axy 4253x2 68048 double Axy2 4720x2 75520 double BCSSTK08 1074x1074 215976 double sparse BCSSTK08info 1x1 216670 struct Eppstein 547x547 63248 double sparse Exy 547x2 8752 double G 10000x10000 873608 double sparse Grid 225x225 18848 double sparse Gxy 225x2 3600 double Smallmesh 136x136 14600 double sparse Sxy 136x2 2176 double Tapir 1024x1024 115656 double sparse Txy 1024x2 16384 double ans 1x2 16 double xy 10000x2 160000 double >> size(Airfoil) ans = 4253 4253 >> gplotg(Airfoil,Axy) >> size(A) ans = 10000 10000 >> nnz(A) ans = 49600 >> A = A-diag(diag(A)); A=A|A'; >> nnz(A) ans = 39600 >> ne = nnz(A)/2 ne = 19800 >> nv = length(A) nv = 10000 >> sum(A) >> hist(sum(A)) >> clc >> what >> load coAuthorsDBLP >> Problem Problem = name: 'DIMACS10/coAuthorsDBLP' title: [1x36 char] A: [299067x299067 double] id: 2462 date: '2008' author: [1x42 char] ed: 'H. Meyerhenke' kind: 'undirected graph' notes: [113x72 char] >> Co = Problem.A; >> length(Co) ans = 299067 >> nnz(Co) ans = 1955352 >> nnz(diag(Co)) ans = 0 >> max(max(Co)) ans = (1,1) 1 >> nnz( Co - Co') ans = 0 >> spy(Co) >> nnz(Co)/2 / length(Co) ans = 3.2691 >> hist(sum(Co)) >> dhist(Co) >> load circuit_3 >> Problem Problem = title: [1x62 char] A: [12127x12127 double] b: [12127x1 double] x: [12127x1 double] name: 'Bomhof/circuit_3' id: 372 date: '2000' author: 'W. Bomhof' ed: 'T. Davis' kind: [1x26 char] >> Ci = Problem.A; >> length(Ci) ans = 12127 >> nnz(Ci) ans = 48137 >> nnz(diag(Ci)) ans = 11917 >> Ci = Ci - diag(diag(Ci)); >> Ci = Ci | Ci'; >> nnz(Ci) ans = 44548 >> length(Ci) ans = 12127 >> dhist(Ci) >> help bfslevels >> bfslevels(Co) Graph has 299067 vertices and 977676 edges Level Size 0 1 1 27 2 94 3 504 4 3064 5 23215 6 92647 7 111268 8 49423 9 14079 10 3629 11 813 12 178 13 87 14 27 15 10 16 1 Reached 299067 vertices in search >> nv = length(Co) >> sqrt(nv) ans = 546.8702 >> A = grid5(546); >> length(A) ans = 298116 >> A = A-diag(diag(A)); A=A|A'; >> nnz(A) ans = 1190280 >> nnz(Co) ans = 1955352 >> bfslevels(A) Graph has 298116 vertices and 595140 edges Level Size 0 1 1 4 2 8 3 12 4 16 5 20 6 24 7 28 8 32 9 35 10 37 100 217 200 319 300 419 400 519 500 546 600 421 700 273 800 173 900 73 950 23 970 3 971 2 972 1 Reached 298116 vertices in search >> yCo = bfslevels(Co); >> yCo >> yA = bfslevels(A); >> yA >> close all >> loglog(yCo) >> title('collaboration') >> figure >> loglog(yA) >> title('grid') >> yAir = bfslevels(Airfoil); >> length(yAir) ans = 38 >> yAir >> figure >> loglog(yAir) >> title('airfoil') >> R = rmat(18); >> size(R) ans = 262144 262144 >> R = R-diag(diag(R)); R = R|R'; >> nnz(R) ans = 3901934 >> nnz(Co) ans = 1955352 >> spy(R) >> dhist(R) >> bfslevels(R) Graph has 262144 vertices and 1950967 edges Level Size 0 1 Reached 1 vertices in search >> bfslevels(R) Graph has 262144 vertices and 1950967 edges Level Size 0 1 1 1 2 12 3 1534 4 69594 5 91351 6 10574 7 478 8 26 9 1 Reached 173572 vertices in search >> ccoeff(Co) coeff = 0.3176 >> ccoeff(Ci) coeff = 0.0023 >> ccoeff(Airfoil) coeff = 0.4031 >> ccoeff(grid5(100)) coeff = 0 >> ccoeff(grid9(100)) coeff = 0.4311 >> ccoeff(R) coeff = 0.0454 >> ccoeff(Co) coeff = 0.3176