line_graph

Function line_graph 

Source
pub fn line_graph<N, E, Ix>(graph: &Graph<N, E, Ix>) -> Graph<(N, N), (), Ix>
where N: Node + Clone + Debug, E: EdgeWeight + Clone, Ix: IndexType,
Expand description

Creates a line graph from the input graph

In a line graph, each edge of the original graph becomes a vertex, and two vertices in the line graph are connected if the corresponding edges in the original graph share a common vertex.

§Arguments

  • graph - The input graph

§Returns

  • A new graph representing the line graph