#include #include void main() { int graph[50][50]; int i,j,k,t; int nn; cout<<"\n Enter Number of Nodes:"; cin>>nn; /* Initialize graph*/ for (i=0;i>t; graph[i][j]=graph[j][i]=t; } } } /* Initializing via */ int via[50][50]; for (i=0;i-1)&&(graph[j][k]>-1)) { sh[i][j][k]=graph[j][k]+graph[i][j]; } else { sh[i][j][k]=-1; } } } } /*displaying shared table */ for(i=0;ish[i][k][j]) || (final[i][j] == -1)) { if(sh[i][k][j]>-1) { final[i][j]=sh[i][k][j]; via[i][j]=k; } } } /* After considering three vertex if final not found consider 4th a- b- c- d */ if(final[i][j]==-1) { for(k=0;kfinal[i][k]+final[k][j]))) { if(final[i][k]+final[k][j]>-1) { final[i][j]=final[i][k]+final[k][j]; via[i][j]=k; } } } } } } } cout<<"\n After Update :"; /* Display table Updation */ for (i=0;i