Function runs Bellman - Ford algorithm and prints negative cycle ( if present )
def NegCycleBellmanFord ( graph , src ) : NEW_LINE INDENT V = graph . V ; NEW_LINE E = graph . E ; NEW_LINE dist = [ 1000000 for i in range ( V ) ] NEW_LINE parent = [ - 1 for i in range ( V ) ] NEW_LINE dist [ src ] = 0 ; NEW_LINE DEDENT