Network analyses of literature in recent years has provided a new lens through which fans and scholars examine literary characters and their relationships with each other. Earlier network graphs investigated the connectivity of literary classics like Shakespearean tragedies and Les Miserables and uncovered clusters and connections that were not obvious to the casual reader. More recently, student work in this area has branched out to explore the networks in the Marvel Comics Universe, Lords of the Rings, and Game of Thrones.
But I could not find a network graph of the godfather of all cultural phenomenons for Millenials and Gen Z, Harry Potter. It has a popular fictional universe that is comparable to the above and multigeneration-spanning appeal. It was and still is, immensely popular and influential. I suspect the prominence of the three central characters, Harry, Hermione, and Ron, gives a false impression that the Potter universe is less intricate than the Lord of the Rings or Game of Thrones, but I disagree.
I found a Node table of around 70 of the most prominent Harry Potter characters and an accompanying Edge table showing if they are enemies or allies from this GitHub repository. While the edges are unweighted, they are directional. I cleaned up the data by removing irrelevant columns.
Methodology & Visualization
To create this visualization, I imported the CSV files into Gephi. The first iteration of the visualization was not decipherable at all. After adding labels and exploring different layouts, it was much easier to interpret.
I then created clusters by running the Modularity function and, after minor adjustments, found five distinct groups that made narrative sense. The first iteration of my network visualization looks like this. I used the Fruchterman Reingold layout because I thought it created a cleaner layout. I also removed the directional arrows because I didn’t think they looked good.
But for the final version, I decided to use the Force Atlas 2 Layout and then use the Expansion layout. My initial gripe with Force Atlas 2 was that the characters were too close to each other and hard to see. But with Expansion, the Force Atlas 2 layout actually makes more narrative sense than the Fruchterman Reingold layout.
This project was delightful. I was inspired by the many network graphs of fictional works on this site. I believe the network graph I created is an accurate representation of the characters’ relationship with each other.
I think the allies and enemies aspect of the graph was not very successful because it didn’t change the shape of the network and was not well portrayed. I wonder if a weighted graph showing concurrence of the characters would have been more interesting.