From 8dbd116b880fe4a8ba059ce76262761c21bca91b Mon Sep 17 00:00:00 2001 From: zenon Date: Wed, 6 Jun 2018 19:22:01 +0200 Subject: [PATCH] Working --- generator.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generator.c b/generator.c index 51381fc..5d63ece 100644 --- a/generator.c +++ b/generator.c @@ -290,20 +290,22 @@ int main(int argc, char *argv[]) int permutation[graph.V]; while (quit == 0) { - for (int i = 0; i < 1000000; i++) { + for (int i = 0; i < 10000000; i++) { int solution[MAX_ITEMS]; genSolution(permutation, graph.V, solution); - /* printf("["); + if (solution[0] == -1) { + printf("]\n"); + break; + } int j; - for (j = 0; j < (MAX_ITEMS - 2); j++) { + for (j = 0; j < (MAX_ITEMS - 1); j++) { if (solution[j+1] != -1) printf("%d, ", solution[j]); else break; } printf("%d]\n", solution[j]); - */ } break; }