Warshall's Algorithm



SOURCE CODE



#include”iostream.h”
#include”conio.h”
#include”stdio.h”
#include <>
#define INFINITY 32768

class path
{
int n;
int p[10][10];
int p1[10][10];
int a[10][10];
int c[10][10];
public:
void get();
void pm();
void ap();
void disp();
};
void path::get()
{
int i,j,k;
clrscr();
cout < < "Enter The Number Of Vertices: "; cin > > n;
cout < < "Enter The Adjacency Matrix \n"; for(i=1;i < =n;i++) { for(j=1;j < =n;j++) { cout < < "a[" < <> > a[i][j];
p[i][j]=0;
}
}
cout < < "Enter The Cost Matrix \n"; for(i=1;i < =n;i++) { for(j=1;j < =n;j++) { cin > > c[i][j];
}
}
for(i=1;i < =n;i++) { for(j=1;j < =n;j++) { p[i][j]=a[i][j]; } } } void path::disp() { for(int i=1;i < =n;i++) { for(int j=1;j < =n;j++) { cout < < k="1;k" i="1;i" j="1;j" i="1;i" j="1;j" k="1;k" i="1;i" j="1;j">