• A Song of Ice and Fire - Network Analysis

    Using igraph in R

  • DATASET INFO

    Character Interaction Networks for George R. R. Martin's "A Song of Ice and Fire" saga.

    These edgelists were created by connecting two characters whenever their names (or nicknames) appeared within 15 words of one another in one of the books in "A Song of Ice and Fire." The edge weight corresponds to the number of interactions.

    The Dataset is available here.

    THEMES

    R, iGraph, Network Analysis, PageRank

    PROJECT DESCRIPTION

    In this study, we attempted to study the network of character interactions in "A Song of Ice and Fire" by George R. R. Martin. Using a .csv file with the list of edges of the network, we created an undirected, weighted, igraph graph, using the columns Source, Target and Weight. We started our analysis, by calculating some basic network properties, such as the number of vertices, number of edges, diameter of the graph and the number of triangles. We also identified the Top 10 characters of the network based on their degree and weighted degree. After plotting the network, using plot() and rglplot(), we created a subgraph, by keeping only the vertices that have greater or equal to 10 connections in the network and compared the edge density of the subgraph and the whole graph. In section 4, we calculated the Top 15 characters based on betweenness centrality and closeness centrality and compared where Jon Snow ranks in these 2 metrics. Finally, we implemented the PageRank algorithm to rank the characters and plot the graph.

    CODE

    Code in R is available here

  • SHORT PRESENTATION