Graph-data models with Gephi

Gephi should be run on your native hardware, not in the Cloudera VM. Instructions for downloading, installing, and running Gephi can be found at https://gephi.org/users/install. Let's have a look at the following steps:

  1. Download and import the CSV file. The data used in this example is in CH05/graph/diseaseGraph.csv.
  2. Click on File, and choose Save as to download the file.

In Gephi, click on File, and choose Import spreadsheet...:

Figure 5.7: Go to File and then choose Import spreadsheet

In the Import spreadsheet... dialog, click on ... to choose the CSV file:

In the File dialog, choose the diseaseGraph.csv file you downloaded:

In the dialog, make sure As the table is set to Edges table:

Click Next, and then click Finish to import the CSV data into Gephi.

  1. Examine the graph properties. In the middle pane, Gephi displays the graph. The black circles are the nodes, and the lines between them are the edges:

If you place the mouse on a node, Gephi will highlight the nodes that are connected to it, as follows:

In the top-right corner is the Context pane, which says that the graph has 777 nodes and 998 edges:

  1.  Perform statistical operations. 

Under the Context pane is the Statistics pane, where you can perform various statistical calculations. We can calculate the average degree by clicking on Run next to Average Degree:

The dialog that pops up says that the average degree is 2.569. Click on Close to close the dialog.

We can calculate the connected components by clicking on Run next to Connected Components: This will present a dialog box with a title of Connected Components settings and ask for either Directed or Undirected calculations.

The resulting dialog says there are five weakly-connected components and 761 strongly-connected components. Click Close to close the dialog.

  1. Run layout algorithms. 

Gephi can perform different layout algorithms on the graph. In the Layout pane on the bottom-left, click on the ---Choose a layout combo box, select Force Atlas, and click on the Run button:

Gephi will change the layout of the graph, and then after some time, click on the Stop button:

In this layout, strongly-connected nodes are clustered together, and we can also see several clusters that are disconnected from the rest of the graph.

In the Layout combo box, select Fruchterman Reingold and click on the Run button:

The graph layout will change to make the nodes evenly spaced. After the graph stops moving, click on the Stop button, and then on the magnifying glass icon in the middle-left bottom to center the graph:

In this layout, we can better see which nodes have a lot of edges:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.21.47