Learn R Programming

grip (version 0.3.0)

build.weighted.misf: Build a weighted MISF hierarchy

Description

build.weighted.misf() builds the weighted max-independent-set filtration used by the weighted GRIP layout core. It is primarily a diagnostic and benchmarking helper for comparing weighted and combinatorial hierarchies on the same graph.

Usage

build.weighted.misf(
  edges = NULL,
  n = NULL,
  adj.list = NULL,
  weight.list = NULL,
  edge.weights = NULL,
  num.init = 24,
  num.nbrs = 20,
  length.normalization = c("median", "mean", "none"),
  seed = 6
)

Value

A list with weighted MISF levels, vertex_depth,

mish_order, misf_size, num_nbrs_schedule,

misf_height, top_level_size, weight_scale, and

length_normalization.

Arguments

edges

Two-column integer matrix of edges (1-based vertex ids).

n

Number of vertices.

adj.list

Adjacency list (1-based) for undirected graphs.

weight.list

Parallel list of strictly positive edge lengths.

edge.weights

Optional vector of edge lengths for edges.

num.init

Number of initial vertices in the coarsest level.

num.nbrs

Maximum number of retained local neighbors per level.

length.normalization

Global edge-length normalization: "median" (default), "mean", or "none".

seed

Optional RNG seed for reproducibility. If NULL, uses current time.

Examples

Run this code
cycle_edges <- edges.cycle(6)
cycle_lengths <- seq(0.8, 1.3, length.out = nrow(cycle_edges))
levels <- build.weighted.misf(
  edges = cycle_edges, n = 6, edge.weights = cycle_lengths,
  num.init = 3, num.nbrs = 2, seed = 1
)

Run the code above in your browser using DataLab