Count node and edge in graph