Updated with nx to igraph function

Other functinos have been adapted in order to work well across the two
packets.