Skip to main content

graphlets_candidate_basis

Function graphlets_candidate_basis 

Source
pub fn graphlets_candidate_basis(
    graph: &Graph,
    weights: &[f64],
) -> IgraphResult<GraphletBasis>
Expand description

Find a candidate graphlets basis for a weighted undirected graph.

The input graph must be simple (no self-loops, no parallel edges). Edge directions are ignored. The algorithm recursively finds maximal cliques at successively higher weight thresholds, then filters out non-maximal cliques that are subsets of larger cliques at the same threshold.

§Errors

  • InvalidArgument if weights length doesn’t match edge count, or the graph is not simple.

§Examples

use rust_igraph::{Graph, graphlets_candidate_basis};

let mut g = Graph::with_vertices(4);
g.add_edge(0, 1).unwrap(); // weight 1
g.add_edge(1, 2).unwrap(); // weight 2
g.add_edge(0, 2).unwrap(); // weight 1
g.add_edge(2, 3).unwrap(); // weight 3

let basis = graphlets_candidate_basis(&g, &[1.0, 2.0, 1.0, 3.0]).unwrap();
assert!(!basis.cliques.is_empty());