function graph_dist_min_span_tree_alternate_test ( )

%*****************************************************************************80
%
%% graph_dist_min_span_tree_alternate_test() tests graph_dist_min_span_tree().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    06 November 2024
%
%  Author:
%
%    John Burkardt
%
  nnode = 57;
  filename = '57_city_distances.txt';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'graph_dist_min_span_tree_alternate_test()\n' );
  fprintf ( 1, '  graph_dist_min_span_tree() finds a minimum \n' );
  fprintf ( 1, '  spanning tree.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Read distance data for 57 cities from file.\n' );
%
%  Read the data.
%
  dist = readtable ( filename );
  dist = table2array ( dist );
%
%  Compute the tree.
%
  [ itree, jtree ] = graph_dist_min_span_tree ( nnode, dist );
 
  for i = 1 : nnode - 1
    wtree(i) = dist(itree(i),jtree(i));
  end
 
  graph_arc_weight_print ( nnode-1, itree, jtree, wtree, '  The weighted tree:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The length of the minimal tree is %g\n', sum ( wtree ) );

  return
end
