Skip to contents

Load a real graph offline, or browse the frozen package catalogue. No network, Python, or external viewer is needed. The catalogue includes the curated comparison gallery and all six examples used by Zheng, Pawar and Goodman. Gallery membership and original-six membership are separate columns.

Usage

suitesparse.graph(name)

suitesparse.graphs()

Source

SuiteSparse Matrix Collection, https://sparse.tamu.edu/.

Arguments

name

Full graph ID (for example `"HB/494_bus"`) or a unique short name (`"494_bus"`). Names are case-sensitive. Component-derived IDs include the `__LCC_` suffix and never resolve as the original full graph.

Value

`suitesparse.graphs()` returns a data frame with `id`, `name`, `group`, `vertices`, `edges`, `conversion_type`, `components`, `original_vertices`, `retained_fraction`, `gallery`, and `original_six`.

`suitesparse.graph()` returns a list with `n` (including isolated vertices), `edges` (a two-column integer matrix of unique, lexicographically sorted, one-based undirected edges), `edge_weights` (unit traversal lengths), `vertex_data`, and `provenance`. Vertex data contain consecutive `vertex`, one-based `source_index`, `label`, `source_partition` (`row` or `column`), `original_vertex` (one-based index before component extraction), and one-based `component`, `vertex_id` (saved graph identity), and `source_vertex_id` (identity before extraction). In bipartite graphs, source indices refer separately to matrix rows and columns. Les Miserables retains character names.

Provenance includes source and download URLs, source matrix headers with original credits, CC BY 4.0 licensing, SHA-256 checksums, conversion recipe, original graph identity, and component retention information. The original six also retain their earlier metadata under `original_example`.

Details

Square matrices use the union of off-diagonal numerical support with its transpose, after summing duplicates and removing numerical zeros. Rectangular matrices use distinct row and column vertices. Matrix signs, magnitudes and physical units are not traversal lengths: every edge has length one. Some full graphs are disconnected. Largest-component graphs are explicitly identified and retain their original vertex mapping.

The installed selection is fixed; changing viewer favorites does not change package data. See `extdata/suitesparse/selection-30_sept_2026.json` and `extdata/suitesparse/PROVENANCE.html` in the installed package.

References

Davis, T. A. and Hu, Y. (2011). The University of Florida Sparse Matrix Collection. doi:10.1145/2049662.2049663 .

Zheng, J. X., Pawar, S. and Goodman, D. F. M. (2018). Graph Drawing by Stochastic Gradient Descent. doi:10.1109/TVCG.2018.2859997 .

Examples

catalogue <- suitesparse.graphs()
head(catalogue)
#>                            id                    name     group vertices edges
#> 1     AG-Monien/netz4504_dual           netz4504_dual AG-Monien      615  1171
#> 2                 Bai/bfwa782                 bfwa782       Bai      782  3394
#> 3                  Bai/dw256A                  dw256A       Bai      512  1004
#> 4                  Bai/dw256B                  dw256B       Bai      512  1024
#> 5 Bai/mhda416__LCC_409_of_416 mhda416__LCC_409_of_416       Bai      409  5177
#> 6                   Bai/qh768                   qh768       Bai      768  1322
#>     conversion_type components original_vertices retained_fraction gallery
#> 1            square          1               615         1.0000000    TRUE
#> 2            square          1               782         1.0000000    TRUE
#> 3            square          1               512         1.0000000    TRUE
#> 4            square          1               512         1.0000000    TRUE
#> 5 largest_component          1               416         0.9831731    TRUE
#> 6            square          1               768         1.0000000    TRUE
#>   original_six
#> 1        FALSE
#> 2        FALSE
#> 3        FALSE
#> 4        FALSE
#> 5        FALSE
#> 6        FALSE
g <- suitesparse.graph("494_bus")
identical(g, suitesparse.graph("HB/494_bus"))
#> [1] TRUE
c(vertices = g$n, edges = nrow(g$edges))
#> vertices    edges 
#>      494      586 
head(suitesparse.graph("lesmis")$vertex_data)
#>   vertex source_index          label source_partition original_vertex vertex_id
#> 1      1            1         Myriel              row               1       v:1
#> 2      2            2       Napoleon              row               2       v:2
#> 3      3            3 MlleBaptistine              row               3       v:3
#> 4      4            4    MmeMagloire              row               4       v:4
#> 5      5            5   CountessDeLo              row               5       v:5
#> 6      6            6       Geborand              row               6       v:6
#>   source_vertex_id component
#> 1              v:1         1
#> 2              v:2         1
#> 3              v:3         1
#> 4              v:4         1
#> 5              v:5         1
#> 6              v:6         1