Learn R Programming

Topological Data Analysis: Simplicial Complex

This package aims to provide a user-friendly TDA application. Although many TDA libraries, such as Dionysus, PHAT, and GUDHI, have been developed in Python and C++, I believe it would be valuable to implement simplicial complex functionality in R, making it compatible with the wide range of statistical methods available in R.

Goals

  1. This package will continue adding useful knowledge in the playground to help both me and the users understand the methods.
  2. Since this package computes simplicial complexes, more applications are expected in future versions.

Example code

# Get its' simplices by specific epsilon
points <- matrix(c(0, 1, 1, 0, 0, 0, 1, 1), ncol = 2)
epsilon <- 1.5
vr_complex <- VietorisRipsComplex(points, epsilon)

# You can find its' topology feature by using these functions
faces(vr_complex$simplices, target_dim=1)
boundary(vr_complex$simplices, 1)
betti_number(vr_complex$simplices, 1, tol=0.1)
euler_characteristic(simplices, tol=0.1)
abstract_simplicial_complex(simplices, 2)

# Plot the Vietoris-rips complex
plot(
  vr_complex$network,
  layout = points,
  vertex.label = 1:nrow(points),
  vertex.size = 12,
  edge.arrow.mode = 0,
  asp = 1
)

# Filtration, Boundary reduction, and Persistence informations
F <- build_vr_filtration(points, eps_max=1.2)
res <- boundary_info(F)
pairs <- extract_persistence_pairs(F, res$last_1, res$pivot_owner)
plot_persistence(pairs)

Playground Try this playground to get familier with all of the concept that will be used in TDA.

Reference

  • Zomorodian, A., & Carlsson, G. (2004, June). Computing persistent homology. In Proceedings of the twentieth annual symposium on Computational geometry (pp. 347-356).
  • Chazal, F., & Michel, B. (2021). An introduction to topological data analysis: fundamental and practical aspects for data scientists. Frontiers in artificial intelligence, 4, 667963.

Copy Link

Version

Install

install.packages('SimplicialComplex')

Monthly Downloads

127

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

ChiChien Wang

Last Published

October 20th, 2025

Functions in SimplicialComplex (0.1.0)

faces

Generate all unique faces of a given dimension from simplices
abstract_simplicial_complex

Compute Euler characteristic for an abstract simplicial complex
euler_characteristic

Compute the Euler characteristic \(\chi\) of a simplicial complex
VietorisRipsComplex

Construct a Vietoris–Rips Complex (1-skeleton + maximal simplices)
boundary_info

Get the boundary matrix and its reduction information in matrix form
betti_number

Safely compute the rank of a sparse matrix
boundary

Compute the boundary operator for a simplicial complex
build_vr_filtration

Vietoris-Rips Filtration: Get the boundary matrix and its reduction information in matrix form
plot_persistence

Plot Persistence Diagram
extract_persistence_pairs

This function extracts the persistence from combining the boundary matrix and its filtration