Skip to content

Instantly share code, notes, and snippets.

@bmtgoncalves
Created October 4, 2016 08:06
Show Gist options
  • Save bmtgoncalves/0bb4532ea9decb39b0c2e8e62cde83fb to your computer and use it in GitHub Desktop.
Save bmtgoncalves/0bb4532ea9decb39b0c2e8e62cde83fb to your computer and use it in GitHub Desktop.
# Perform the power method for "iter" iterations
def Power_Method(G, iter):
N = G.shape[0]
x0 = np.ones(N)/N
for i in range(iter):
x0 = np.dot(G, x0)
return x0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment