|
|
@ -2,7 +2,7 @@
|
|
|
|
"cells": [
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 1,
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
@ -130,11 +130,12 @@
|
|
|
|
"outputs": [],
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"source": [
|
|
|
|
"# define v as the probability vector of size n x 1, where n is the number of nodes in the graph. The vector is filled with 1/n\n",
|
|
|
|
"# define v as the probability vector of size n x 1, where n is the number of nodes in the graph. The vector is filled with 1/n\n",
|
|
|
|
"# https://en.wikipedia.org/wiki/Probability_vector\n",
|
|
|
|
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"v = sp.sparse.lil_matrix((n,1))\n",
|
|
|
|
"v = sp.sparse.lil_matrix((n,1))\n",
|
|
|
|
"for i in range(n):\n",
|
|
|
|
"for i in range(n):\n",
|
|
|
|
" v[i] = 1/n "
|
|
|
|
" v[i] = 1/n \n",
|
|
|
|
|
|
|
|
"\n",
|
|
|
|
|
|
|
|
"# maybe I could have done it with a lambda more concisely? idk"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|