i have done the implementation of the algo but all the time i am getting core dumped error do please if i can get the code as tell in the video
Floyd warshall algo
@Saurabh2771999
Here is the code.
d is the adjacency matrix.
vector<vector<int>> d(n,vector<int>(n)); // adjacency matrix
const int INF = 2e9;
for (int k = 0; k < n; ++k) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
if (d[i][k] < INF && d[k][j] < INF)
d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
}
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.