diff options
| author | Andrew Guschin <guschin@altlinux.org> | 2024-10-29 17:03:25 +0400 |
|---|---|---|
| committer | Andrew Guschin <guschin@altlinux.org> | 2024-10-29 17:17:37 +0400 |
| commit | 2ca7b9c081da1d0aac4d6b777d226255941c503e (patch) | |
| tree | 72b343c1ab8b8765c1bfa8d545540f496d3c04f6 /graph-checker | |
| parent | 339a0c02457880ecfc44187285b344bb4a72721a (diff) | |
fix(graph-checker): fix compute for independent dominating number
Diffstat (limited to 'graph-checker')
| -rw-r--r-- | graph-checker/src/compute.rs | 9 | ||||
| -rw-r--r-- | graph-checker/src/main.rs | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/graph-checker/src/compute.rs b/graph-checker/src/compute.rs index 67c1ae4..f11face 100644 --- a/graph-checker/src/compute.rs +++ b/graph-checker/src/compute.rs @@ -10,11 +10,16 @@ pub async fn dominating_numbers( let mut min_size = g.size; for cs in g.cutsets() { - if independent_dominating.is_none() { + if independent_dominating.is_none_or(|cur| cur > 1) { let dom = cs.is_dominating_in(&g); let idp = cs.graph.is_independent(); if dom && idp { - independent_dominating = Some(cs.cardinality as u32); + independent_dominating = Some( + independent_dominating + .map_or(cs.cardinality as u32, |cur| { + std::cmp::min(cur, cs.cardinality as u32) + }), + ); } } diff --git a/graph-checker/src/main.rs b/graph-checker/src/main.rs index c1c2c4a..7747abb 100644 --- a/graph-checker/src/main.rs +++ b/graph-checker/src/main.rs @@ -71,13 +71,6 @@ async fn main() -> anyhow::Result<()> { query.push_values(part, |mut b, res| { match res { Ok((g6, size, ind_dom, fg)) => { - // log::debug!( - // "inserting {} {} {:?} {:?}", - // g6, - // size, - // ind_dom, - // fg - // ); b.push_bind(g6) .push_bind(size as u32) .push_bind(ind_dom.unwrap_or(0)) |