Skip to content

Instantly share code, notes, and snippets.

@mjbommar
Created July 30, 2009 20:01
Show Gist options
  • Save mjbommar/158891 to your computer and use it in GitHub Desktop.
Save mjbommar/158891 to your computer and use it in GitHub Desktop.
> A
V1 V2 V3 V4 V5 V6 V7
[1,] 0 1 1 1 0 0 0
[2,] 1 0 0 1 1 0 0
[3,] 0 1 0 0 0 1 0
[4,] 0 1 0 0 1 0 0
[5,] 0 1 0 0 0 0 0
[6,] 0 1 0 0 0 0 1
[7,] 0 0 0 0 0 0 0
> page.rank(graph.adjacency(A))$vector
[1] 0.12715804 0.35649046 0.05967351 0.16457621 0.19980159 0.04859509 0.04370510
> page.rank(graph.adjacency(t(A)))$vector
[1] 0.24766273 0.30798817 0.15198728 0.10514585 0.07378656 0.09200085 0.02142857
> g=igraph.Graph(e, directed=True)
> g.pagerank()
[0.24766273143186884,
0.30798816622244191,
0.15198727827695799,
0.10514584755310084,
0.073786559686386491,
0.092000845400672215,
0.021428571428571429]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment