+
+ # Form a product graph of this graph and the other.
+ # Return the new graph.
+ def product(other)
+ product_graph = Graph.new
+ self.vertices.each do |v1|
+ other.vertices.each do |v2|
+ product_vertex = Vertex.new
+ product_vertex.left_node = v1
+ product_vertex.right_node = v2
+ product_graph << product_vertex
+ end
+ end
+ end
+
+ end # class