Network of Thrones: Recapping Season 7 and Predicting Season 8

In about a month, HBO will begin the final season of Game of Thrones. The show has reached a cultural critical mass and its viewership has increased over recent seasons. The show’s branding has been limitless and included beers, whiskys, and makeup, just to name a few. The coming season has become one of (if not) the most heavily anticipated final seasons in recent memory.

With the season premiere coming in mid-April, I thought now might be a good time to recap Season 7 and generate some predictions for what will happen in the final season. Given that this is a data blog, and I’m a data scientist, it seems reasonable to use statistical methods to do these things. Specifically, I want to use network analysis to draw insights from Season 7 that I can use to recap the season and generate predictions for Season 8. There is a tradition of using network analysis to study plot points from Game of Thrones, but I want to move beyond tracking previous plot points using network analysis to predicting plot points using network analysis.

The data used was generously collected by Andrew Beveridge, an Associate Professor at Macalester College. Specifically, the data details the number of interactions between any two characters. Here, an interaction is defined as one of the following:

  • Character A speaks directly after Character B.

  • Character A speaks about Character B.

  • Character C speaks about Character A and Character B.

  • Character A and Character B are mentioned in the same stage direction.

  • Character A and Character B appear in a scene together.

This produces a “weighted” and “undirected” network, wherein two characters interact a number of times (weighted) but we are agnostic to who initiated the interaction (undirected). I will try to explain as much network-parlance as i can as we go along, but for a canonical primer, see Wasserman and Faust.

When generating predictions, I will pay particularly close attention to plot points, potential interactions, and who may ultimately become to ruler of Westeros.

It is at this point I should warn you: If you haven’t yet seen Season 7 and care at all about having it spoiled for you, stop reading. Right now. Seriously. Go finish Season 7.

To tell its story, Game of Thrones bounces back and forth between different locations. For example, an episode might start at The Wall, only to bounce between Dorne and King’s Landing. To understand these different plot narratives and how they may interact in the future, I use community detection.

Community detection typically seeks to group actors into a finite number of groups based upon pockets of connectivity. Think about your office. Perhaps the data scientists and engineers interact with one another fairly closely, forming a tight-knit community. Perhaps the sales team interacts with one another fairly closely, forming a tight-knit community. While these communities may interact with one another, more often than not, any member is most likely to interact with someone in their own community. Within the context of Game of Thrones, it makes sense that Tyrion Lannister and Jon Snow would interact more frequently than Jon Snow and Cersei Lannister would; they spent most of the season in the same location.

Results from the  Louvain  community detection algorithm. This algorithm is specifically designed to work efficiently on large, weighted networks.

Results from the Louvain community detection algorithm. This algorithm is specifically designed to work efficiently on large, weighted networks.

The following visualization indicates that there are four communities within Season 7 of Game of Thrones. This certainly makes sense. Furthest left, colored in blue, we have a community that consists of characters such as Cersei Lannister, Jaimie Lannister, Ser Bronn of the Blackwater, Ser Gregor Clegane (the Mountain), and the Greyjoys. For a great part of the season, characters within this cluster are interacting to maintain a firm-grasp on the Lannister-led Westeros, and they are frequently interacting towards this end.

However, as the season progresses and Jon Snow convinces Queen Daenerys Stormborn of the House Targaryen (… the First of Her Name, Queen of the Andals, the Rhoynar and the First Men, Lady of the Seven Kingdoms and Protector of the Realm, Lady of Dragonstone, Queen of Meereen, Khaleesi of the Great Grass Sea, the Unburnt, Breaker of Chains and Mother of Dragons) that Winter is indeed coming, they reach out to the Lannisters in King’s Landing to call a truce and turn their attention to the North. As such, the blue and green communities overlap slightly. This green community, consisting mostly of Jon Snow, Queen Daenerys Stormborn… I won’t repeat the title again for our collective sake, Tyrion, and everyone’s favorite Onion Knight Ser Davos, spends most of the season in Dragonstone.

I also find a community reflecting the interactions within Winterfell, wherein Sansa is attempting to field an army capable of defending the North. This community, colored in yellow, consists largely of Sansa, Littlefinger, Arya, Bran, Brienne of Tarth, and everyone’s favorite squire Podrick. There is certainly some interaction with the Dragonstone community, for example, Jon and Ser Davos spent a good amount of time in Winterfell during Season 7. Nevertheless, the bulk of interactions between members of the Winterfell community occur with other individuals within the Winterfell community.

The final community detected, colored in Red, includes Ser Jorah Momont, Tormund Giantsbane, the Hound, the Night King, and White Walkers. This alludes to a large plot narrative wherein a team is sent north of the Wall to capture living White Walkers as proof for Daenerys and Cersei. You might remember this concluding with a team of White Walkers pulling Viserion (one of Daenerys’ dragons) out of a lake.

