Skip to main content

conspire/math/graph/
mod.rs

1use crate::math::Set;
2
3pub struct Graph {
4    adjacency: Set<Vec<Vec<usize>>>,
5}
6
7impl Graph {
8    pub fn adjacency(&self) -> &[Vec<usize>] {
9        self.adjacency.members()
10    }
11}
12
13impl From<Vec<Vec<usize>>> for Graph {
14    fn from(data: Vec<Vec<usize>>) -> Self {
15        let adjacency = data.into();
16        Self { adjacency }
17    }
18}