contract {simplextree}R Documentation

Edge contraction

Description

Performs an edge contraction.

Usage

contract(st, edge)

Arguments

st

a simplex tree.

edge

an edge to contract, as a 2-length vector.

Details

This function performs an edge contraction in the sense described by (1), which is summarized here. Given an edge va,vb {va, vb}, vbvb is contracted to vava if vbvb is removed from the complex and the link of vava is augmented with the link of vbvb. This may be thought as applying the mapping:

f(u)=vaf(u) = va

if u=vbu = vb and identity otherwise, to all simplices in the complex.
edge is not sorted prior to contraction: the second vertex of the edge is always contracted to the first. Note that edge contraction is not symmetric.

References

1. Boissonnat, Jean-Daniel, and Clement Maria. "The simplex tree: An efficient data structure for general simplicial complexes." Algorithmica 70.3 (2014): 406-427.

Examples

st <- simplex_tree(1:3) 
st %>% print_simplices()
# 1, 2, 3, 1 2, 1 3, 2 3, 1 2 3
st %>% contract(c(1, 3)) %>% print_simplices()
# 1, 2, 1 2

[Package simplextree version 1.0.1 Index]