The visualisation was made using D3.js, Tableau and some Python OpenCV facial recognition code to get images of each of the characters (there may be some missing). Each time a character's name is mentioned within 15 words of another character's name, a connection is counted. The Google PageRank algorithm was run on the data to determine the size of each of the node portraits - the more 'important' characters have larger pictures.
The code to build the graph is on my GitHub: https://github.com/thomasc91/thomasc91.github.io. The source data gathered from the novels can be found on Andrew Beveridge’s GitHub: https://github.com/mathbeveridge/asoiaf