def cluster_graph(self, combine_vertices=None, combine_edges=None):
    'Returns a graph where each cluster is contracted into a single\n        vertex.\n\n        In the resulting graph, vertex M{i} represents cluster M{i} in this\n        clustering. Vertex M{i} and M{j} will be connected if there was\n        at least one connected vertex pair M{(a, b)} in the original graph such\n        that vertex M{a} was in cluster M{i} and vertex M{b} was in cluster\n        M{j}.\n\n        @param combine_vertices: specifies how to derive the attributes of\n          the vertices in the new graph from the attributes of the old ones.\n          See L{Graph.contract_vertices()} for more details.\n        @param combine_edges: specifies how to derive the attributes of the\n          edges in the new graph from the attributes of the old ones. See\n          L{Graph.simplify()} for more details. If you specify C{False}\n          here, edges will not be combined, and the number of edges between\n          the vertices representing the original clusters will be equal to\n          the number of edges between the members of those clusters in the\n          original graph.\n\n        @return: the new graph.\n        '
    result = self.graph.copy()
    result.contract_vertices(self.membership, combine_vertices)
    if (combine_edges != False):
        result.simplify(combine_edges=combine_edges)
    return result
Returns a graph where each cluster is contracted into a single
vertex.

In the resulting graph, vertex M{i} represents cluster M{i} in this
clustering. Vertex M{i} and M{j} will be connected if there was
at least one connected vertex pair M{(a, b)} in the original graph such
that vertex M{a} was in cluster M{i} and vertex M{b} was in cluster
M{j}.

@param combine_vertices: specifies how to derive the attributes of
  the vertices in the new graph from the attributes of the old ones.
  See L{Graph.contract_vertices()} for more details.
@param combine_edges: specifies how to derive the attributes of the
  edges in the new graph from the attributes of the old ones. See
  L{Graph.simplify()} for more details. If you specify C{False}
  here, edges will not be combined, and the number of edges between
  the vertices representing the original clusters will be equal to
  the number of edges between the members of those clusters in the
  original graph.

@return: the new graph.
def cluster_graph(self, combine_vertices=None, combine_edges=None):
    'Returns a graph where each cluster is contracted into a single\n        vertex.\n\n        In the resulting graph, vertex M{i} represents cluster M{i} in this\n        clustering. Vertex M{i} and M{j} will be connected if there was\n        at least one connected vertex pair M{(a, b)} in the original graph such\n        that vertex M{a} was in cluster M{i} and vertex M{b} was in cluster\n        M{j}.\n\n        @param combine_vertices: specifies how to derive the attributes of\n          the vertices in the new graph from the attributes of the old ones.\n          See L{Graph.contract_vertices()} for more details.\n        @param combine_edges: specifies how to derive the attributes of the\n          edges in the new graph from the attributes of the old ones. See\n          L{Graph.simplify()} for more details. If you specify C{False}\n          here, edges will not be combined, and the number of edges between\n          the vertices representing the original clusters will be equal to\n          the number of edges between the members of those clusters in the\n          original graph.\n\n        @return: the new graph.\n        '
    result = self.graph.copy()
    result.contract_vertices(self.membership, combine_vertices)
    if (combine_edges != False):
        result.simplify(combine_edges=combine_edges)
    return result