function graph_adj_to_adj_list_test ( )

%*****************************************************************************80
%
%% graph_adj_to_adj_list_test() tests graph_adj_to_adj_list().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    27 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_adj_list_test():\n' );
  fprintf ( 1, '  graph_adj_to_adj_list() converts an adjacency matrix\n' );
  fprintf ( 1, '  to an adjacency 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 adjacency matrix:\n' );
  disp ( A );

  [ AP, AL ] = graph_adj_to_adj_list ( A );

  graph_adj_list_print ( 'The adjacency list', AP, AL );

  return
end
