Les Misérables: Network of Characters

Lab Reports, Networks



Reading a book, watching a musical or movie is our way of soaking in a story and immersing ourselves into the world of literature. Often times, the characters in the books are intricately woven together where some relationships are forgotten by the viewer.

Building a graph to show connection, the level of co-appearance, and frequency of appearance can help the viewer digest the storyline and unpack the sophisticated storyline and relationship.

By graphing the relationships of the characters, I wanted to dive in to the story of Les Miserables and create a guide to grasp the level of connection between the characters.


I was inspired to explore datasets of relationships of people with the election currently in full force. I was curious to see how the 3D network visualization software can help analyze and dive deeper into connections of people.

One graph I was inspired by was of the Voting Relationships between Senators in the 113th Congress, 2014. The visualization shows the connection of senators and how often they vote together. The data was pulled from govtrack.us and the person that graphed the data was able to analyze that “an edge between 2 senators indicates that they have voted together on at least 109 occasions; I filtered out edges with lesser weight for the sake of clarity.”

Voting Relationships between Senators in the 113th Congress, 2014


Another visualization that inspired me to explore the connection of people is the visualization of the readers of New York Times vs. The Wall Street Journal on Facebook. This visualization made it clear to process the “NY Times (red) has a bit more users (grey) than the WSJ (blue). There is a bit of overlap in terms of (active) audience, but in general, there seem to be quite distinct populations of the short span the data covers. Interestingly, one post – talking about the space shuttle Endeavor – is a true outlier: it has succeeded in capturing a less “specific” audience.” This visualization not only take account of the number of people interacting with the articles but also visualizes the the overlap of audiences based on the type of article posted by each news outlet.

New York Times vs. The Wall Street Journal on Facebook


Github Dataset: Github of sample data sets
Les Miserables: co-appearance weighted network of characters in the novel Les Miserables. D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley, Reading, MA (1993).
Gephi: open-source network visualization software


In order to select a data set to visualize, I explored 3 different sites (CASOS Network Science Data, GitHub Gephi Data Set, Stanford Large Network Dataset Collection). As a big musical fan and having seen Les Miserables twice in broadway, I was interested in seeing the co-appearance weighted network of characters.   

I downloaded the .gml dataset file of Les Miserables characters and imported it into Gephi. Once imported, the graph type was set to “undirected” because the graph was not to show the direction of connection. The graph is to show relationship and relationship being two ways, the direction was not a helpful information.

Gephi importing dataset pop-up

After importing in the data, I went in to change the edge ranking rate color to better define the connection and the level of difference in the connection between the character. Then I went in to change the node degree color to clearly indicate the frequency of the characters’ appearance in the story.

Finally, I went to the bottom toolbar to show node labels and adjusted the size of text to clearly label the nodes, labeling the circles to characters.

Results and Interpretation

Not only was i able to see the co-appearance connection between the characters, the color and the thickness of the line indicated the weight of how many times they co-appeared. Color was added to emphasize the difference in weight of the characters’ co-appearance.

Connection between Les Miserables characters

Connection between Fantine and other Les Miserables characters

Connection between Valjean and other Les Miserables characters


My visualization of the Le Miserables character connection and co-appearance is an entrance to going deeper into analyzing other datasets. It helps to understand the intricacy of the relationships overall but also the interactive feature of the visualization helps to process the connection by individual characters.

With the election coming to an end, and many future elections to come, I am inspired and curious to see the people connection of who votes for which party, policy, people and be able to visualize this information.

Gephi is a strong tool to quickly many numbers and datasets into digestible visual and translate complicated information into easy to comprehend visual.