Igraph to R: converting a bipartite graph to a single-mode communication network

Below is a toy dataset I created with igraph

Rstudio for a two-way network of terrorist criminals and their targets. The following specification is for directional bipartite communication between two types of vertices:

set.seed(1234)

 df <- data.frame(
     perpetrator <- c(
         'Armed Islamic Group (GIA)',
         'Armed Islamic Group (GIA)',
         'Algerian Islamic Extremists',
         'Islamic Salvation Front (FIS)',
         'Unindentified Activists',
         'Armed Islamic Group (GIA)',
         'Armata di Liberazione Naziunale (ALN)',
         'Armed Islamic Group (GIA)',
         'Islamist Extremists',
         'Muslim Fundamentalists'),
      target <- c(
         'Unnamed Civilians',
         'Unnamed Civilians',
         'Unnamed Civilians',
         'Government Buildings',
         'Police Station',
         'Soldiers',
         'Terrorist Group',
         'Unnamed Civilians',
         'Police Patrol',
         'Police Patrol'),
      stringsAsFactors = TRUE)

net <- graph.edgelist(as.matrix(df))

V(net)$type <- bipartite.mapping(net)$type

proj_net <- bipartite.projection(net)

plot(net, 
 main = "Bipartite Projection of Algerian Terror Network",
 layout=-layout.bipartite(net)[,2:1])

      

My question is: How do I convert this to a single mode (one way) branch network where the vertices are terrorist criminals and the edges are shared targets between performers? My guess is telling me that I should matrix multiply and display the adjacency matrix, but I have not been successful after some sample scripts on this forum. I realize that in this toy example I will have some isolates and a few dyads, but would like to expand this transformation process to a larger dataset once I get the mechanics handle.

Second, descriptive measures such as centrality, density and transitivity are described for single-mode specifications, the same as in other non-professional graphs, or does descriptive interference in bipartite networks require different measures of network structure?

+3


source to share


2 answers


Don't you already have it?

df  <- data.frame(perpetrator=c("A","A","B","C","D","A","E","A","F","G"),
                  target     =c("a","a","a","b","c","d","e","a","f","f"))
net <- graph.edgelist(as.matrix(df))
V(net)$type <- bipartite.mapping(net)$type
par(mfrow=c(1,2),mar=c(0,1,1,1))
plot(net, main="Full Network",edge.arrow.size=0.5)
plot(bipartite.projection(net)$proj1,main="Affilitaton Network")

      



bipartite.projection(...)

returns a list of two graphs named $proj1

and $proj2

that have communication networks. Thus, in this case, A

both are B

connected via A

, and F

and are G

connected via F

.

+4


source


To ask your second question:

Second, descriptive measures such as centrality, density and transitivity are described for single-mode specifications, the same as in other non-professional graphs, or does descriptive interference in bipartite networks require different measures of network structure?

This is not programming, but a statistical issue. Part of the answer lies with your research question. For example, see Bonacich et al., 1998 for a discussion of the correlation of group size with measures of centralization. I would like to direct you to the following docs to get started:



Latapy, Mattier, Clenmen Magnen and Natalie Del Vecchio. "Basic concepts for analyzing large dual-mode networks." Social Media 30.1 (2008): 31-48.

Faust, Catherine. "Centering in communication networks". Social Media 19.2 (1997): 157-191.

Bonasich, Phillip, Amalia Oliver, and Tom A.B.Snyders. "Size control in terms of centrality". Social Media 20.2 (1998): 135-141.

+1


source







All Articles