/****************************************************************************** * Sample solution for the Tour problem in NWERC'03 * Author: Andreas Björklund ******************************************************************************/ #include #define MAX_JUNCTIONS (200) #define MAX_STREETS (1000) int jstreets[MAX_JUNCTIONS][MAX_JUNCTIONS]; int jnbr[MAX_JUNCTIONS]; int streets[MAX_STREETS][2]; int cap[MAX_JUNCTIONS]; int par[MAX_JUNCTIONS]; int path[MAX_JUNCTIONS]; int vis[MAX_JUNCTIONS]; int nstr; int augment(int who, int cnt) { if (cap[who]<0) { return cnt; } else { if (!vis[who]) { int i,ans; ans = 0; vis[who] = 1; for (i=0;i no tour. if (par[j] & 1) augpath=0; for (j=0;j0 && augpath) { int q,plen; for (q=0;q