(self, clusters=None, directed=True, weights=None)
return VertexDendrogram(
            self, merges, clusters, modularity_params=dict(weights=weights)
        )
Community structure based on the betweenness of the edges in the
        network.

        The idea is that the betweenness of the edges connecting two
        communities is typically high, as many of the shortest paths between
        nodes in separate communities go through them. So we gradually remove
        the edge with the highest betweenness and recalculate the betweennesses
        after every removal. This way sooner or later the network falls of to
        separate components. The result of the clustering will be represented
        by a dendrogram.

        @param clusters: the number of clusters we would like to see. This
          practically defines the "level" where we "cut" the dendrogram to
          get the membership vector of the vertices. If C{None}, the dendrogram
          is cut at the level which maximizes the modularity when the graph is
          unweighted; otherwise the dendrogram is cut at at a single cluster
          (because cluster count selection based on modularities does not make
          sense for this method if not all the weights are equal).
        @param directed: whether the directionality of the edges should be
          taken into account or not.
        @param weights: name of an edge attribute or a list containing
          edge weights.
        @return: a L{VertexDendrogram} object, initally cut at the maximum
          modularity or at the desired number of clusters.
Community structure based on the betweenness of the edges in the
        network.
Community structure based on the betweenness of the edges in the network .
def community_edge_betweenness(self, clusters=None, directed=True, weights=None):
        """Community structure based on the betweenness of the edges in the
        network.

        The idea is that the betweenness of the edges connecting two
        communities is typically high, as many of the shortest paths between
        nodes in separate communities go through them. So we gradually remove
        the edge with the highest betweenness and recalculate the betweennesses
        after every removal. This way sooner or later the network falls of to
        separate components. The result of the clustering will be represented
        by a dendrogram.

        @param clusters: the number of clusters we would like to see. This
          practically defines the "level" where we "cut" the dendrogram to
          get the membership vector of the vertices. If C{None}, the dendrogram
          is cut at the level which maximizes the modularity when the graph is
          unweighted; otherwise the dendrogram is cut at at a single cluster
          (because cluster count selection based on modularities does not make
          sense for this method if not all the weights are equal).
        @param directed: whether the directionality of the edges should be
          taken into account or not.
        @param weights: name of an edge attribute or a list containing
          edge weights.
        @return: a L{VertexDendrogram} object, initally cut at the maximum
          modularity or at the desired number of clusters.
        """
        merges, qs = GraphBase.community_edge_betweenness(self, directed, weights)
        if qs is not None:
            qs.reverse()
        if clusters is None:
            if qs:
                clusters = qs.index(max(qs)) + 1
            else:
                clusters = 1
        return VertexDendrogram(
            self, merges, clusters, modularity_params=dict(weights=weights)
        )
def community_edge_betweenness ( self , clusters = None , directed = True , weights = None ) : merges , qs = GraphBase . community_edge_betweenness ( self , directed , weights ) if qs is not None : qs . reverse ( ) if clusters is None : if qs : clusters = qs . index ( max ( qs ) ) + 1 else : clusters = 1 return VertexDendrogram ( self , merges , clusters , modularity_params = dict ( weights = weights ) )