bw2analyzer.page_rank#

Exceptions#

ConvergenceError

Common base class for all non-exit exceptions.

Classes#

Module Contents#

exception bw2analyzer.page_rank.ConvergenceError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

class bw2analyzer.page_rank.PageRank(database)[source]#
calculate()[source]#
page_rank(technosphere, alpha=0.85, max_iter=100, tol=1e-06)[source]#

Return the PageRank of the nodes in the graph.

Adapted from http://networkx.lanl.gov/svn/networkx/trunk/networkx/algorithms/link_analysis/pagerank_alg.py

PageRank computes a ranking of the nodes in the graph G based on the structure of the incoming links. It was originally designed as an algorithm to rank web pages.

The eigenvector calculation uses power iteration with a SciPy sparse matrix representation.

Parameters:
  • technosphere (*) – The technosphere matrix.

  • alpha (*) – Damping parameter for PageRank, default=0.85

Returns:

  • Dictionary of nodes (activity codes) with value as PageRank

References

database[source]#