diff options
Diffstat (limited to 'graph-checker/src/theorems/toughness.rs')
| -rw-r--r-- | graph-checker/src/theorems/toughness.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/graph-checker/src/theorems/toughness.rs b/graph-checker/src/theorems/toughness.rs new file mode 100644 index 0000000..e659901 --- /dev/null +++ b/graph-checker/src/theorems/toughness.rs @@ -0,0 +1,17 @@ +use crate::Graph; + +pub fn theorem15(g: &Graph, toughness: f64, min_degree: f64) -> bool { + let max_ind_cutset_size = g.max_independent_cutset().cardinality as f64; + let third_of_size = g.size as f64 / 3.0; + let tmp = if third_of_size > max_ind_cutset_size - 1.0 { + third_of_size + } else { + max_ind_cutset_size - 1.0 + }; + + return toughness >= 1.0 && min_degree >= tmp; +} + +pub fn theorem25(g: &Graph, toughness: f64, min_degree: f64) -> bool { + return min_degree > g.size as f64 / (toughness + 1.0) - 1.0; +} |