find out the number of nodes from direct graph noeds