compose_coarsening: Compose Two Coarsening Passes

View source: R/rec_coarsen.R

compose_coarseningR Documentation

Compose Two Coarsening Passes

Description

Given the results of two consecutive passes of the REC coarsening, this function composes them to produce a single equivalent coarsening mapping and corresponding coarsened matrices.

Usage

compose_coarsening(pass1, pass2)

Arguments

pass1

A list containing 'C', 'W_c', 'L_c', and 'mapping' from the first coarsening pass.

pass2

A list containing 'C', 'W_c', 'L_c', and 'mapping' from the second coarsening pass.

Value

A list with elements:

C_final

The final coarsening matrix mapping from the original graph to the final coarsened graph.

W_c_final

The final coarsened adjacency matrix.

L_c_final

The final coarsened Laplacian matrix.

mapping_final

An integer vector mapping original vertices directly to the final coarsened vertices.

Examples

# Suppose you have run:
# result1 <- rec_coarsen(W, T=..., ...)
# result2 <- rec_coarsen(result1$W_c, T=..., ...)
# Now compose:
# composed_result <- compose_coarsening(result1, result2)


bbuchsbaum/graphweights documentation built on Dec. 14, 2024, 1:13 a.m.