/* Non-stop Travel Solution */ #include #define MAXNODES 10 int nnodes; /* # of intersections */ int map[MAXNODES][MAXNODES]; /* map of the area */ /* map[i][j] = -1 => no direct path from i and j */ /* = 0 => no signal at j when approached from i */ /* > 0 => average delay at j when approached from i */ int path[MAXNODES]; /* nodes in the path */ int plen; /* path length (# of nodes) */ struct { int prev, len, perm; } state[MAXNODES]; find_path (int start, int stop) { int i, k, tlen, first, min; for (i=0;i