chiark / gitweb /
Release 1.1.6.
[rocl] / graph.c
diff --git a/graph.c b/graph.c
index 2ec27f86046564efdb69b546c1003fcdfd591bb1..9dc3942c6b0ecf6aed4da672a57880ec1a9ab34b 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -1,40 +1,27 @@
 /* -*-c-*-
- *
- * $Id: graph.c,v 1.2 2003/03/08 00:40:32 mdw Exp $
  *
  * Graph theory stuff
  *
  * (c) 2003 Mark Wooding
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: graph.c,v $
- * Revision 1.2  2003/03/08 00:40:32  mdw
- * Fix unsigned crapness in travelling-salesman solver.
- *
- * Revision 1.1  2003/03/07 00:45:13  mdw
- * Graph theory functions.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include <assert.h>
@@ -375,7 +362,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]];
@@ -547,7 +534,7 @@ static int cmd_tsp(ClientData cd, Tcl_Interp *ti,
       t = r[i]; r[i] = r[j]; r[j] = t;
       if (c_curr < c_best) {
        c_best = c_curr;
-/*     printf("*** new best = %lu\n", c_best); */
+/*     printf("*** new best = %lu\n", c_best); */
        memcpy(r_best, r, nn * sizeof(*r));
       }
     }