Skip to main content

Module simplify

Module simplify 

Source
Expand description

Topology simplification and intersection consolidation primitives.

These functions work purely on graph topology (node indices); the R layer is responsible for rebuilding sf geometry from the returned node chains and component labels.

Functions§

connected_components
Connected-component label (the 0-based root node index) for each of n nodes, given undirected a–b adjacency pairs.
simplify_paths
Find simplified chains: every maximal path of interstitial (degree-2) nodes between two endpoints. Each chain is returned once as an ordered vector of node indices [endpoint, ..interstitial.., endpoint].