Skip to contents

Provides a compact table of graph characteristics for an "rknn_graphs" object created by create.rknn.graphs(). The table reports final edge counts, component-repair counts, degree summaries, and density/sparsity for each adaptive-radius k.scale value.

Usage

# S3 method for class 'rknn_graphs'
summary(object, ...)

Arguments

object

An object of class "rknn_graphs".

...

Additional arguments passed to or from other methods; currently unused.

Value

Invisibly returns a data frame with one row per graph and columns:

idx

Position of the graph in the returned graph sequence.

k

The adaptive-radius k.scale value.

n_vertices

Number of graph vertices.

n_ccomp

Number of connected components in the final graph.

n_ccomp_before_repair

Number of components before component-MST repair.

edges

Final number of undirected edges.

edges_before_pruning

Number of edges before geometric pruning.

edges_after_pruning

Number of edges after geometric pruning and before optional component repair.

mst_edges_added

Number of component-MST repair edges added.

mean_degree

Average vertex degree in the final graph.

min_degree

Minimum vertex degree.

median_degree

Median vertex degree.

max_degree

Maximum vertex degree.

max_degree_over_median

Ratio of maximum to median degree, or NA when the median degree is zero.

universal_vertices

Number of vertices adjacent to every other vertex.

density

Final graph density.

sparsity

One minus graph density.

Examples

X <- matrix(c(0, 1, 3, 4), ncol = 1)
graphs <- create.rknn.graphs(X, k.values = seq.int(1, 2), radius.search = "all.pairs",
    graph.detail = "minimal",
    prune.method = "none")
summary(graphs)
#> Summary of rknn_graphs object
#> -----------------------------
#> Graph rule: adaptive.radius 
#> Number of vertices: 4 
#> k values: 1, 2 
#> Radius factor: 1 
#> Radius rule: max 
#> 
#>  idx k n_vertices n_ccomp n_ccomp_before_repair edges edges_before_pruning
#>    1 1          4       2                     2     2                    2
#>    2 2          4       1                     1     5                    5
#>  edges_after_pruning mst_edges_added mean_degree min_degree median_degree
#>                    2               0         1.0          1           1.0
#>                    5               0         2.5          2           2.5
#>  max_degree max_degree_over_median universal_vertices  density sparsity
#>           1                    1.0                  0 0.333333 0.666667
#>           3                    1.2                  2 0.833333 0.166667