Multiplying the vertex of a graph adds one vertex to the original graph. It also adds several edges, namely, if we are multiplying a vertex v and calling the new vertex u, {u,W} is an edge if and only if {v,w} is an edge.
i1 : G = completeGraph 5 o1 = Graph{0 => {1, 2, 3, 4}} 1 => {0, 2, 3, 4} 2 => {0, 1, 3, 4} 3 => {0, 1, 2, 4} 4 => {0, 1, 2, 3} o1 : Graph |
i2 : H = vertexMultiplication(G, 0, 6) o2 = Graph{0 => {1, 2, 3, 4} } 1 => {0, 2, 3, 4, 6} 2 => {0, 1, 3, 4, 6} 3 => {0, 1, 2, 4, 6} 4 => {0, 1, 2, 3, 6} 6 => {1, 2, 3, 4} o2 : Graph |
The object vertexMultiplication is a method function.