a few algorithms for networkx