rm(list=ls())
gc()
##           used (Mb) gc trigger (Mb) max used (Mb)
## Ncells  613850 32.8    1402832   75   702048 37.5
## Vcells 1145158  8.8    8388608   64  1927720 14.8
setwd("C:/Users/alain/OneDrive - Middlebury College/MIIS Readings/GGPD 8565A Network Analysis (Murphy)/Vizards")
 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/answers to.rda")
load("data/informs.rda")
load("data/negative sentiment.rda")
load("data/positive sentiment.rda")
load("data/sentiment.rda")

For this brokerage analysis I will be looking at the “answers to” network. Background knowledge of the story of Dune (Part Two) tells us that each faction adheres to a social and/or military hierarchy, so this network is likely to give us a good indication of who the most authoritative individuals are within the network.

To begin the brokerage analysis, start by extracting the largest weak component and color-coding the characters by tribe. I am going to look at cutpoints first - within the hierarchy network, cutpoints are likely to be those who are at the top of the power pyramid. Cutpoints are shown as squares in the plot below.

ans <- decompose(answer_to)[[1]]

V(ans)$tribe
##  [1] "atreides"      "fremen"        "bene gesserit" "fremen"       
##  [5] "atreides"      "harkonnen"     "empire"        "harkonnen"    
##  [9] "empire"        "bene gesserit" "harkonnen"     "bene gesserit"
## [13] "fremen"        "fremen"        "fremen"        "fremen"       
## [17] "fremen"
V(ans)$color <- V(ans)$tribe
V(ans)$color <- gsub("atreides","darkgreen", V(ans)$color)
V(ans)$color <- gsub("fremen","chocolate",V(ans)$color)
V(ans)$color <- gsub("bene gesserit", "darkslateblue",V(ans)$color)
V(ans)$color <- gsub("harkonnen","darkred",V(ans)$color)
V(ans)$color <- gsub("empire","goldenrod",V(ans)$color)
articulation_points(ans)
## + 6/17 vertices, named, from 1cb541b:
## [1] Stilgar                 Jessica                 Reverend Mother Ramallo
## [4] Baron Harkonnen         Emperor                 Paul Atreides
V(ans)$shape <- V(ans)$tribe
V(ans)$shape <- ifelse(V(ans)%in%
                          articulation_points(ans),
                        "square", "circle")
par(mar=rep(0,4))
plot(ans, layout=layout_nicely)

Here we see that, unsuprisingly, the cutpoints in this network are Stilgar, Paul, Jessica, Reverend Mother Ramallo, Baron Harkonnen, and the Emperor. This tracks with the expectation that cutpoints in a network containing multiple hierarchical factions would be those at the top - aka those with the highest rank/standing. However, this one is a little misleading because it is tempting to interpret Jessica, a Bene Gesserit, as the leader of that faction. We know from the story however that her status as an articulation point comes more from her status as a reverend mother to the Fremen (as well as being the mother of Paul), rather than from any leadership role within the Bene Gesserit. Still, the articulation points (Stilgar, Paul, Jessica, Reverend Mother Ramallo, Baron Harkonnen, and the Emperor) all command respect snd all are key leaders within their faction.

For a further layer, we can look at bi-components, which are parts of the network that are not easily separable. Characters on the edge of this piece of the network will have good opportunities for brokerage.

Run:

(biconnected_components(ans)$components)
## [[1]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Jamis   Stilgar
## 
## [[2]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Maker Keeper Jessica     
## 
## [[3]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Watermaster             Reverend Mother Ramallo
## 
## [[4]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Jessica                 Reverend Mother Ramallo
## 
## [[5]]
## + 6/17 vertices, named, from 1cb541b:
## [1] Chani          Gurney Halleck Shishakli      Stilgar        Jessica       
## [6] Paul Atreides 
## 
## [[6]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Beast Rabban    Baron Harkonnen
## 
## [[7]]
## + 6/17 vertices, named, from 1cb541b:
## [1] Feyd-Rautha            Baron Harkonnen        Princess Irulan       
## [4] Reverend Mother Mohiam Lady Margot Fenring    Emperor               
## 
## [[8]]
## + 2/17 vertices, named, from 1cb541b:
## [1] Emperor       Paul Atreides

And select the largest one. In this case we have two: [[5]] containing Chani, Gurney Halleck, Shishakli, Stilgar Jessica, and Paul Atreides, as well as [[7]], containing Feyd-Rautha, Baron Harkonnen, rincess Irulan, Reverend Mother Mohiam, Lady Margot Fenring, and the Emperor.
For now, let;s look at component [[5]] since it contains Paul, our main character. To prevent confusion I’ve applied a new color scheme that is based on membership of the bi-component (light green) or not (fuchsia) rather than on tribes. Cutpoints are still represented as squares.

(biconnected_components(ans)$components[[5]])
## + 6/17 vertices, named, from 1cb541b:
## [1] Chani          Gurney Halleck Shishakli      Stilgar        Jessica       
## [6] Paul Atreides
# use color 2 just to keep things distinguishable from the 1st set of colors
V(ans)$color2 <- ifelse(V(ans)%in%
                           biconnected_components(ans)$components[[5]],
                         "lightgreen","orchid")
plot(ans, vertex.color=V(ans)$color2)

#pink is showing us who is not in a bicomponent
# is always (usually) connected to an articulation point , so they tend to point us directly to the important people
# articulation points are access points into the bicomponent ; if you compromise the articulation points you isolate some people

From this plot we can see that Jessica, Paul, and Stilgar are connected to distict sections of the network that are both mutually exclusive and lie outside the network. It seems likely that Jessica and Paul have higher brokerage potential than Stilgar, since the pink regions they are connected are larger, but to confirm or deny this we can look at constraint - or rather, its inverse.

# to get brokerage potential, subtract from 1.125

1.125-constraint(ans)
##           Paul Atreides                   Chani                 Jessica 
##               0.8037889               0.6563580               0.8087333 
##                 Stilgar          Gurney Halleck             Feyd-Rautha 
##               0.7693750               0.5437654               0.6563580 
##         Princess Irulan            Beast Rabban                 Emperor 
##               0.3205556               0.1250000               0.7816667 
##     Lady Margot Fenring         Baron Harkonnen  Reverend Mother Mohiam 
##               0.6250000               0.6563580               0.6038889 
##               Shishakli                   Jamis            Maker Keeper 
##               0.3743750               0.1250000               0.1250000 
## Reverend Mother Ramallo             Watermaster 
##               0.6250000               0.1250000

From this we see that Paul has the highest brokerage potential of the 3 leaders within the subgroup we are looking at, followed by Jessica, and Stilgar. Taken together, we can assess that Paul is the most important broker of authority within the network, and Jessica is a close second. This adds some interesting nuance to what we see on screen, where it is sometimes unclear whether Paul or Jessica is more important/powerful within the Fremen + Atreides group of characters on Arrakis.