cartesian_product

Function cartesian_product 

Source
pub fn cartesian_product<N1, N2, E1, E2, Ix>(
    graph1: &Graph<N1, E1, Ix>,
    graph2: &Graph<N2, E2, Ix>,
) -> Graph<(N1, N2), (), Ix>
where N1: Node + Clone + Debug, N2: Node + Clone + Debug, E1: EdgeWeight, E2: EdgeWeight, Ix: IndexType,
Expand description

Computes the Cartesian product of two graphs

The Cartesian product G □ H has vertex set V(G) × V(H) and edge set {((u₁,v₁),(u₂,v₂)) : (u₁=u₂ and (v₁,v₂) ∈ E(H)) or (v₁=v₂ and (u₁,u₂) ∈ E(G))}.

§Arguments

  • graph1 - First input graph
  • graph2 - Second input graph

§Returns

  • The Cartesian product graph