A complete multipartite graph is a graph that is first and foremost multi-partite. That is, the vertex set of a complete multipartite graph can be partitioned into k sets such that within each set, none of the vertices are connected by an edge. The second condition is that each vertex is connected to ever vertex except for those in its partition so that it is "almost" a complete graph. For programming this graph, the input is a list P. The length of the list P will be the number of groups of vertices. For example, in a complete bipartite graph, the length of the list would be 2. The entry P_i will determine how many vertices are in each partition; necisarrily, we see that the entries of the list must be positive integers.
i1 : G = completeMultipartiteGraph {1,2,3} o1 = Graph{0 => {1, 2, 3, 4, 5}} 1 => {0, 3, 4, 5} 2 => {0, 3, 4, 5} 3 => {0, 1, 2} 4 => {0, 1, 2} 5 => {0, 1, 2} o1 : Graph |
The object completeMultipartiteGraph is a method function.