#include <stdio.h> #define MAX 5 #define INFINITE 9999 int allselected(int selected[]) { int i; for(i=0;i<MAX;i+=1) { if(selected[i]==0) { return 0; } } return 1; } void shortpath(int cost[][MAX],int preced[],int distance[]) { int selected[MAX]={0}; int current=0,i,k,dc,smalldist,newdist; for(i=0;i<MAX;i++) distance[i]=INFINITE; selected[current]=1; distance[0]=0; ..