Dijkstra & Floyd Warshall implementation for weighted directed and undirected graphs with iteration logging.