Text this: Application of graph theory to some statistical mechanics problems