Add method to get # nodes in the graph