require_non_empty

Function require_non_empty 

Source
pub fn require_non_empty<A, W, Ty: GraphConstructor<A, W> + EdgeType>(
    graph: &BaseGraph<A, W, Ty>,
    algo_name: &str,
) -> Result<()>
where A: Debug, W: Debug,
Expand description

Validates that the graph is non-empty.

Returns Ok(()) if the graph has at least one node, otherwise returns an error.