dijkstra matrix representation