If the graph has multiple edges between the same pair of vertices, take the one with minimum weight. When reading edges, if there is already an edge from to with weight , and you read a new edge with weight , set dist[i][j] = min(w_1, w_2).
This ensures the distance matrix starts with the best direct edges before Floyd-Warshall runs. Forgetting this can give wrong answers if the input has duplicate edges.