Get startedGet started for free

Directed networks

1. Directed networks

2. Directionality

So far in this course we have been considering networks that are undirected. This means that the edges between vertices do not have a direction associated with them. The edges in undirected networks simply indicate that a relationship of some kind exists between two vertices. However, in many networks edges do have directionality. In such directed networks, an arrow represent an edge going from one vertex to another vertex. An example of a directed graph is a network of email exchanges. Each edge would represent one individual sending an email to a recipient. In the example here, A receives four edges and has one outgoing edge to E.

3. Examining the igraph object

Using igraph, it is relatively straightforward to determine if our network object is directed or undirected. When calling the graph object, the first digit after "IGRAPH" in the output will be a "U" if it is undirected or a "D" if it is directed. Also in directed networks, the edges listed at the end of the object will have arrows indicating their directionality.

4. Checking igraph objects

It is also possible to test if a network is directed by using the function is-dot-directed() on the igraph object. This will return either TRUE or FALSE. Similarly, it is possible to determine if the network is weighted using is-dot-weighted().

5. In-degree and out-degree

One reason for using network analysis is to identify which vertices are more important or influential to the overall network. The simplest measure of vertex influence is degree. In undirected networks the total degree of a vertex is simply how many edges that vertex has. In directed networks, vertices have out-degree and in-degree. The out-degree of a network represents how many out-going edges a vertex has. The in-degree represents how many incoming edges each vertex has. In our example network of email exchanges, A has an in-degree of four as it receives email from four other vertices. F has an out-degree of three as they send emails to 3 other vertices.

6. Identifying edges in igraph objects

In igraph there are several methods for determining if edges exist between vertices, and if they do what direction they are. You can test if an edge exists between any two vertices using square brackets notation. A '1' is returned if a directed edge is present. You can show all edges to or from a vertex using incident, naming the vertex of interest with the second argument. The third argument - mode equals 'all' - indicates that you want to see all edges - both incoming and outgoing. You can also find the vertices that edges originate from using head_of(). In this example, the second argument is E(g) to indicate finding the origin of all edges in the network.

7. Let's practice!

Now it's up to you. In this section you will be exploring directed graphs in more detail. The example network you will use is of a severe measles outbreak that spread through the town of Hagelloch, Germany, in 1861, affecting 188 children. Each edge represents the transmission of measles from one individual to the next.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.