From a5bf84189c0df8a2ac5a6f99ca314a1f39c9b697 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 9 Apr 2023 18:23:13 +0400 Subject: Restructured project into multiple files --- graph-checker/src/theorems/toughness.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 graph-checker/src/theorems/toughness.rs (limited to 'graph-checker/src/theorems/toughness.rs') 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; +} -- cgit v1.2.3