function [ inode, jnode ] = digraph_adj_to_arc ( A )

%*****************************************************************************80
%
%% digraph_adj_to_arc() converts digraph from adjacency to arc list form.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    12 April 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer A(node_num,node_num), the adjacency information.
%    A(I,J) is 1 if there is a direct link from node I to node J.
%
%  Output:
%
%    integer inode(edge_num), jnode(edge_num), the arc list 
%    of the digraph.
%
  node_num = size ( A, 1 );
  edge_num = nnz ( A );
  inode = zeros ( edge_num, 1 );
  jnode = zeros ( edge_num, 1 );

  edge_id = 0;

  for j = 1 : node_num
    for i = 1 : node_num
      if ( A(i,j) ~= 0 )
        edge_id = edge_id + 1;
        inode(edge_id) = i;
        jnode(edge_id) = j;
      end
    end
  end

  return
end
