(self, weights=None, steps=4)
return VertexDendrogram(
            self, merges, optimal_count, modularity_params=dict(weights=weights)
        )
Community detection algorithm of Latapy & Pons, based on random
        walks.

        The basic idea of the algorithm is that short random walks tend to stay
        in the same community. The result of the clustering will be represented
        as a dendrogram.

        @param weights: name of an edge attribute or a list containing
          edge weights
        @param steps: length of random walks to perform

        @return: a L{VertexDendrogram} object, initially cut at the maximum
          modularity.

        @newfield ref: Reference
        @ref: Pascal Pons, Matthieu Latapy: Computing communities in large
          networks using random walks, U{http://arxiv.org/abs/physics/0512106}.
Community detection algorithm of Latapy & Pons, based on random
        walks.
Community detection algorithm of Latapy & Pons based on random walks .
def community_walktrap(self, weights=None, steps=4):
        """Community detection algorithm of Latapy & Pons, based on random
        walks.

        The basic idea of the algorithm is that short random walks tend to stay
        in the same community. The result of the clustering will be represented
        as a dendrogram.

        @param weights: name of an edge attribute or a list containing
          edge weights
        @param steps: length of random walks to perform

        @return: a L{VertexDendrogram} object, initially cut at the maximum
          modularity.

        @newfield ref: Reference
        @ref: Pascal Pons, Matthieu Latapy: Computing communities in large
          networks using random walks, U{http://arxiv.org/abs/physics/0512106}.
        """
        merges, qs = GraphBase.community_walktrap(self, weights, steps)
        qs.reverse()
        if qs:
            optimal_count = qs.index(max(qs)) + 1
        else:
            optimal_count = 1
        return VertexDendrogram(
            self, merges, optimal_count, modularity_params=dict(weights=weights)
        )
def community_walktrap ( self , weights = None , steps = 4 ) : merges , qs = GraphBase . community_walktrap ( self , weights , steps ) qs . reverse ( ) if qs : optimal_count = qs . index ( max ( qs ) ) + 1 else : optimal_count = 1 return VertexDendrogram ( self , merges , optimal_count , modularity_params = dict ( weights = weights ) )