Limit number of nodes for relationship graph