Skip to contents

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
)

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.

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.

Examples

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
)