Volume 3: A Storm of Swords


[If you are new to Network Science, be sure to read A Primer on Network Analysis before continuing. If you want to know how we created the network, then check out From Book to Network.]

The “A Storm of Swords” network is where my mathematical adventure started. The network below is an improved and more robust version than the one that appeared in our original expository article in Math Horizons Magazine, published by the Mathematical Association of America. We opted to use this volume because the narrative had matured, and the communities had differentiated themselves. The network in the Math Horizons article featured 107 characters and 353 weighted edges, accounting for 4324 interactions.

The network below is three times as large! It has 303 nodes (characters) and 1008 weighted edges, corresponding to 8,489 interactions. We will discuss how we improved our analysis in another post. But the short version is:

  • We compiled a more definitive list of characters
  • We improved our ability to handle nicknames and to disambiguate references using honorifics like “king” (which could refer to Robert, Joffrey, Robb, Stannis, etc) or “maester.”

Interestingly, the results for this more complete network are similar to the Math Horizons article

The Network

Here is the “A Storm of Swords” network.



“A Storm of Swords” has eight main communities. Clockwise from the top, they are:

  • the Night’s Watch and the Wildlings (Jon, Sam),
  • Stannis Baratheon’s southern forces (Stannis),
  • Slaver’s Bay of Essos (Daenerys),
  • King’s Landing (Tyrion, Joffrey, Sansa),
  • the Brave Companions (Jaime Lannister),
  • the Brotherhood Without Banners (Arya),
  • the Stark army (Robb, Catelyn), and
  • Bran Stark and friends (Bran).

We also have two very small communities: Margaery’s three ladies-in-waiting, and four lords involved in the Battle of Duskendale (as recounted by Lannister advisors in the capital city). The King’s Landing triad is now Tyrion, Joffrey and Sansa (with Cersei playing a smaller role). The marriage between Tyrion and Sansa brings her into this more prominent position in the active storyline, compared to the narrative limbo she traveled in the previous book.

One of the most interesting features is that Robert is placed within the Essos community. In reality, he plays quite a central role in the network. However, he is the only entryway from Westeros to Essos, so our community optimization groups him with the lands to the east, thanks to Daenerys’s grudge against “the Usurper.” The rest of the Essos community is uniformly focused on Daenerys. Three of the remaining communities have a single focus: Jamie, Arya and Bran. Two have a secondary focus: Davos for Stannis and Sam for Jon.

A Storm of Swords Centralities


Considering all centrality measures, Tyrion bests Jon in a close contest. Tyrion has a slight edge in degree, weighted degree, closeness and PageRank centrality. Meanwhile, Tyrion’s eigenvector centrality is twice as big as Jon’s (Tyrion connects to twice as many important characters), while Jon’s betweenness centrality dwarfs Tyrion’s score. As in the last book, the Imp rises to the top, though his winning margin is quite slim this time around.

Degree Centrality and Weighted Degree Centrality

The characters with the highest degree (the most connections) are

  • Tyrion, Jon, Robb, Sansa and Jaime.

Tyrion and Jon have far more interactions (weighted degree) than everyone else. After a gap, the weighted degree decreases uniformly over Joffrey, Jaime, Sansa, Robb, Arya, Sam.

For the first time, we see a narrative shift towards Jaime and Sam. Indeed, this is the first volume in which they are point-of-view characters. Sansa enjoys a level of attention comparable to the first volume, as tensions rise in King’s Landing with the arrival of Margaery Tyrell. The focus on Bran continues its decline. Meanwhile, Arya has also slipped, in spite of the fact that the number of her point-of-view chapters has increased.

PageRank Centrality

The PageRank leaders are

  • Tyrion, Jon and then Robb

whose scores are quite close. This is a jump for the sons of House Stark, as neither one cracked the top four in previous books. Once again, PageRank captures the main narrative tensions of the book: the King’s Landing intrigue, the wildling siege of Castle Black, and Robb’s army in the Westerlands and the Riverlands.

After a gap, we have

  • Sansa, Joffrey and Jaime, followed by Catelyn, Daenerys and Arya.

This is the first time that half of the top-ranked characters are women (though only Sansa appears in the top five). Ned Stark falls off the list of top characters for the first time, while Robert Baratheon holds steady at 14th place.

Eigenvector Centrality

King’s Landing dominates eigenvector centrality. The capital city houses many important characters and has the attention of those outside of it.

  • Tyrion and Joffrey are clearly on top of eigenvector centrality.

The King’s Landing narrative centers around Tyrion, from his betrothal to Sansa to the accussations of poisoning King Joffrey. Meanwhile, the War of the Five Kings rages on, with legitimacy of Joffrey, the boy king, at its core.

The top five are filled out by

  • Sansa, Jamie and Cersei.

After another gap, we have

  • Arya, Robb, Tywin and Catelyn.

Arya jumps over Robb and Catelyn, which reminds us to be slightly wary of eigenvector centrality: for Arya, it captures relationships that can be developed and tapped in the future, but are not necessarily being used currently . This effect is far more striking for Daenerys (111th) and Davos (70th) who have only one or two connections to other important characters (Daenerys to Robert, Davos to Stannis and Joffrey). Their PageRank importance (8th and 16th, respectively) give a far more accurate assessment of their current roles in the narrative. Eigenvector centrality points out that Daenerys and Davos need to establish more direct connections to important characters if they want to advance their own importance in the future.

Betweenness Centrality

Finally, we consider betweenness centrality.

  • Jon Snow dominates this measure,

thanks to the expansive storyline Beyond the Wall that resolves at Castle Black. Jon is the hub of the far north community, which contains 22% of the network (up from 14% and 10% in the first two volumes, respectively).

  • Next, Robert and Robb bridge King’s Landing and the North.

In addition, Robert provides access to Essos, and Robb is the hub for the Westerlands/Riverlands community. After that comes

  • Tyrion, Joffrey and Daenerys.

Note that Sansa underperforms in betweenness, showing that she is still a side piece in the game of thrones. Meanwhile, Robert and Daenerys are the main over-performers when comparing their betweenness to their degree centrality. They are the two characters that tie the Westeros and Essos a storylines together.

And the Winner is…

For the second volume in a row, Tyrion takes the top spot. He leads four out of five categories, including three that are hotly contested by Jon Snow. So the bastard of Winterfell must settle for second place, even with his reigning betweenness score. But this is quite a rebound for Jon, whose centrality scores were lost the wilds of the North in the previous volume. He shows clear momentum at this point, so Tyrion needs to keep an eye out.

Third place is also a close race, with Robb beating our Joffrey with his impressive performance in PageRank. Undoubtedly, Robb’s tragic narrative arc is the resounding drama of this volume. Meanwhile, Joffrey’s importance is bolstered by his station rather than his actions.

Then we have another close race. Fifth place goes to Sansa, who finds herself an active pawn in the game of thrones. She beats Jaime by a hair (or a hand, perhaps). The key to the North edges out the Kingslayer in both PageRank and eigenvector centralities. So our top rankings are Lannister & Stark show:

  1. Tyrion
  2. Jon
  3. Robb
  4. Joffrey
  5. Sansa
  6. Jaime

Of course, we also check in with Daenerys, who has begun to rebound. Her eigenvector centrality is abyssmal (111th place), but this makes her PageRank showing (8th place) all the more impressive. And she achieves that mark (and 6th place in betweenness) with rather tepid performances in both number of connections (degree) and number of interaction (weighted degree). Even more than Jon Snow, her momentum is building rapidly and her journey has started its acceleration.