From a9dd768100913b7eb5a0bbad82bdb7c8b8c8b452 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 10 Mar 2003 23:37:21 +0000 Subject: [PATCH 1/1] Fix single point TSP. Organization: Straylight/Edgeware From: mdw --- graph.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graph.c b/graph.c index 2ec27f8..821f156 100644 --- a/graph.c +++ b/graph.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: graph.c,v 1.2 2003/03/08 00:40:32 mdw Exp $ + * $Id: graph.c,v 1.3 2003/03/10 23:37:21 mdw Exp $ * * Graph theory stuff * @@ -27,6 +27,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: graph.c,v $ + * Revision 1.3 2003/03/10 23:37:21 mdw + * Fix single point TSP. + * * Revision 1.2 2003/03/08 00:40:32 mdw * Fix unsigned crapness in travelling-salesman solver. * @@ -375,7 +378,7 @@ static int cmd_tsp(ClientData cd, Tcl_Interp *ti, if (nn <= 2) { memcpy(r_best, r, nn * sizeof(*r)); - if (n == 1) + if (nn == 1) c_best = a[r[0] * n + r[0]]; else c_best = a[r[0] * n + r[1]]; -- [mdw]