| build_simplicial | R Documentation |
Constructs a simplicial complex from a network or higher-order pathway object. Two construction methods are available:
Clique complex ("clique"): every clique in the
thresholded non-zero graph becomes a simplex. Edges with absolute
weight \geq threshold are retained. The standard bridge
from graph theory to algebraic topology.
Pathway complex ("pathway"): each higher-order
pathway from a net_hon or net_hypa becomes a simplex.
For type = "vr" (or alias "rips"), the input is treated as
a non-negative distance / dissimilarity matrix and a Vietoris-Rips
filtration is constructed: each k-simplex \sigma enters at
\max_{(i,j) \in \sigma} d(i,j). Use max_scale to cap the
filtration diameter; edges with d(i,j) > max_scale are excluded.
Filtration values are attached as $filtration on the returned
object so persistent_homology() can read them directly.
build_simplicial(
x,
type = "clique",
threshold = 0,
max_dim = 10L,
max_pathways = NULL,
anomaly = c("all", "over", "under"),
max_scale = NULL,
...
)
x |
A square matrix, |
type |
Construction type: |
threshold |
For |
max_dim |
Maximum simplex dimension (default 10). Must be a single non-negative integer. A k-simplex has k+1 nodes. |
max_pathways |
For |
anomaly |
For HYPA pathway complexes, which anomaly direction to
include: |
max_scale |
For |
... |
Additional arguments passed to |
A simplicial_complex object. For type = "vr" an
additional $filtration numeric vector is attached (parallel to
$simplices).
betti_numbers, persistent_homology,
simplicial_degree, q_analysis
mat <- matrix(c(0,.6,.5,.6,0,.4,.5,.4,0), 3, 3)
colnames(mat) <- rownames(mat) <- c("A","B","C")
sc <- build_simplicial(mat, threshold = 0.3)
print(sc)
betti_numbers(sc)
# Vietoris-Rips on a distance matrix:
d <- 1 - mat
diag(d) <- 0
sc_vr <- build_simplicial(d, type = "vr", max_scale = 0.6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.