Code:
void warshall(int a[100][100],int n)
{
int q,i,j;
for(q=1;q<=n;q++)
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
if(((i!=q)&&(j!=q)&&a[i][j]==0)&&(a[i][q]==1)&&(a[q][j]==1)) a[i][j]=1;
}
This is roy-warshalls algorithm. I get from the adjacency matrix the path matrix. I want to obtain from the path matrix the adjacency matrix. How can I do that ? Have any suggestions ?
Thank you!