verify_with_igraph: Verify Against igraph

View source: R/cluster-metrics.R

verify_with_igraphR Documentation

Verify Against igraph

Description

Compares the macro weights of csum with the result of contracting the clusters in igraph (igraph::contract() followed by igraph::simplify()).

Usage

verify_with_igraph(x, clusters, method = "sum", type = "raw")

verify_igraph(x, clusters, method = "sum", type = "raw")

Arguments

x

Adjacency matrix

clusters

Cluster specification (see csum)

method

Aggregation method. Default "sum".

type

Normalization type passed to csum. Default "raw", the only type whose values igraph reproduces.

Value

A list with components our_result (cograph's macro weight matrix), igraph_result (igraph's contract() + simplify() matrix, diagonal set to zero), matches (logical, whether the off-diagonal cells agree to within 1e-10) and difference (the all.equal() report when they do not, otherwise NULL). Returns NULL with a message if igraph is not installed.

Examples


clusters <- list(C1 = c("Explore", "Reflect", "Discuss"),
                 C2 = c("Plan", "Create", "Share"),
                 C3 = c("Monitor", "Adapt", "Synthesize", "Evaluate"))
verify_with_igraph(regulation_net, clusters = clusters)


cograph documentation built on Nov. 19, 2026, 5:07 p.m.