Skip to main content

graph_from

Function graph_from 

Source
pub fn graph_from<S, N, E, F, G>(
    nodes: &[S],
    edges: &[(S, S)],
    node_weight: F,
    edge_weight: G,
) -> Graph<N, E, Undirected, u32>
where S: PartialEq, F: FnMut(&S) -> N, G: FnMut(&(S, S)) -> E,
Expand description

Turns the nodes and edges into a Graph. The node and edge weights are computed via the provided functions node_weight and edge_weight.