This exercise has been good for recapping Season 7, but what can it teach us about Season 8? Quite a bit! First and foremost, these communities, while distinct, are fairly close together. This indicates something that most would expect: Westeros must unify if it is to confront the Night King. There are no totally disconnected components or groups of characters, and as time progressed, three of these communities started to converge and interact with one another with greater frequency. One thing that does become apparent though, it seems that some are far less likely to converge. For example, it may not make sense for those in Dorne, such as Tyene or Ellaria Sand, to interact with those likely to stay in Winterfell, such as Sansa.

To better understand who is likely to interact, or not interact, in Season 8, I use a latent space model to estimate the “affinity” between any two characters. Specifically, I use an Additive Mixed Effects (AME) model introduced by Peter Hoff and implemented in R with the “amen” package. This model allows users to examine which actors within a network are more or less likely to interact, “affinity”, based upon common connections and a variety of complex interdependencies within the network. For an excellent primer, I recommend Minhas, Hoff, and Ward.

Heatmap of interactions, lighter values indicate higher positive affinity, darker values indicate lower or negative affinity. I recommend opening this in a separate tab for closer examination.

Heatmap of interactions, lighter values indicate higher positive affinity, darker values indicate lower or negative affinity. I recommend opening this in a separate tab for closer examination.

The preceding visualization presents a heatmap for these affinity values, wherein darker values reflect negative or lower affinity and lighter values reflect greater positive affinity. It should be noted, that true to form, these color palettes were produced by Alejandro Rico and made available in his R package “gameofthrones”. I went with the White Walkers’ palette because while winter will hopefully be coming to an end (seriously, it’s March…), Winter is coming.

Overall, it appears that most characters don’t have a great deal of affinity for one another (but not necessarily negative affinity). The highest levels of affinity appear to be associated with particular characters, as shown by the light blue horizontal and vertical stripes. These characters include Tyrion, Sansa, Jon, Daenerys, and Cersei. This makes sense, as the main characters they would be most likely to form a relationship with any one other person.


However, this ultimately tells us little about what we might expect from Season 8. To generate interesting predictions, I look relationally at the pairs of characters who do not connect in Season 7 but have the highest latent affinity, or probability of forming a relationship. The ten largest affinity scores among those with no Season 7 relationships are presented in the preceding plot. The first relationship is perhaps one of the most heavily anticipated meetings in the series: Sansa meeting her brother Jon’s new queen, lover, and in the largest turn of dramatic irony in recent memory, aunt, Daenerys. This indicates a fairly large prediction that has actually already been verified! We’re already off to a good start!

Many of the remaining relations are between Jon and several large characters that will likely join Jon’s command in the battle against the White Walkers. Once omitting those who die, this includes Ellaria and Tyene Sand and Yara Greyjoy. The model also predicts that Arya Stark and Daenerys will meet, which makes sense as similar to Sansa, Arya is the sister of Jon, Daenery’s new general and lover. Additionally, the model predicts that Arya and Tyrion Lannister will eventually meet. Given that Arya’s sister Sansa is Tyrion’s amicable ex, this seems likely.

Finally, I want to end with the projections that most readers may care about: Who will lead Westeros once the dust settles? Even Vegas cares about this question, putting Bran Stark as the favorite at +125. You can even put money on Tormund at +15000. Given the political nature of Game of Thrones, perhaps we can use social network analysis to produce measures of political power. Within the study of networks, centrality is a concept frequently used to characterize an actors position within the broader network. To capture the influence of a character, we might want to use measures like eigenvector, betweenness, or degree centrality.


Each measure in the preceding plot presents a different “facet” of the social power and influence one might yield in Westeros. Degree centrality would measure a character’s popularity, how frequently they interact with other characters. Weighted degree specifically captures the volume of interactions with all other characters while unweighted degree simply measures the number of individuals a character interacts with. For example, Samwell Tarly may have a great deal of interactions, but they’re largely with the same people (Jon, Gilly, etc.).

Betweenness centrality, on the other hand, captures how frequently a character might be between other individuals in the network. A character with high betweenness is a bridge character, linking many other characters together indirectly.

Finally, eigenvector centrality measures the connectedness of an character to other highly connected characters. As such, they have influence and they have influence with individuals who have a lot of influence.

It is unclear whether one of these should produce a firm set of predictions over others. As such, they must be considered in combination. Regardless of measure, the same names frequently appear: Jon, Daenerys, Cersei, Tyrion. Jon and Daenerys are near the top in all four measures while Cersei and Tyrion are included in the top five in three of four measures. As such, it seems that safe money would be, in this order: Jon, Daenerys, Tyrion, and Cersei.

For the record, these are my predictions:

  • There will be a battle where at least individuals in all communities will fight. It is unclear whether we should expect it to be alongside one another or against one another.

  • In a major plot point and in a significant way:

    • Daenerys and Sansa will interact.

    • Ellaria and Jon will interact.

    • Jon and Yara will interact.

    • Daenerys and Arya will interact.

    • Jon and Tyene will interact.

    • Arya and Tyrion will interact.

  • One of the following will rule Westeros: Jon, Daenerys, Tyrion, or Cersei.

I will try my hardest to update these predictions as episodes come along!