1. Create an influence network by combining communication and superior-subordinate ties, some of which are reciprocal (1 Point).

Hint: The easiest thing to do may be to extract the communication relations and superior-subordinate relations into separate CSV files (say, communication.csv and superior-subordinate.csv) and then load and create an influence network from the data as follows:

# load igraph package
library(igraph)
## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
#load data
communication <-as.matrix(read.csv("communication.csv", header = T, row.names = 1))
colnames(communication) <-c(1:445)

superior_subordinate <-as.matrix(read.csv("superior-subordinate.csv", header = T, row.names = 1))
colnames(superior_subordinate) <-c(1:445)

# create an influence network by combining communication and superior-subordinate ties
influence <- communication + superior_subordinate

# create a directed network
g <-graph.adjacency(influence, mode="directed")

# get rid of isolates
iso <-V(g)[degree(g)==0]

# create new directed network without isolates
g <-delete.vertices(g, iso)

#Plot influence network
plot(g, vertex.size=8, vertex.color="skyblue", vertex.label.cex=0.6, vertex.label.color="black",
     edge.arrow.size=0.4, layout = layout_with_fr, main = "Influence network of FARC TFMC")

2.Analyze the influence network and plot the network clearly identifying: 1. Plot the network showing the articulation points

Hint: Section 6 of lesson 9 has an example on how to determine articulation points. Removal of which actors would disrupt the network most?

g.ap <- articulation.points(g)
cat("Articulation points: ", V(g)$name[g.ap], "\n")
## Articulation points:  4 347 342 146 46 41 429 302 223 332 119 393 100 403

The network has an articulation point consisting of the actor ‘4, 34, 342, 146, 46, 41, 429, 302, 223, 332, 119, 393, 100, 403.’ If we were to remove these actors, then the network would split.

g1 <- delete.vertices(g, g.ap)
plot(g1)

g.ap1 <- articulation.points(g)
cat("Articulation points: ", ifelse((length(V(g)$name[g.ap]) == 0),"none", V(g)$name[g.ap]), "\n")
## Articulation points:  4
g2 <- delete.vertices(g, g.ap1)
plot(g2)

2. Plot the network showing biconnected components

Hint: Section 6 of lesson 9 has an example on how to determine biconnected components. Which is the largest biconnected component that has no single actor whose removal would disconnect the network?

g.bc <- biconnected.components(g)
cat("Number of biconnected components: ", g.bc$no, "\n")
## Number of biconnected components:  66

You can determine the largest biconnected component as follows:

#determine the largest component
lc <- which.max(sapply(g.bc$components, length))

#color the actors of the largest component salmon and the rest skyblue
V(g)$color <- "skyblue"
V(g)[g.bc$components[[lc]]]$color <- "salmon"

#plot the network
plot(g, vertex.size=10, vertex.label.cex=0.6, vertex.label.color="black", edge.arrow.size=.4, layout=layout_with_fr, main ="FARC TFMC Biconnected Components")

You can try to delete any of the actors from this biconnected component and see if it disrupts the network.

g3 = delete.vertices(g, "223") %>%
  delete_vertices("44")
plot(g3)

  1. Plot the network showing key players that would fragment the network most

Hint: Section 6 of lesson 9 has an example on how to determine key players. How will the network look if these key players are removed?

library(keyplayer)
## Warning: package 'keyplayer' was built under R version 3.5.3
## 
## Attaching package: 'keyplayer'
## The following object is masked from 'package:igraph':
## 
##     contract
g.matrix <- as.matrix(get.adjacency(g))
g.fragment <- kpset(g.matrix, size = 6, type = "fragment")
V(g)$color <- "skyblue"
V(g)$color[g.fragment$keyplayers] <- "salmon"
plot(g, mark.groups=g.fragment$keyplayers, mark.col=NA, mark.border="black")

If the key player actors are removed, the network will be reduced to minimal structure.

plot(delete.vertices(g, g.fragment$keyplayers))

4. Plot the network visualizing structural holes by displaying how constrained the actors are in the network.

Hint: Section 6 of lesson 9 has an example on how to determine structural holes. What happens when the least constrained actors are removed? The network has smaller nodes which has higher brokerage potential. It is less constrained.

g.constraint <- constraint(g)
plot(g, vertex.size = 7*g.constraint)