summaryrefslogtreecommitdiff
path: root/graph-checker/src/graph.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graph-checker/src/graph.rs')
-rw-r--r--graph-checker/src/graph.rs14
1 files changed, 1 insertions, 13 deletions
diff --git a/graph-checker/src/graph.rs b/graph-checker/src/graph.rs
index 581c522..dd8a6f4 100644
--- a/graph-checker/src/graph.rs
+++ b/graph-checker/src/graph.rs
@@ -1,7 +1,6 @@
use std::collections::HashSet;
use std::fmt;
-// TODO: manual Debug impl
#[derive(Clone, PartialEq, Eq)]
pub struct Graph {
pub size: usize,
@@ -32,7 +31,6 @@ impl fmt::Display for Graph {
}
}
-// TODO: manual Debug impl
impl fmt::Debug for Graph {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "\n")?;
@@ -51,7 +49,6 @@ impl fmt::Debug for Graph {
}
}
-// TODO: impl Cutset
fn trim_cutset(cutset: &Cutset) -> Graph {
let mut mat = vec![vec![0; cutset.cardinality]; cutset.cardinality];
@@ -112,7 +109,6 @@ impl Graph {
for character in line.chars() {
chars.push((character as i32 - 63) as u8);
}
- // TODO: spec allows multi-byte vector size
let size = chars[0] as usize;
let bytes = &chars[1..];
@@ -265,7 +261,6 @@ impl Graph {
self.count_components() == 1
}
- // TODO: replace with is_n_connected
pub fn is_2_connected(&self) -> bool {
let mut vertices = vec![1; self.size];
for i in 0..self.size {
@@ -280,7 +275,6 @@ impl Graph {
return true;
}
- // TODO: replace with is_n_connected
pub fn is_3_connected(&self) -> bool {
let mut vertices = vec![1; self.size];
for i in 0..self.size {
@@ -302,7 +296,6 @@ impl Graph {
return true;
}
- // TODO: replace with is_n_connected
pub fn is_4_connected(&self) -> bool {
let mut vertices = vec![1; self.size];
for i in 0..self.size {
@@ -328,11 +321,6 @@ impl Graph {
return true;
}
- pub fn is_n_connected(&self, n: usize) -> bool {
- // TODO: implement
- todo!();
- }
-
pub fn neighbors(&self, vert: i32) -> Vec<i32> {
let mut res = Vec::new();
@@ -378,7 +366,7 @@ impl Graph {
pub fn get_toughness(&self) -> f64 {
let mut left: f64 = 0.0;
- let mut right: f64 = 1024.0; // Reasonable limit
+ let mut right: f64 = 1024.0;
let eps: f64 = 1e-9;
while (right - left).abs() > eps {