diff options
Diffstat (limited to 'graph-checker/src')
| -rw-r--r-- | graph-checker/src/graph.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/graph-checker/src/graph.rs b/graph-checker/src/graph.rs index 4c06660..6a49624 100644 --- a/graph-checker/src/graph.rs +++ b/graph-checker/src/graph.rs @@ -1,31 +1,18 @@ use std::fmt; +#[derive(Clone, PartialEq, Eq)] pub struct Graph { pub size: usize, pub matrix: Vec<Vec<i32>>, } +#[derive(Clone, PartialEq, Eq)] pub struct Cutset { pub cardinality: usize, pub vertices: Vec<i32>, pub graph: Graph, } -impl Clone for Graph { - fn clone(&self) -> Self { - let mut matrix = vec![vec![0; self.size]; self.size]; - for row in 0..self.size { - for col in 0..self.size { - matrix[row][col] = self.matrix[row][col]; - } - } - return Graph { - size: self.size, - matrix, - }; - } -} - impl fmt::Display for Graph { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for row in 0..self.size { |