Mideast Graph 2

I wasn't satisfied with my original plot (http://scweiss.blogspot.co.il/2013/09/mr-al-sabah-welcomes-you-to-middle-east.html) of the Middle East situation a few months ago. After all, I just placed the Entities in an ad hoc way, and it showed no obvious structure despite my efforts…

Since then I've done some research and found out about a solution using Laplacian Matrix to plot networks with negative weights.(Check This Article…I followed the Example of Figure 6 http://www.dai-labor.de/fileadmin/files/publications/signed-kernels.pdf).

The structure becomes more apparent when we use this approach, which involves using two Eigen Vectors associated with the two smallest Eigen Values.

Below is the R code and the plot:

library(reshape)
## Loading required package: plyr
## 
## Attaching package: 'reshape'
## 
## The following objects are masked from 'package:plyr':
## 
##     rename, round_any
mideast = read.csv("/users/sweiss/google drive/middle east relations.csv")

mideast = as.matrix(t(mideast))
colnames(mideast) = rownames(mideast)


mideast.sym = mideast + t(mideast)

laplace.mideast = -mideast.sym
diag(laplace.mideast) = colSums(abs(mideast.sym))
decomp = eigen(laplace.mideast)
plot(decomp$vectors[, 7], decomp$vectors[, 8], type = "n", ylab = "Last Eigen Vector", 
    xlab = "2nd To Last Eigen Vector", main = "Network Graph Mideast (Last two Eigen Vectors of Laplacian Matrix)")
text(decomp$vectors[, 7], decomp$vectors[, 8], labels = colnames(mideast))

melt.mat = melt(laplace.mideast * upper.tri(laplace.mideast))
melt.mat = melt.mat[which(melt.mat$value != 0), ]

melt.mat$value[which(melt.mat$value == 1)] = 2
melt.mat$value[which(melt.mat$value == -1)] = 4


last.two.eigen = decomp$vectors[, 7:8]
rownames(last.two.eigen) = colnames(mideast)

for (i in 1:15) {
    segments(last.two.eigen[as.character(melt.mat$X1[i]), 1], last.two.eigen[as.character(melt.mat$X1[i]), 
        2], last.two.eigen[as.character(melt.mat$X2[i]), 1], last.two.eigen[as.character(melt.mat$X2[i]), 
        2], col = melt.mat$value[i])
}
legend("topleft", c("Friend", "Enemy"), fill = c(4, 2), horiz = TRUE, bty = "n")

plot of chunk unnamed-chunk-1

It's easier to see that Obama (US) and Turkey have similiar friends and enemeis. They do share a common enemy in General Sisi and common friend in Muslim Brotherhood. Iran by contrast supports Hamas and Assad who are against Turkey and Obama, so it makes sense that Iran is far away from Obama and turkey.

A hard look at the adjacency matrix could reach the same conclusions, but it's difficult for so many connections (this 8x8 matrix contains 28 different undirected relations). This method makes it easy to see the connections of friends and enemies alike.

Data: https://docs.google.com/file/d/0B9nc4zDDl2T-cHN2VEJwdUx1Rlk/edit?usp=sharing