Skip to contents

Computes 0-dimensional persistent homology for a graph based on vertex function values. This tracks the birth and death of connected components during a filtration process.

Usage

compute.persistence(adj.list, y, n.top.basins = 4, alpha = 0.5)

Arguments

adj.list

A list where each element contains the indices of adjacent vertices.

y

A numeric vector of function values at vertices.

n.top.basins

Integer; number of top persistence basins to return (default: 4).

alpha

Numeric between 0 and 1; weight parameter for weighted persistence (default: 0.5). Only used when weighted = TRUE.

Value

A list containing:

persistence

Data frame with persistence information for each component

basins

List of vertex sets for the top persistence basins

Details

For unweighted graphs, the algorithm processes vertices in decreasing order of function values, tracking when connected components merge. For weighted graphs, the death values incorporate both vertex values and edge weights.

The persistence of a component quantifies its significance, with higher values indicating more prominent topological features.

Examples

# Simple chain graph
adj.list <- list(c(2), c(1,3), c(2,4), c(3,5), c(4))
y <- c(10, 7, 9, 2, 5)

# Compute persistence
result <- compute.persistence(adj.list, y)
print(result$persistence)