#relation #structure #data-structures #transitive #store #insert #exists

tord

Simple Data structure to store transitive relations

8 releases

0.1.7 Nov 26, 2023
0.1.6 Nov 26, 2023
0.1.3 Oct 30, 2023

#8 in #relation

Download history 22/week @ 2024-02-25 5/week @ 2024-03-10 1/week @ 2024-03-17 107/week @ 2024-03-31

113 downloads per month

Custom license

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");
	}
}

No runtime deps