docs: def algorithm(G, method_name, **kwargs):
      """
      Apply a ``method`` from NetworkX to all :ref:`networkx.Graph <networkx:graph>` objects in the
      :class:`.GraphCollection` ``G``.
      
      For options, see the `list of algorithms
      <http://networkx.github.io/documentation/networkx-1.9/reference/algorithms.html>`_
      in the NetworkX documentation. Not all of these have been tested.
  
      Parameters
      ----------
      G : :class:`.GraphCollection`
          The :class:`.GraphCollection` to analyze. The specified method will be
          applied to each graph in ``G``.
      method_name : string
          Name of a method in NetworkX to execute on graph collection.
      **kwargs
          A list of keyword arguments that should correspond to the parameters
          of the specified method.
  
      Returns
      -------
      results : dict
          Indexed by element (node or edge) and graph index (e.g. ``date``).
  
      Raises
      ------
      ValueError
          If no such method exists.
  
      Examples
      --------
  
      *Betweenness centrality:* (``G`` is a :class:`.GraphCollection`\)
  
      .. code-block:: python
  
         >>> from tethne.analyze import collection
         >>> BC = collection.algorithm(G, 'betweenness_centrality')
         >>> print BC[0]
         {1999: 0.010101651117889644,
         2000: 0.0008689093723107329,
         2001: 0.010504898852426189,
         2002: 0.009338654511194512,
         2003: 0.007519105636349891}
  
      """
      warnings.warn("To be removed in 0.8. Use GraphCollection.analyze instead.",
                    DeprecationWarning)
  
      return G.analyze(method_name, **kwargs)