% Matlab diary for CS 240A Monday, March 4, 2014 % % Routines and matrix files are from the CS 240A matlab directory: % http://www.cs.ucsb.edu/~gilbert/cs240aSpr2011/matlab/graphs/ % or from the University of Florida tools: % http://www.cise.ufl.edu/research/sparse/matrices/ % or from the BTER tools: % http://www.sandia.gov/~tgkolda/feastpack/ % or from the meshpart toolbox: % http://www.cerfacs.fr/algor/Softs/MESHPART/ % % Some output lines are omitted. > help UFget UFget: MATLAB interface for the UF Sparse Matrix Collection. > UFgrep commanche 871: Pothen/commanche_dual > P = UFget(871) downloading http://www.cise.ufl.edu/research/sparse/mat/Pothen/commanche_dual.mat to /Users/gilbert/Documents/CS240aWinter2014/Matlab/UFget/mat/Pothen/commanche_dual.mat P = A: [7920x7920 double] title: [1x70 char] name: 'Pothen/commanche_dual' id: 871 aux: [1x1 struct] date: '2003' author: 'NASA' ed: 'G. Kumfert, A. Pothen' kind: 'structural problem' > spy(P.A) > P.aux ans = coord: [7920x3 double] > P = UFget(2317) P = name: 'SNAP/roadNet-CA' title: [1x26 char] A: [1971281x1971281 double] id: 2317 date: '2008' author: [1x45 char] ed: 'J. Leskovec' kind: 'undirected graph' notes: [34x79 char] > P.notes ans = Networks from SNAP (Stanford Network Analysis Platform) Network Data Sets, Jure Leskovec http://snap.stanford.edu/data/index.html email jure at cs.stanford.edu California road network Dataset information A road network of California. Intersections and endpoints are represented by nodes and the roads connecting these intersections or road endpoints are represented by undirected edges. Dataset statistics Nodes 1965206 Edges 5533214 Nodes in largest WCC 1957027 (0.996) Edges in largest WCC 5520776 (0.998) Nodes in largest SCC 1957027 (0.996) Edges in largest SCC 5520776 (0.998) Average clustering coefficient 0.0464 Number of triangles 120676 Fraction of closed triangles 0.06039 Diameter (longest shortest path) 850 90-percentile effective diameter 5e+002 Source (citation) J. Leskovec, K. Lang, A. Dasgupta, M. Mahoney. Community Structure in Large Networks: Natural Cluster Sizes and the Absence of Large Well-Defined Clusters. arXiv.org:0810.1355, 2008. Files File Description roadNet-CA.txt.gz California road network > UFweb(2317) > clc > UFgrep airfoil 1319: Engwirda/airfoil_2d 2411: AG-Monien/airfoil1 2412: AG-Monien/airfoil1_dual > Af = UFget(2411) Af = name: 'AG-Monien/airfoil1' title: [1x25 char] A: [4253x4253 double] id: 2411 date: '1998' author: 'R. Diekmann, R. Preis' ed: 'R. Diekmann, R. Preis' kind: '2D/3D problem' notes: [28x79 char] aux: [1x1 struct] > Af.aux ans = coord: [4253x2 double] > gplotg(Af.A,Af.aux.coord) > nv = size(Af.A,1) nv = 4253 > ne = 1/2 * nnz(Af.A - diag(diag(Af.A))) ne = 12289 > ne/nv ans = 2.8895 > 2*ne/nv ans = 5.7790 > dhist(Af.A) > plotdegs(Af.A); Number of nodes: 4253 Number of edges: 12289 Maximum degree: 9 > UFgrep coauthor > UFgrep coAuthor 2461: DIMACS10/coAuthorsCiteseer 2462: DIMACS10/coAuthorsDBLP > Co = UFget(2462) Co = 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.notes ans = 10th DIMACS Implementation Challenge: ... coauthor: Citation Networks These graphs are examples of social networks used in R. Geisberger, P. Sanders, and D. Schultes. Better approximation of betweenness centrality. In 10th Workshop on Algorithm Engineering and Experimentation, pages 90-108, San Francisco, 2008. SIAM. > Co Co = 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] > nnz(Co.A) ans = 1955352 > spy(Co.A) > plotdegs(Co.A); Number of nodes: 299067 Number of edges: 977676 Maximum degree: 336 > dhist(Co.A) > bfslevels(Af.A); Graph has 4253 vertices and 12289 edges Level Size 0 1 1 6 2 11 3 17 4 23 5 29 6 26 7 27 8 27 9 30 10 35 11 39 12 43 13 51 14 55 15 64 16 71 17 84 18 94 19 91 20 84 21 89 22 100 23 113 24 126 25 137 26 138 27 138 28 123 29 121 30 126 31 122 32 113 33 119 34 136 35 158 36 165 37 176 38 181 39 191 40 180 41 163 42 140 43 112 44 77 45 60 46 34 47 7 Reached 4253 vertices in search > bfslevels(Co.A) Graph has 299067 vertices and 977676 edges Level Size 0 1 1 5 2 4 3 6 4 39 5 395 6 3222 7 24304 8 96263 9 109853 10 47296 11 13145 12 3382 13 837 14 210 15 65 16 29 17 10 18 1 Reached 299067 vertices in search > Gr = grid5(100); > size(Gr) ans = 10000 10000 > plotdegs(Gr); Number of nodes: 10000 Number of edges: 19800 Maximum degree: 4 > bfslevels(Gr); Graph has 10000 vertices and 19800 edges Level Size 0 1 1 4 2 8 3 12 4 16 5 20 6 24 7 28 8 32 9 36 10 40 11 44 12 48 ... 129 10 130 9 131 8 132 7 133 6 134 5 135 4 136 3 137 2 138 1 Reached 10000 vertices in search > Ro = UFget(2317) Ro = name: 'SNAP/roadNet-CA' title: 'Road network of California' A: [1971281x1971281 double] id: 2317 date: '2008' author: 'J. Leskovec, K. Lang, A. Dasgupta, M. Mahoney' ed: 'J. Leskovec' kind: 'undirected graph' notes: [34x79 char] > plotdegs(Ro.A); Number of nodes: 1971281 Number of edges: 2766607 Maximum degree: 12 > bfslevels(Ro.A); Graph has 1971281 vertices and 2766607 edges Level Size 0 1 1 3 2 4 3 4 4 7 5 10 6 14 7 25 8 26 9 33 10 42 ... 575 81 576 50 577 35 578 22 579 13 580 3 581 2 582 2 Reached 1957027 vertices in search > UFgrep circuit 370: Bomhof/circuit_1 371: Bomhof/circuit_2 372: Bomhof/circuit_3 373: Bomhof/circuit_4 541: Hamm/bcircuit 542: Hamm/hcircuit 544: Hamm/scircuit 1412: AMD/G2_circuit 1421: AMD/G3_circuit 1896: YZhou/circuit204 2246: Lee/fem_hifreq_circuit 2276: Freescale/circuit5M 2277: Freescale/circuit5M_dc > Ci = UFget(1412) Ci = name: 'AMD/G2_circuit' title: 'circuit simulation problem, Ufuk Okuyucu, AMD, Inc.' A: [150102x150102 double] id: 1412 date: '2006' author: 'U. Okuyucu' ed: 'T. Davis' kind: 'circuit simulation problem' > plotdegs(Ci.A); Number of nodes: 150102 Number of edges: 288286 Maximum degree: 5 > bfslevels(Ci.A) Graph has 150102 vertices and 288286 edges Level Size 0 1 1 4 ... 129 2 Reached 150102 vertices in search > ccoeff(Af.A) triangles = 8034 triples = 59791 coeff = 0.4031 > ccoeff(Co.A) triangles = 2098349 triples = 19820428 coeff = 0.3176 > ccoeff(Gr) triangles = 0 triples = 58804 coeff = 0 > ccoeff(Ci.A) triangles = 0 triples = 849785 coeff = 0 > plotccd(Af.A); Number of nodes: 4253 Number of edges: 12289 Maximum degree: 9 Global clustering coefficient: 0.40 > plotccd(Co.A); Number of nodes: 299067 Number of edges: 977676 Maximum degree: 336 Global clustering coefficient: 0.32 help rmat RMAT : generate power-law directed graph with R-MAT algorithm > Co Co = name: 'DIMACS10/coAuthorsDBLP' title: 'DIMACS10 set: coauthor/coAuthorsDBLP' A: [299067x299067 double] id: 2462 date: '2008' author: 'R. Geisberger, P. Sanders, and D. Schultes' ed: 'H. Meyerhenke' kind: 'undirected graph' notes: [113x72 char] > nnz(Co.A) ans = 1955352 > Er = sprandsym(300000,1955352/299067^2); > size(Er) ans = 300000 300000 > nnz(Er) ans = 1967566 > Er = spones(Er); > nnz(Er - Er') ans = 0 > nnz(diag(Er)) ans = 2 > Er = Er - diag(diag(Er)); > plotdegs(Er) Number of nodes: 300000 Number of edges: 983782 Maximum degree: 20 > bfslevels(Er); Graph has 300000 vertices and 983782 edges Level Size 0 1 1 7 2 46 3 319 4 2096 5 13261 6 71352 7 168403 8 43411 9 671 10 6 Reached 299573 vertices in search > ccoeff(Co.A) triangles = 2098349 triples = 19820428 coeff = 0.3176 > ccoeff(Er) triangles = 46 triples = 6449782 coeff = 2.1396e-05 > dhist(Er) > help rmat RMAT : generate power-law directed graph with R-MAT algorithm ... > Rm = rmat(17); > size(Rm) ans = 131072 131072 > nnz(Rm-Rm') ans = 1887110 > Rm = Rm | Rm'; > Rm = Rm - diag(diag(Rm)); > nnz(Rm-Rm') ans = 0 > nnz(Rm) ans = 1923202 > bfslevels(Rm) Graph has 131072 vertices and 961601 edges Level Size 0 1 1 13 2 1972 3 46322 4 37403 5 3519 6 159 7 17 8 1 Reached 89407 vertices in search > plotdegs(Rm); Number of nodes: 131072 Number of edges: 961601 Maximum degree: 3990 > figure,spy(Rm) > ccoeff(Co.A) triangles = 2098349 triples = 19820428 coeff = 0.3176 > ccoeff(Rm) triangles = 4341450 triples = 242139353 coeff = 0.0538 > plotccd(Co.A); Number of nodes: 299067 Number of edges: 977676 Maximum degree: 336 Global clustering coefficient: 0.32 > plotccd(Rm); Number of nodes: 131072 Number of edges: 961601 Maximum degree: 3990 Global clustering coefficient: 0.05