function graph_adj_to_arc_test ( )

%*****************************************************************************80
%
%% graph_adj_to_arc_test() tests graph_adj_to_arc().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    13 April 2026
%
%  Author:
%
%    John Burkardt
%
  A = [ ...
    0,1,1,1,1,1,1,1,0,0,0,0,0; ...
    1,0,0,0,1,1,0,1,0,0,0,0,0; ...
    1,0,0,1,0,0,1,0,0,0,0,0,0; ...
    1,0,1,0,0,0,0,0,0,0,0,0,0; ...
    1,1,0,0,0,0,0,0,0,0,0,0,0; ...
    1,1,0,0,0,0,0,0,0,0,0,0,0; ...
    1,0,1,0,0,0,0,0,0,0,0,0,0; ...
    1,1,0,0,0,0,0,0,1,0,0,0,0; ...
    0,0,0,0,0,0,0,1,0,1,0,0,1; ...
    0,0,0,0,0,0,0,0,1,0,1,1,1; ...
    0,0,0,0,0,0,0,0,0,1,0,1,0; ...
    0,0,0,0,0,0,0,0,0,1,1,0,0; ...
    0,0,0,0,0,0,0,0,1,1,0,0,0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'graph_adj_to_arc_test():\n' );
  fprintf ( 1, '  graph_adj_to_arc() converts a graph adjacency\n' );
  fprintf ( 1, '  representation of a graph to an arc list.\n' );

  edge_num = sum ( sum ( A ) );
  node_num = size ( A, 1 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of nodes is %d\n', node_num );
  fprintf ( 1, '  Number of edges is %d\n', edge_num );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'The graph adjacency matrix:\n' );
  disp ( A );

  [ inode, jnode ] = graph_adj_to_arc ( A );

  knode = [ inode; jnode ]';
  fprintf ( 1, '\n' );
  fprintf ( 1, 'The arc list:\n' );
  disp ( knode );

  return
end
