An Introduction to Gephi

Tutorial by Ian Milligan (University of Waterloo)


This is a very basic introduction to Gephi. It begins with the assumption of no knowledge around Gephi, and explains how you can import the file you receive from AUK and do some basic transformations on it yourself.

While your graphs have some basic characteristics computed for them, you may want to start from fresh and learn some of the basics.

Back to Top

Getting Started: Importing Data

This tutorial explores what you can learn from the derivative file marked as "Gephi" or "Raw Network" in your collections page. You can find this by selecting the Gephi or Raw Network derivative. See the screenshot below:

The derivative download buttons with the Gephi one highlighted

The first step is to download and install Gephi, which you can find here.

Upon opening the Gephi application, you want to select “Open a Graph File...” and select the GEXF file that you have downloaded from AUK.

The opening page for the Gephi application

You then want to click 'ok' on the next page. You can see in the sample data that you have a network with 125 nodes (or domains) with 200 edges (or links between those domains).

Back to Top

Basic Graph Layouts

The import page for the Gephi application

You'll now see the following basic layout in the Overview tab. Not too useful, is it? Let's begin by creating a new layout, which you'll see highlighted here below:

A basic layout in Gephi

Select the layout tab at left, and select "Yifan Hu Proportional." Leave the values default, but you can begin to play with the figures and see what it does. To lay the graph out, click the "run" button.

The following image shows what this looks like after clicking "run" on the default visualization.

A Yifan-Hu layout in Gephi

Let's add some labels so we can see what this all means. Click on the "T" button below the graph, which is highlighted below. You'll then see lots of labels. It is not too readable - don't worry, we will deal with that shortly.

Labels added to the graph

The next step is to resize the nodes (domains) based on a characteristic. Let's make them bigger based on how many times they are linked to. This is called "in-degree" in Gephi.

This can sometimes be a bit challenging to find in the Gephi interface! In the "Appearance" window at left, click on the "size" icon, select "ranking," and then select "In-Degree" with a min sie of 3 and a max size of 40. Then click "Apply."

If the above is confusing, look at the screenshot below and try to reproduce what you see there.

Resizing nodes

Now let's do the same for label size: the bigger the label, the more it is linked to; the smaller the label, the less it is linked to. You then want to click on the "text size" icon, select "Ranking," and then select "In-Degree." Let's do a min size of 0.1 and a max size of 3. If this is confusing, again try to recreate what you see in the screenshot below.

Resizing labels

Some of the labels now overlap, so let's run another simple "layout." This time, we select "Label Adjust" and press run.

Label adjust

We now have a pretty decently laid out network!

Back to Top

Applying a Statistical Analysis

Now let's run a statistical analysis. We'll run a rudimentary community detection algorithm. We can find that in the "statistics" section on the right hand side. Click the "run" button next to modularity, and click through the next report. The two following screenshots show you where to look.

Modularity class one Modularity class two

The final step is to apply the modularity categories to the graph. Let's colour the nodes based on the community that they appear in.

To do so, go back to apperance. This time click the painter's palette, select "Partition," and then apply "Modularity Class." As before, try to recreate what you see in the screenshot below if it is confusing.

Applying modularity class to the table

At the end of this lesson, your graph should be looking quite a bit like this:

Final layout

Congratulations! You now have a nicely-laid out graph. Try experimenting with other features in Gephi now. If you want to see a fully-fleshed out example of using Gephi with research, please read on to the Network Graphing Archived Websites With Gephi lesson.

Back to Top