euler_characteristic: Compute the Euler characteristic chi of a simplicial complex

View source: R/EulerCharacteristic.R

euler_characteristicR Documentation

Compute the Euler characteristic \chi of a simplicial complex

Description

Compute the Euler characteristic \chi of a simplicial complex

Usage

euler_characteristic(simplices, tol)

Arguments

simplices

A list of simplices (each a numeric vector).

tol

Optional numerical tolerance to pass to rankMatrix().

Details

The Euler characteristic is computed as:

\chi = \sum_{k=0}^{k_{\max}} (-1)^k \beta_k

where \beta_k is the kth Betti number, and k_{\max} is the highest dimension of any simplex in the complex.

Interpretation of values:

  • \chi = 2: Sphere-like surfaces

  • \chi = 1: Disk-like spaces

  • \chi = 0: Torus-like or circle-like spaces

  • \chi < 0: Surfaces with multiple handles or genus

Value

An integer representing the Euler characteristic \chi.

See Also

betti_number

Examples

simplices <- list(c(1, 2), c(3, 4), c(2, 1, 3), c(4, 2))
euler_characteristic(simplices, tol=0.1)

SimplicialComplex documentation built on Nov. 5, 2025, 7:40 p.m.