diff options
| author | Andrew Guschin <guschin@altlinux.org> | 2024-10-09 04:20:18 +0400 |
|---|---|---|
| committer | Andrew Guschin <guschin@altlinux.org> | 2024-10-09 04:20:18 +0400 |
| commit | 7bef94da59261074164a388fecd78f306877a499 (patch) | |
| tree | ef5a37a40658cdda6f42c925b3e462c8254d8027 /graph-checker/src/main.rs | |
| parent | 3310548b9d70b7963006f6038a8eac18a1cb73a0 (diff) | |
wip
Diffstat (limited to 'graph-checker/src/main.rs')
| -rw-r--r-- | graph-checker/src/main.rs | 64 |
1 files changed, 2 insertions, 62 deletions
diff --git a/graph-checker/src/main.rs b/graph-checker/src/main.rs index f7aec5c..677e037 100644 --- a/graph-checker/src/main.rs +++ b/graph-checker/src/main.rs @@ -6,10 +6,6 @@ use std::time::Instant; use tokio; mod graph; -use crate::graph::Graph; - -mod theorems; -// use crate::theorems::{basic, forbidden, toughness}; mod geng; use crate::geng::GengIterator; @@ -31,44 +27,18 @@ async fn main() -> Result<(), sqlx::Error> { .execute(&db) .await; - // let mut counters = Arc::new(Mutex::new(Counters::new())); - - // gi.par_bridge().for_each(|_| {}); - let gi = GengIterator::new(6); - // let start = Instant::now(); - // let tasks: Vec<_> = gi - // .map(|g| { - // // let db = db.clone(); - // tokio::spawn(compute::async_theorems1(g)) - // }) - // .collect(); - - // let res: Vec<_> = gi.par_bridge().map(compute::apply_theorems).collect(); // let res: Vec<_> = // gi.par_bridge().map(compute::dominating_numbers).collect(); - let res: Vec<_> = gi.map(compute::dominating_numbers).collect(); + // let res: Vec<_> = gi.map(compute::dominating_numbers).collect(); for pair in &res { if let Some(cardinality) = pair.1 { - if pair.2 != 0 { - println!("{} {:?} {}", pair.0, cardinality, pair.2); - } + println!("{} {:?} {:?}", pair.0, cardinality, pair.2); } } - // for (a, b) in &res { - // println!("{a} {b:?}"); - // } - - // let res = futures::future::join_all(tasks).await; - // let elapsed = start.elapsed(); - // let time = elapsed.as_nanos(); - // let res = res.iter().map(|e| e.as_ref().unwrap()).collect::<Vec<_>>(); - // println!("len = {}", res.len()); - // println!("Time elapsed: {}s", time as f64 / 1e9); - // let start = Instant::now(); // let res = gi // .par_bridge() @@ -80,35 +50,5 @@ async fn main() -> Result<(), sqlx::Error> { // println!("len = {}", res.len()); // println!("Time elapsed: {}s", time as f64 / 1e9); - /* - println!("Total count of graphs: {}", counters.graphs); - println!("Count of 1-tough graphs: {}", counters.tough_1); - println!("Count of 2-tough graphs: {}", counters.tough_2); - println!( - "Count of Dirac's Hamiltonian graphs: {}", - counters.dirac_hamiltonian - ); - println!( - "Count of Ore's Hamiltonian graphs: {}", - counters.ore_hamiltonian - ); - println!( - "Count of Posa's Hamiltonian graphs: {}", - counters.posa_hamiltonian - ); - println!( - "Count of Bondy-Chvatal Hamiltonian graphs: {}", - counters.bch_hamiltonian - ); - println!( - "Count of Theorem 15 Hamiltonian graphs: {}", - counters.t15_hamiltonian - ); - println!( - "Count of Theorem 25 Hamiltonian graphs: {}", - counters.t25_hamiltonian - ); - */ - Ok(()) } |