Skip to main content

complement

Function complement 

Source
pub fn complement<V: Eq + Hash + Clone + Debug>(graph: &Graph<V>) -> Graph<V>
Expand description

Computes the complement of a graph.

ยงExamples

use rssn::symbolic::core::Expr;
use rssn::symbolic::graph::Graph;
use rssn::symbolic::graph_operations::complement;

let mut g = Graph::new(false);

g.add_edge(&"A", &"B", Expr::Constant(1.0));

g.add_edge(&"B", &"C", Expr::Constant(1.0));

g.add_edge(&"C", &"A", Expr::Constant(1.0));

let comp = complement(&g);

assert_eq!(comp.get_edges().len(), 0);