networkx/networkx — pull request #1307 by jfinkels (2014-12-16 00:55:10+00:00)
Title: Adds a graph power operation.

This adds the `networkx.algorithms.operators.product.pow` function, which
computes a power of a given a graph. If SciPy is available, this
function computes the power of the adjacency matrix of the graph. If
SciPy is not available, it falls back to a naive (and slow)
exponentiation-by-squaring implementation using only the graph
primitives provided by NetworkX.