rshyper_algo/traits/operators.rs
1/*
2 appellation: operators <module>
3 authors: @FL03
4*/
5use crate::error::Result;
6use rshyper::{GraphProps, HyperGraph};
7
8/// this trait is used to denote an algorithm that can be applied to a hypergraph
9pub trait GraphicAlgorithm<H> {
10 /// the type of output that this algorithm produces
11 type Output;
12
13 /// run the algorithm on the graph and return the output
14 fn process(self, graph: H) -> Result<Self::Output>;
15}
16
17/// this trait is used to denote an algorithmic operator that can be applied to a hypergraph.
18pub trait GraphOperator<N, E, A>
19where
20 A: GraphProps,
21{
22 type Graph: HyperGraph<N, E, A>;
23
24 private!();
25}