Skip to contents

The ranks of the homology groups over Z/2: \(\beta_0\) counts connected components, \(\beta_1\) independent loops, \(\beta_2\) voids, and so on.

Usage

hg_betti(sc)

Arguments

sc

A simplicial_complex from simplicial().

Value

A named integer vector c(b0 = , b1 = , ...).

References

Hatcher, A. (2002). Algebraic Topology. Cambridge University Press.

Examples

adj <- matrix(c(0, 1, 1, 0,
                1, 0, 1, 1,
                1, 1, 0, 1,
                0, 1, 1, 0), 4, 4, dimnames = list(letters[1:4], letters[1:4]))
hg_betti(simplicial(adj))
#> b0 b1 b2 
#>  1  0  0