Sunday 30 June 2019

Gephi: How to create a data set?


There are two basic entities in a graph.
a.   Nodes
b.   Edges

Edges are used to connect nodes. Edges can be directed (or) undirected.

How to create a data set in Gephi?
The simplest approach is to use ‘Data Laboratory’ widget. ‘Data Laboratory’ widget provides widgets to define nodes and edges manually.

Can I append records to the imported data using ‘Data Laboratory’ widget?
Yes, you can append new records to already imported data.

Below step-by step procedure explains how to add new data set.

Step 1: Open Gephi user interface.

Step 2: File -> New Project


It opens new workspace. Go to Data Laboratory view.

Once you click on ‘Data Laboratory’ view, the interface expands like below.





Step 3: We need to open Data Table now.

Window -> Data Table.



Once you click on Data Table widget, it shows multiple options to create node, edge.


Step 4: Add a node
Click on ‘Add node’ button to add new node.

When I click on ‘Add node’ button, it opens a text box and asking for the label associated with this node.


I had given name as ‘Chicago’.

In the same way I created 4 more nodes to represent other 4 cities Detroit, Boston, New York, Philadelphia.

You can able to see all the created node in the nodes tab.


Step 5: Adding edges
Click on ‘Add edge’ button to add new edge. When you click on ‘Add edge’ button it opens below kind of window.

Select the source node and target node, press Ok.


As you see the graph, there are two options to select the type of edge.
         a. Directed: It represents one directional edge
         b. Undirected: It represents two directional edge.

In the same way, I added some more edges between the cities. You can see all the edges of the graph under ‘Edges’ tab.


Step 6: Let’s see how the graph looks like.

Go to ‘Overview’ tab. If the graph window is not visible, Window -> Graph.

Graph looks like below.

Click on ‘T’ widget, to display node labels. After clicking on ‘T’ widget, the graph is redrawn like below.


That’s it you are done with your first data set creation. One problem with this approach is, it is cumbersome to define big data sets using 'Data Laboratory' widget. We can solve this problem, by exporting excel (or) spread sheet data into Gephi. My next post explains about this.

Previous                                                 Next                                                 Home

No comments:

Post a Comment