Function rs_graph::algorithms::is_connected [] [src]

pub fn is_connected<'g, G>(g: &'g G) -> bool where
    G: IndexGraph<'g>, 

Determines if a graph is connected.

The empty graph is connected.

Example

use rs_graph::{LinkedListGraph, Graph, Builder, classes, algorithms};

let mut g: LinkedListGraph = classes::cycle(5);
assert!(algorithms::is_connected(&g));

g.add_node();
assert!(!algorithms::is_connected(&g));