/*Prepare the distance matrix in file ff.dat s is the membership array for the solution set, empty initially f is that for the frontier set, frontier = {1} initially */ #include main(){ int i,j,k,n,v,w,source; int d[1000],f[1000],s[1000]; int a[100][100]; FILE *in_file; printf("Input n and source "); in_file=fopen("ff.dat","r"); fscanf(in_file,"%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=n;j++) fscanf(in_file, "%d ",&a[i][j]); fscanf(in_file, "\n"); }; for (i=1;i<=n;i++){ for (j=1;j<=n;j++) printf("%4d ",a[i][j]); printf("\n"); } for (k=1;k<=n;k++) { for (i=1;i<=n;i++) for (j=1;j<=n;j++) if (a[i][k]+a[k][j]