chiark / gitweb /
Fix single point TSP.
authormdw <mdw>
Mon, 10 Mar 2003 23:37:21 +0000 (23:37 +0000)
committermdw <mdw>
Mon, 10 Mar 2003 23:37:21 +0000 (23:37 +0000)
graph.c

diff --git a/graph.c b/graph.c
index 2ec27f86046564efdb69b546c1003fcdfd591bb1..821f15610cc847d3835ea97fa8a92f289206d97d 100644 (file)
--- 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]];