1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Implementations of various graph algorithms that can be run on the graph.
//!
//! The algorithms are grouped into modules based on the type of graph they can be run on.
//!
//! To run an algorithm simply import the module and call the function.
//!
//! # Examples
//!
//! ```rust
//! use raphtory::algorithms::metrics::degree::average_degree;
//! use raphtory::prelude::*;
//!
//! let g = Graph::new();
//! let vs = vec![
//! (1, 1, 2),
//! (2, 1, 3),
//! (3, 2, 1),
//! (4, 3, 2),
//! (5, 1, 4),
//! (6, 4, 5),
//! ];
//!
//! for (t, src, dst) in &vs {
//! g.add_edge(*t, *src, *dst, NO_PROPS, None);
//! };
//! println!("average_degree: {:?}", average_degree(&g));
//! ```