def __init__(self, graph, merges, optimal_count=None, params=None, modularity_params=None):
    'Creates a dendrogram object for a given graph.\n\n        @param graph: the graph that will be associated to the clustering\n        @param merges: the merges performed given in matrix form.\n        @param optimal_count: the optimal number of clusters where the\n          dendrogram should be cut. This is a hint usually provided by the\n          clustering algorithm that produces the dendrogram. C{None} means\n          that such a hint is not available; the optimal count will then be\n          selected based on the modularity in such a case.\n        @param params: additional parameters to be stored in this object.\n        @param modularity_params: arguments that should be passed to\n          L{Graph.modularity} when the modularity is (re)calculated. If the\n          original graph was weighted, you should pass a dictionary\n          containing a C{weight} key with the appropriate value here.\n        '
    Dendrogram.__init__(self, merges)
    self._graph = graph
    self._optimal_count = optimal_count
    if (modularity_params is None):
        self._modularity_params = {}
    else:
        self._modularity_params = dict(modularity_params)
Creates a dendrogram object for a given graph.

@param graph: the graph that will be associated to the clustering
@param merges: the merges performed given in matrix form.
@param optimal_count: the optimal number of clusters where the
  dendrogram should be cut. This is a hint usually provided by the
  clustering algorithm that produces the dendrogram. C{None} means
  that such a hint is not available; the optimal count will then be
  selected based on the modularity in such a case.
@param params: additional parameters to be stored in this object.
@param modularity_params: arguments that should be passed to
  L{Graph.modularity} when the modularity is (re)calculated. If the
  original graph was weighted, you should pass a dictionary
  containing a C{weight} key with the appropriate value here.
def __init__(self, graph, merges, optimal_count=None, params=None, modularity_params=None):
    'Creates a dendrogram object for a given graph.\n\n        @param graph: the graph that will be associated to the clustering\n        @param merges: the merges performed given in matrix form.\n        @param optimal_count: the optimal number of clusters where the\n          dendrogram should be cut. This is a hint usually provided by the\n          clustering algorithm that produces the dendrogram. C{None} means\n          that such a hint is not available; the optimal count will then be\n          selected based on the modularity in such a case.\n        @param params: additional parameters to be stored in this object.\n        @param modularity_params: arguments that should be passed to\n          L{Graph.modularity} when the modularity is (re)calculated. If the\n          original graph was weighted, you should pass a dictionary\n          containing a C{weight} key with the appropriate value here.\n        '
    Dendrogram.__init__(self, merges)
    self._graph = graph
    self._optimal_count = optimal_count
    if (modularity_params is None):
        self._modularity_params = {}
    else:
        self._modularity_params = dict(modularity_params)