| Crates.io | ibdgen |
| lib.rs | ibdgen |
| version | 0.1.2 |
| created_at | 2025-01-12 23:26:03.597617+00 |
| updated_at | 2025-01-18 02:56:07.590787+00 |
| description | Generate incomplete block designs for experiments with prohibited pairs |
| homepage | |
| repository | https://github.com/consultimi/ibdgen |
| max_upload_size | |
| id | 1513768 |
| size | 118,308 |
A Rust library for generating Incomplete Block Designs (IBDs) with prohibitions between pairs of treatments. This is a loose port of the optBlock C code from the AlgDesign R package (https://github.com/jvbraun/AlgDesign)
The algorithm creates an optimal design based on D-optimality. For smaller combinations of v, n_b, k, the algorithm should produce a BIBD (if one exists, and presuming no prohibitions of course).
To use the library, you can call the find_best_ibd function with the desired parameters. Here's an example:
let result = find_best_ibd(v, n_b, block_size, n_repeats, iter, prohibited_pairs);
where:
This will generate an IBD with the specified parameters and return the best solution found.
The command line interface is a simple wrapper around the ibdgen function.
Usage:
ibdgen 9 12 3 -p "1,2,3,4" --nrepeats 5 --iter 10
creates an IBD with v=9, n_b=12, k=3 design with prohibited pairs (1,2) and (3,4). --n_repeats and --iter are optional, and default to 5 and 10 respectively.
This project is licensed under the GPL3 License - see the LICENSE file for details.
The code works, but neither my Rust nor my linear algebra are world-class, so doubtless many improvements are possible. In particular, the code is slow for large combos of v, n_b and k given the find_delta_block function which iterates over all pairs of blocks several times.