How to Create Simple Dynamic Graphs in Gephi
In a previous post, I walked through the basics on how to import a network into Gephi using a spreadsheet. As shown, this is an easy way to import data into Gephi in the form of a list of edges. As mentioned before, this method is also ideal if you’re working with external sources (e.g. data exported from a Python file).
The ability to import custom spreadsheets is incredibly handy and is just one of many useful features that Gephi has to offer. Additionally, another feature of Gephi, which is also useful, is the ability to work with dynamic graphs.
Many networks, especially social networks, are temporal in meaning that they can be thought of as a series of interactions over time. Interactions (edges) can also be represented with timestamps to indicate when the interaction took place and who was involved in said interaction.
Using the same process as before, in this blog post, I will cover the basics for importing and configuring a dynamic graph from a spreadsheet. In this example, edges are marked with timestamps.
Getting Started
In order to follow along with this guide, you will need to ensure that the timestamp uses the ISO format as this is the conversation and Gephi should detect it automatically. Feel free to call the timestamp column whatever you like. Gephi will know which one to use.
When importing the spreadsheet, Gephi will treat it as a “TimestampSet” as shown below. Also, make sure that under “Time representation” the value is set to “Timestamps” not “Intervals”. The difference between the two is that intervals are relative to a start point and are used to represent the duration of an edge (e.g. number of seconds).
Enable Timeline
As soon as the spreadsheet has been imported, Gephi should automatically detect that you’re working with a dynamic graph and will show the “Enable Timeline” feature at the bottom of the window. Go ahead and click it.
Once clicked, Gephi will populate the timeline with a series of dates which are bound to the minium and maximum date range in the dataset. By default, the dates are a little hard to read as they overlap each other. This can be adjusted by selecting the appropriate format.
Configuring Date Formats
To configure the date format to make it a little more readable, click the gear icon in the bottom left-hand corner and select “Set time format…”
When clicked, a new dialogue will appear. Select “Datetime”.
As a result, this will change the date format of the timeline, so it is a little less crowded (see below). In my case the “38” represents the 38-min mark in my small dataset.
You can now set a custom bounds by dragging the greyed out window to a smaller size. Anything within the window will be displayed. When animated over time (by clicking the play button), it will show edges arriving and disappearing as the window slides across the timeline.
Conclusions
In this blog post, I covered the basics for importing and configuring dynamic graphs (temporal networks) in Gephi. This post just covers the basics and there are more advanced settings that can be configured. This could end up being featured in a future blog post. For the purposes of this blog post, I wanted to keep things simple and just cover the essentials.