Skip to main content

random_simplicial_complex

Function random_simplicial_complex 

Source
pub fn random_simplicial_complex(
    n: usize,
    ps: &[f64],
    seed: Option<u64>,
) -> Result<SimplicialComplex, GeneratorError>
Available on crate feature generators only.
Expand description

Random simplicial complex: connect any d+1 nodes with a simplex with prob ps[d-1]; all subfaces are added. XGI random_simplicial_complex(N, ps).

Note (Phase 4 Task 9): the plan’s assumed SimplicialComplex API (add_nodes_from(impl IntoIterator<Item=(String, Value)>), add_simplices_from(impl IntoIterator<Item = Vec<String>>)) does not match the landed Phase-2 surface exactly — add_simplices_from takes 3-tuples (members, idx, attrs), and add_node/add_nodes_from did not exist at all (added to core/simplicialcomplex.rs alongside this task, mirroring Hypergraph::add_node/add_nodes_from) so that all N nodes can be registered up front, matching XGI’s S.add_nodes_from(nodes) before S.add_simplices_from(simplices).