function graph_adj_list_print ( title, AP, AL )

%*****************************************************************************80
%
%% graph_adj_list_print() prints an adjacency list.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    27 April 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string title: a title.
%
%    integer AP(node_num+1): the index of the first edge for each node.
%
%    integer AL(edge_num): the list of ending nodes for each edge.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  %s\n', title );
  fprintf ( 1, '\n' );

  node_num = length ( AP ) - 1;
  edge_num = length ( AL );

  for node_i = 1 : node_num
    fprintf ( 1, '  %2d:', node_i )
    
    for k = AP(node_i) : AP(node_i+1) - 1
      node_j = AL(k);
      fprintf ( 1, ' %2d', node_j );
    end 
    fprintf ( 1, '\n' );
  end

  return
end


