MCPcopy Create free account
hub / github.com/Pometry/Raphtory / k_core

Function k_core

raphtory/src/python/packages/algorithms.rs:810–823  ·  view source on GitHub ↗
(
    graph: &PyGraphView,
    k: usize,
    iter_count: usize,
    threads: Option<usize>,
)

Source from the content-addressed store, hash-verified

808#[pyfunction]
809#[pyo3[signature = (graph, k, iter_count, threads=None)]]
810pub fn k_core(
811 graph: &PyGraphView,
812 k: usize,
813 iter_count: usize,
814 threads: Option<usize>,
815) -> Nodes<'static, DynamicGraph> {
816 let v_set = k_core_set(&graph.graph, k, iter_count, threads);
817 let index = if v_set.len() == graph.graph.unfiltered_num_nodes(&LayerIds::All) {
818 Index::for_graph(graph.graph.clone())
819 } else {
820 Index::from_iter(v_set)
821 };
822 Nodes::new_filtered(graph.graph.clone(), graph.graph.clone(), NO_FILTER, index)
823}
824
825/// Simulate an SEIR dynamic on the network
826///

Callers

nothing calls this directly

Calls 4

k_core_setFunction · 0.85
lenMethod · 0.45
unfiltered_num_nodesMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected