      SUBROUTINE DOANNEALING(X,Y,NCITY)
C      PROGRAM D10R13
      PARAMETER (NCITY)
      INTEGER IORDER
      DIMENSION X(NCITY), Y(NCITY), IORDER(NCITY),XINIT(NCITY), YINIT(NCITY), INITO(NCITY);
      COMMON /RAND/ IALPHA,IBETA,IDUM
      OPEN(12,FILE='paths.dat',FORM='FORMATTED')
      IALPHA = 7**5
      IBETA = 2**31 - 1
C     Create points of sale
      IDUM = 111
      DO I =1,NCITY
C        X(I) = RAN3()
C        Y(I) = RAN3()
        IORDER(I) = I
        WRITE(6,*) X(I), Y(I), IORDER(I)
        XINIT(I) = X(I)
        YINIT(I) = Y(I)
        INITO(I) = IORDER(I)
        ENDDO
      CALL ANNEAL(X,Y,IORDER,NCITY)
      WRITE(6,*) '*** System Frozen ***'
      WRITE(6,*) 'Final path:'
      WRITE(6,'(1X,T3,A,T13,A,T23,A)') 'city', 'x', 'y'
      DO I=1,NCITY
        II = IORDER(I)
        JJ = INITO(I)
        WRITE(6,'(1X,I4,2F10.4)') II,X(II), Y(II)
        WRITE(12,1000) XINIT(JJ), YINIT(JJ), X(II), Y(II)
        ENDDO
        I = 1
        II = IORDER(I)
        JJ = INITO(I)
        WRITE(6,'(1X,I4,2F10.4)') II,X(II), Y(II)
        WRITE(12,1000) XINIT(JJ), YINIT(JJ), X(II), Y(II)
 1000 FORMAT(4(3x, F8.4))
      END
