[Networkit] Gephi Support

Maximilian Vogel uocvf at student.kit.edu
Fri Jun 6 10:04:08 CEST 2014


Dear developers and users,

a new Python module has been added in the Dev branch. The module "gephi" 
provides methods so Gephi can be used with data calculated by NetworKit.

In the following workflow, the method "gephi.exportNodeValues()" will be 
utilized to color the nodes in a Gephi project according to the 
NetworKit community detection.

Python Workflow:
In [1]: g = readGraph("path/to/desired.graph")
In [2]: communities = community.detectCommunities(g)
In [3]: 
gephi.exportNodeValues(communities,"/path/to/file/communities.csv","community")
# exportNodeValues(values, fpath, column_name) expects 3 parameters:

  * values: the object containing the node values (can be a python list
    or a Partition object)
  * fpath: file to be written to
  * column_name: name of the column/description of the data

In [4]: writeGraph(g,"/path/to/file/pgp.dot.txt","dot")
# To ensure that the node IDs of the graph file and the data file match, 
it is recommended to write the graph to a file from NetworKit aswell. 
Currently, this should be done in the GraphViz/DOT file format.

Gephi Workflow:

 1. Read the previously exported graph in a new project.
 2. Go to the "Data Laboratory"
 3. There, use the "Import Spreadsheet" button and specify the data file.
     1. Under Import Settings you can specify the data type for the
        values. (This might be important for floating point values, e.g.
        betweenness centrality.)
 4. Return to the "Overview". On the left side under the panel
    "Partition" below "Nodes" you should press the green Arrows to
    update the data. Gephi now suggest colors for the community data, so
    you only need to press "Apply".


If you are experienced with Gephi, have some suggestions (e.g. to make 
this process easier) or if you encounter any issues, feel free to 
contact me.


Regards,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20140606/d7baadb4/attachment.html>


More information about the NetworKit mailing list