Given a distance matrix D where d[i][j] represents the shortest path from i to j and all edge weights are positive. Also,
d[i][i] = 0 and
d[i][j] > 0
The distance matrix may or may not represent a valid weighted directed graph. How to check if it represents a valid weighted directed graph?