function test_graph_arc_test ( )

%*****************************************************************************80
%
%% test_graph_arc_test() tests test_graph_arc().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    02 May 2026
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../test_graph_arc' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_graph_arc_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test test_graph_arc().\n' );

  graph_arc_print ( 'bush', @graph_arc_bush );
  graph_arc_print ( 'coxeter', @graph_arc_coxeter );
  graph_arc_print ( 'cube', @graph_arc_cube );
  graph_arc_print ( 'diamond', @graph_arc_diamond );
  graph_arc_print ( 'dodecahedron', @graph_arc_dodecahedron );
  m = 4;
  n = 5;
  graph_arc_print ( 'knight', @graph_arc_knight, m, n );
  graph_arc_print ( 'museum', @graph_arc_museum );
  graph_arc_print ( 'octahedron', @graph_arc_octahedron );
  graph_arc_print ( 'petersen', @graph_arc_petersen );
  graph_arc_print ( 'sauer', @graph_arc_sauer );
  graph_arc_print ( 'twig', @graph_arc_twig );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_graph_arc_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../test_graph_arc' );

  return
end
function graph_arc_print ( graph_title, graph_list, varargin )

%*****************************************************************************80
%
%% graph_arc_print() prints the arc list of a graph.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string graph_title: a title for the graph.
%
%    function: a function which returns the arc list of the graph.
%
%    vargin: optional inputs.
%    If only one input, this is the value of m, the number of rows and
%    columns of the knight graph checkerboard.
%    If two inputs, these are the values of m and n, the number of rows and
%    the number of columns of the knight graph checkerboard.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'graph_arc_print():\n' );
  fprintf ( 1, '  Print definition of "%s"\n', graph_title );

  if ( 2 == nargin )
    L = graph_list ( );
  elseif ( 3 == nargin )
    m = varargin{1};
    L = graph_list ( m, m );
  elseif ( 4 == nargin )
    m = varargin{1};
    n = varargin{2};
    L = graph_list ( m, n );
  end

  arc_num = size ( L, 1 );
  node_num = max ( max ( L ) );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  arc list L:\n' );
  disp ( L );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

