8 releases
0.1.7 | Nov 26, 2023 |
---|---|
0.1.6 | Nov 26, 2023 |
0.1.3 | Oct 30, 2023 |
#7 in #relation
9KB
162 lines
Tord
Tord is a simple data structure to store transitive relations
Usage
use tord::Tord;
fn main() {
let mut t = Tord::new();
t.insert((5, 6));
t.insert((6, 10));
t.insert((10, 19));
// We did not add (19, 6) but because of Transitivity,
// this relation exists
if t.check_relation((19, 6)) {
println!("Found it!");
} else {
println!("Relation does not exist");
}
}