Skip to content

Commit

Permalink
merge Dev -> default
Browse files Browse the repository at this point in the history
  • Loading branch information
clstaudt committed Aug 22, 2014
2 parents 2128719 + fa64bda commit b9e972f
Show file tree
Hide file tree
Showing 506 changed files with 37,551 additions and 3,731 deletions.
Binary file modified Doc/DevGuide.pdf
Binary file not shown.
97 changes: 76 additions & 21 deletions Doc/Notebooks/GephiStreaming_UserGuide.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:7dd498ea7bdbffe648d79d65aa8f29c7f7e53c6947149e89e3b79ec603e77306"
"signature": "sha256:8123937250bf21879bda6c35b03a1e15e279a5c42aaf1f9e2366a463000071a7"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand All @@ -12,7 +12,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"from NetworKit import *"
"from networkit import *"
],
"language": "python",
"metadata": {},
Expand Down Expand Up @@ -68,12 +68,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
"G = generators.ErdosRenyiGenerator(300, 0.2).generate()"
"G = generators.ErdosRenyiGenerator(300, 0.2).generate()\n",
"G.addEdge(0, 1) #We want to make sure this specific edge exists, for usage in an example later."
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 3
"prompt_number": 4
},
{
"cell_type": "markdown",
Expand All @@ -91,8 +92,16 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 7
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Could not connect to the gephi streaming plugin. Did you start the streaming master server in gephi?\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
Expand Down Expand Up @@ -122,19 +131,19 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"PLM(balanced,) detected communities in 0.04398536682128906 [s]\n",
"PLM(balanced,,parallel coarsening) detected communities in 0.06624603271484375 [s]\n",
"solution properties:\n",
"------------------- ----------\n",
"# communities 5\n",
"min community size 29\n",
"max community size 82\n",
"avg. community size 60\n",
"modularity 0.0915229\n",
"# communities 8\n",
"min community size 23\n",
"max community size 54\n",
"avg. community size 37.5\n",
"modularity 0.0983793\n",
"------------------- ----------\n"
]
}
],
"prompt_number": 10
"prompt_number": 6
},
{
"cell_type": "code",
Expand All @@ -144,8 +153,16 @@
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 11
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Could not connect to the gephi streaming plugin. Did you start the streaming master server in gephi?\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
Expand All @@ -159,34 +176,72 @@
"level": 3,
"metadata": {},
"source": [
"Changing the server URL"
"Exporting edges values"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By default, the streaming client in NetworKit connects to http://localhost:8080/workspace0, i.e. the first workspace of the local gephi instance. One might want to connect to a gephi instance running on a remote host or change the used port (this can be done in gephi by selecting \"Settings\" within the Streaming tab). To change the url in NetworKit, simply pass it upon the creation of the client object:"
"Just like node values, we can export edge values. After graph creation, each edge is assigned an integer id that is then used to access arbitrary attribute vectors, so any python list can be exported to gephi. In the following example, we assign an even number edge and export that attribute to gephi."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"client = gephi.streaming.GephiStreamingClient(url='http://localhost:8080/workspace0')"
"edgeAttribute = [2*x for x in range(0, G.upperEdgeIdBound())]\n",
"client.exportEdgeValues(G, edgeAttribute, \"myEdgeAttribute\")"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 9
"prompt_number": 21
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Edge ids an easily be retrieved using the edgeId(u, v) method in graph. Let's change of one edge and export the attribute again."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"input": [
"edgeAttribute[G.edgeId(0, 1)] = 1\n",
"client.exportEdgeValues(G, edgeAttribute, \"myEdgeAttribute\")"
],
"language": "python",
"metadata": {},
"outputs": []
"outputs": [],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Changing the server URL"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By default, the streaming client in NetworKit connects to http://localhost:8080/workspace0, i.e. the first workspace of the local gephi instance. One might want to connect to a gephi instance running on a remote host or change the used port (this can be done in gephi by selecting \"Settings\" within the Streaming tab). To change the url in NetworKit, simply pass it upon the creation of the client object:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"client = gephi.streaming.GephiStreamingClient(url='http://localhost:8080/workspace0')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 9
}
],
"metadata": {}
Expand Down
865 changes: 808 additions & 57 deletions Doc/Notebooks/NetworKit_UserGuide.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit b9e972f

Please sign in to comment.