new networkx functions