Determining Complete Multipartite Graphs (Specifically Tripartite)
I have been reading the Sage References, and it does not seem that complete multipartite graphs are defined in Sage yet. I have tried to critique the following two lines of code to see if it would work for complete multipartite graphs.
def is_complete_multipartite(p):
return p.is_multipartite() and p.num_edges() == mul(map(len, g.multipartite_sets()))
dd = filter(is_complete_multipartite, d)
I get a "graph attribute needed" error. I just wanted to verify that this is the case. Thanks again for the help!