The graph is given in a format that lists edges with their weights. Each entry has the format "source vertex, destination vertex, edge weight". So, the graph is represented by the edges: (1, 2, 2), (3, 4, 7), (10, 5, -8), (2, 1, 4), and (5, 3, 6).
Show more…