Skip to main content

graphlets

Function graphlets 

Source
pub fn graphlets(
    graph: &Graph,
    weights: &[f64],
    niter: u32,
) -> IgraphResult<GraphletDecomposition>
Expand description

Full graphlet decomposition: find basis + project + sort by weight.

Convenience function that calls graphlets_candidate_basis and graphlets_project, then sorts the result by decreasing weight.

§Errors

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

§Examples

use rust_igraph::{Graph, graphlets};

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

let result = graphlets(&g, &[1.0, 2.0, 1.0, 3.0], 1000).unwrap();
// Weights are in decreasing order
for w in result.mu.windows(2) {
    assert!(w[0] >= w[1]);
}