function museum_digraph ( )

%*****************************************************************************80
%
%% museum_digraph plots a museum map as a directed graph.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 May 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'museum_digraph():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s:\n', version ( ) );
  fprintf ( 1, '  Map a museum in which all doors are one way only.\n' );
%
%  Define the directed edges.
%  S is the list of start nodes,
%  T are the terminal nodes.
%
  s = [ 1, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6,  7, 8, 8,  8,  9, 10, 10, 10, 10, ...
       11, 12, 13, 14, 15, 16 ];
  t = [ 2, 3, 4, 5, 5, 6, 6, 7, 6, 7, 8, 15, 7, 9, 10, 10, 11, 12, 13, 14, ...
       15, 15, 15, 15, 16,  1 ];
%
%  Create a digraph from S and T.
%
  G = digraph ( s, t );
%
%  Set up optional edge and node labels.
%
  eLabels = { ...
    '0.1', '0.9', ...
    '0.3', '0.4', '0.3', ...
    '0.6', '0.4', ...
    '1.0', ...
    '0.2', '0.8', ...
    '1.0' };

  nLabels = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', ...
    'M', 'N', 'O', 'P' };
%
%  Plot the digraph, and specify lots of options.
%
  plot ( G, ...
    'Layout', 'layered', ...
    'NodeLabel', nLabels, ...
    'NodeFontSize', 25, ...
    'LineWidth', 2, ...
    'MarkerSize', 10, ...
    'ArrowSize', 20 );

  title ( 'Museum with one-way doors', 'Fontsize', 16 );
%
%  Save a copy.
%
  filename = 'museum_digraph.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'museum_digraph:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
 
  return
end

