Creating Dynamic Networks in Gephi

I have been experimenting with Gephi again, with the aim of learning how to create a dynamic network (one which evolves over time). I have decided to turn my experiences into a tutorial, as it took me a while to create one. Furthermore, as a lot of the tutorials out there require you to code, I thought it best to show how to create one only using Microsoft Excel.

The first thing you will want to do is create your database. For the data in this tutorial, I am using my old undergraduate dissertation database on Cassiodorus’ Variae, though you will likely need to collect and input your data yourself. Networks consist of nodes and edges and you will need two separate sheets or documents in Excel to show these. Below you can see my nodes table. The crucial elements are the ID and the Label, Gephi will recognise these when you import the spreadsheet, and a column called ‘timeset’. The other columns, like gender and profession, are optional, but will become attributes you can analyse them in Gephi. In the ID column, assign a number to your nodes and label them in the next column, something that will allow you to identify them will be helpful in this instance. In the timeset column, enter the dates you want the node to exist for. If you want your node to exist, say, between 492 and 526, you must enter it the exact following format.

<[492.0, 526.0]>

Repeat this for the all nodes you want to assign a date, it will probably be useful to keep a note of start and end dates as you progress with the ID and Label columns, when you initially go through your data. A quick note- the dates I have entered for this example are for the purposes of the tutorial only, they are not meant to indicate the exact date the chosen individuals were around.

Next, you may want to assign a date to the edges (the links between nodes). If so, create a separate sheet or even document for the edges table. The easiest format for Gephi to recognise is a source-target table. In its simplest form, it involves a source (the first node in a connection), a target (the other node in a connection) and a weight (a measurement of the strength of a connection). The source and target should be the IDs you assigned in the nodes table. The fourth column should be named ‘timeset’ and again include the dates of a edge in the same format used for the nodes. You may find it useful to have a ‘source label’ and ‘target label’ column on this document. While not required (I have deleted them for the image below because of this), they can help you keep track of who is connecting to who, Gephi should treat them as attributes and so it should not alter the network itself.

You will now want to import your spreadsheets into Gephi. Firstly, click on data laboratory and then import spreadsheet. A box should appear which allows you to browse your files, click on your nodes table to import it to Gephi. An ‘import settings’ window should now open. On the first screen (below) make sure the nodes sheet is selected and that you have chosen import as ‘nodes table’. Click next and a second screen should appear. The next step is crucial, where it says ‘time representation’, make you click intervals. This should cause the box under the ‘timeset’ label to say ‘intervalset’. After this you can click ‘finish.’ Then another screen should appear and you should choose to append the imported data to the existing workspace.

Repeat the steps above, except this time import your edges data. Make sure import as edges table is selected and then on the second screen make sure interval is selected again. Finally, append the table to the existing ‘workspace’.

Go on overview and you should be able to seed your graph, with the nodes connected by the edges. I would then suggest running a layout algorithm to make your graph easier to understand visually. I selected the ‘Yifan Hu’ algorithm, you can choose this by going through window and then layout and then selecting the algorithm on the drop down menu that appears to the left.

Finally, you will want to know how to enable the timeline which allows you to view how the network evolves over time. The image above clearly shows ‘enable timeline’ towards the bottom. Another way to access the timeline is to go on ‘window’ and then ‘timeline.’ A box should appear at the bottom with a draggable animation interval, use this to select how quickly you will view the network evolve.

The images below show my network evolving overtime.

I hope this tutorial has helped anyone wanting to create a dynamic graph, please let me know if you need any help or have suggestions for my instructions.