Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

This is the third set of exercises on networks in which we practice the functions for graph structure, using package igraph. The first and second part are available here:

If you have different solution, feel free to post it.

A number of employees in a factory was interview on question: “Do you like to work with your co-worker?”. Possible answers are 1 for yes and 0 for no. Each employee gave answer for each other employee thus creating adjacency matrix. You can download data set from here.

Exercise 1

Load the data and create un-directed graph from adjacency matrix. Name nodes as letters A to Y. Set node color to orange and shape to square. Set edge’s color to blue and arrow size to 0.2. Plot the graph.

Exercise 2

Find the largest cliques in the group.

Exercise 3

How many maximal cliques are there?

Exercise 4

Calculate the network cohesion.

Exercise 5

Find the clusters based on betweenness.

Exercise 6

Find the components of a graph.

Exercise 7

Find the loop edges.

Exercise 8

How many triangles are there in the graph? In how many of them is vertex S included?

Exercise 9

What is the global clustering coefficient of this network? Can we say that clustering is statistically significant for this network.Tip: in order to determine if clustering coefficient is significant, it should be much larger than the random network with the same number of vertices and edges.

Exercise 10

Create and draw the following types of networks:

Random with 10 nodes and probability of an edge of 0.4 (Erdos-Renyi random graph)

Full un-directed graph with 15 nodes

Star network with 20 nodes

Directed ring network with 15 nodes and mutual edges

Related

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.