function dantzig42_xy ( )

%*****************************************************************************80
%
%% dantzig42_xy() plots the cities in the Dantzig 42 city TSP file.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 June 2026
%
%  Author:
%
%    John Burkardt
%
  xy = readmatrix ( 'dantzig42_xy.txt' );
  order = readmatrix ( 'dantzig42_s.txt' );
%
%  Unbelievably, the first item in my order list was a number only,
%  not followed by a space (who'd have thought that was necessary).
%  For this, MATLAB simply refused to see that first data item.
%
  ncity = length ( order );

  clf ( );
  title ( 'Dantzig''s Traveling Salesman Tour on 42 Cities' );
  hold ( 'on' );
    plot ( xy(:,1), xy(:,2), '.' );
    from = order ( ncity );
    for i = 1 : ncity
      to = order ( i );
      plot ( [ xy(from,1), xy(to,1) ], [ xy(from,2), xy(to,2) ], 'r-' );
      from = to;
    end
    label = string(1:ncity);
    text ( xy(:,1), xy(:,2), label );
  hold ( 'off' );
  filename = 'dantzig_xy.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  close ( )
  
  return
end

