def get_shortest_paths(self, src, dst, weight): try: return nx.shortest_path(self, src, dst, weight=weight) except: return None
def get_shortest_path(self, source, target): return nx.shortest_path(self, source=source, target=target, weight='latency')
def get_shortest_latency_path(self, src, dst): try: return nx.shortest_path(self, src, dst, weight='latency') except: print "There is no shortest path!!!!" return []