Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f79cad7
Create Branch
Garrett-Pz Jun 9, 2025
c44096b
Add matches_graph generation
Garrett-Pz Jun 9, 2025
e79f665
Add search method using matches graph
Garrett-Pz Jun 9, 2025
d70e84e
Create Branch
Garrett-Pz Jun 9, 2025
72649cc
Add matches_graph generation
Garrett-Pz Jun 9, 2025
d38b457
Add search method using matches graph
Garrett-Pz Jun 9, 2025
e54947f
Merge branch 'clique' of github.com:DaymudeLab/ORCA into clique
Garrett-Pz Jun 9, 2025
0eba9e5
Add reduction rule
Garrett-Pz Jun 10, 2025
c169da2
Modify kernelization data structure
Garrett-Pz Jun 10, 2025
c823d98
Add some optimizations
Garrett-Pz Jun 11, 2025
8e24858
Add new bound
Garrett-Pz Jun 12, 2025
63f6cfe
Change graph data structure
Garrett-Pz Jun 13, 2025
f517c6a
Add color bound
Garrett-Pz Jun 14, 2025
f925206
Merge remote-tracking branch 'origin/main' into clique
Garrett-Pz Jun 14, 2025
b1e0316
Add faster kernelization
Garrett-Pz Jun 17, 2025
2f7667c
Fix matches_graph is now directed
Garrett-Pz Jun 17, 2025
b964a37
Fix fast kernelization and make it default
Garrett-Pz Jun 17, 2025
f77da54
Add new color bound
Garrett-Pz Jun 18, 2025
b032ef1
Add cover bound
Garrett-Pz Jun 19, 2025
d8d8c7e
Fix kernelize bug
Garrett-Pz Jun 19, 2025
60187cc
Add new kernelize and weight bound methods
Garrett-Pz Jun 23, 2025
19ffb97
Add benchmark for search
Garrett-Pz Jun 23, 2025
e5c6d4c
Add fragment bound
Garrett-Pz Jun 25, 2025
a48282b
Improve fragment bound
Garrett-Pz Jun 25, 2025
f10ae5e
Fix fragment bound
Garrett-Pz Jun 25, 2025
8bda572
Change how largest_remove is calculated and move ground truth
Garrett-Pz Jun 25, 2025
4585b11
Add cover bound with sorting
Garrett-Pz Jun 25, 2025
389aafd
Combine sorted and unsorted cover bound
Garrett-Pz Jun 25, 2025
cb550c9
Fix and improve fragment bound
Garrett-Pz Jun 27, 2025
a0bb2db
Use addition chain instead of log in add bound
Garrett-Pz Jun 27, 2025
02d8fc0
Fix fragment bound
Garrett-Pz Jun 30, 2025
e43586c
Add inclusion kernel and split bound
Garrett-Pz Jun 30, 2025
83940fe
Add command line args
Garrett-Pz Jul 9, 2025
0df4f3c
Reorganizing
Garrett-Pz Jul 9, 2025
b30da46
Merge remote-tracking branch 'origin/main' into clique
Garrett-Pz Jul 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ crate-type = ["rlib","cdylib"]
name = "benchmark"
harness = false

[[bench]]
name = "search_benchmark"
harness = false

70 changes: 70 additions & 0 deletions benches/search_benchmark.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
use bit_set::BitSet;
use criterion::{criterion_group, criterion_main, Criterion};
use std::time::Duration;
use std::{ffi::OsStr, time::Instant};
use std::fs;
use std::path::Path;

use assembly_theory::{
assembly::{clique_index_search_bench, Kernel, Bound},
loader,
molecule::Molecule,
};

pub fn reference_datasets(c: &mut Criterion) {
// Define a new criterion benchmark group of dataset benchmarks.
let mut group = c.benchmark_group("reference_datasets");

// Define datasets, bounds, and labels.
let datasets = ["gdb13_1201", "gdb17_200", "coconut_55"];
let bounds = [
Bound::IntChain,
];
let kernel = Kernel::Never;

// Loop over all datasets of interest.
for dataset in datasets.iter() {
// Load all molecules from the given dataset.
let paths = fs::read_dir(Path::new("data").join(dataset)).unwrap();
let mut mol_list: Vec<Molecule> = Vec::new();
for path in paths {
let name = path.unwrap().path();
if name.extension().and_then(OsStr::to_str) != Some("mol") {
continue;
}
mol_list.push(
loader::parse_molfile_str(
&fs::read_to_string(name.clone())
.expect(&format!("Could not read file {name:?}")),
)
.expect(&format!("Failed to parse {name:?}")),
);
}

group.bench_function(*dataset, move |b| {
b.iter_custom(|iters| {
let mut total = Duration::new(0, 0);
for _ in 0..iters {
for mol in mol_list.iter() {
let matches: Vec<(BitSet, BitSet)> = mol.matches().collect();
let start = Instant::now();
clique_index_search_bench(mol, matches, &bounds, kernel);
total += start.elapsed()
}
}

total
},
);
});
}

group.finish();
}

criterion_group! {
name = benchmark;
config = Criterion::default().sample_size(10);
targets = reference_datasets
}
criterion_main!(benchmark);
Loading
Loading