diff --git a/demo/Centrality.ipynb b/demo/Centrality.ipynb
index c72fccd..ffa1a68 100644
--- a/demo/Centrality.ipynb
+++ b/demo/Centrality.ipynb
@@ -9,53 +9,645 @@
"Here are some centrality algorithms with pygraphblas. The first few graphs are of the Zachary Karate graph, and the benchmarks at the end benchmark numerious large SNAP graphs with these algorithms."
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Karate Graph"
+ ]
+ },
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
- "text/html": [
- ""
+ "image/svg+xml": [
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
],
"text/plain": [
- ""
+ ""
]
},
+ "execution_count": 7,
"metadata": {},
- "output_type": "display_data"
+ "output_type": "execute_result"
}
],
"source": [
- "# go widescreen\n",
- "\n",
- "from IPython.core.display import display, HTML\n",
- "display(HTML(\"\"))"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Karate Graph"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "scrolled": false
- },
- "outputs": [],
- "source": [
- "%pdb\n",
"from timeit import repeat\n",
"from pygraphblas import *\n",
"from pygraphblas.gviz import *\n",
"from random import sample\n",
"\n",
- "karate = list(Matrix.ssget('Newman/karate'))[-1][1]\n",
+ "karate = dict(Matrix.ssget('Newman/karate'))['karate.mtx'].cast(FP32)\n",
"\n",
"# get one-based lables\n",
"labels1 = karate.cast(INT64).positioni1().reduce_vector(INT64.any_monoid)\n",
@@ -71,7 +663,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
@@ -93,616 +685,616 @@
"\n",
"\n",
- "\n",
"\n",
"\n"
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 3,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
@@ -726,7 +1318,7 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 9,
"metadata": {},
"outputs": [
{
@@ -748,616 +1340,616 @@
"\n",
"\n",
- "\n",
"\n",
"\n"
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 4,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
@@ -1400,10 +1992,8 @@
},
{
"cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "scrolled": false
- },
+ "execution_count": 10,
+ "metadata": {},
"outputs": [
{
"name": "stderr",
@@ -1420,616 +2010,616 @@
"\n",
"\n",
- "\n",
"\n",
"\n"
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 5,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
@@ -2054,7 +2644,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 11,
"metadata": {},
"outputs": [
{
@@ -2080,616 +2670,616 @@
"\n",
"\n",
- "\n",
"\n",
- "