subroutine digraph_arc_example_abc ( L ) !*****************************************************************************80 ! !! digraph_arc_example_abc() sets up the arc list associated with a network. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Output: ! ! integer L(3,2): the arc list. ! implicit none integer, parameter :: arc_num = 3 integer L(arc_num,2) L = reshape ( (/ & 1, 2, 3, & 2, 3, 1 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_example_abcd ( L ) !*****************************************************************************80 ! !! digraph_arc_example_abcd() sets up the arc list associated with a network. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Output: ! ! integer L(5,2): the arc list. ! implicit none integer, parameter :: arc_num = 5 integer L(arc_num,2) L = reshape ( (/ & 1, 2, 3, 3, 4, & 2, 3, 1, 4, 1 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_example_cycler ( L ) !*****************************************************************************80 ! !! digraph_arc_example_cycler() sets adjacency information for the cycler digraph. ! ! Diagram: ! ! A ! V ! 9--><--7---<--3--><---4 ! | /| / ! V A | / ! | / | / ! 5----<----1 V A ! | / | / ! V A | / ! | / |/ ! 2-->---8---<--6 ! \------>----/ ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 22 October 1999 ! ! Author: ! ! John Burkardt ! ! Output: ! ! integer L(16,2): the arc list ! implicit none integer, parameter :: arc_num = 16 integer L(arc_num,2) L = reshape ( (/ & 1, 1, 2, 2, 3, 3, 3, 4, 5, 6, 6, 7, 7, 8, 9, 9, & 3, 5, 6, 8, 4, 6, 7, 3, 2, 4, 8, 7, 9, 1, 5, 7 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_print ( L, arc_num, title ) !*****************************************************************************80 ! !! digraph_arc_print() prints out an arc list for a digraph. ! ! Discussion: ! ! This routine actually allows the entries to have ANY value. ! Values between 0 and 9 will be printed as is. Other values will ! be printed as '*'. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Input: ! ! integer L(arc_num,2): the arc list of a digraph. ! ! integer arc_num: the number of arcs. ! ! character ( len = * ) TITLE, a title. ! implicit none integer arc_num integer arc_id integer L(arc_num,2) character ( len = * ) title if ( len_trim ( title ) /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) trim ( title ) end if write ( *, '(a)' ) ' ' do arc_id = 1, arc_num write ( *, '(i2,a,i2,a,i2,a)' ) & arc_id, ': (', L(arc_id,1), ',', L(arc_id,2), ')' end do return end subroutine digraph_arc_example_five ( L ) !*****************************************************************************80 ! !! digraph_arc_example_five() sets up the arc list associated with a network. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Output: ! ! integer L(5,2): the arc list. ! implicit none integer, parameter :: arc_num = 5 integer L(arc_num,2) L = reshape ( (/ & 1, 2, 3, 4, 5, & 2, 5, 1, 1, 1 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_example_moler ( L ) !*****************************************************************************80 ! !! digraph_arc_example_moler() returns the arc list for Moler's example 3. ! ! Discussion: ! ! This matrix appears on page 5 of the reference. ! ! We added a self-link for node 5, which otherwise has no outlinks. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 10 April 2026 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Cleve Moler, ! Experiments with Matlab, ! Chapter 7: Google PageRank, ! https://www.mathworks.com/moler/exm/chapters/pagerank.pdf ! ! Output: ! ! integer L(10,2), the arc list. ! implicit none integer, parameter :: arc_num = 10 integer L(arc_num,2) L = reshape ( (/ & 1, 1, 2, 2, 3, 3, 3, 4, 5, 6, & 2, 6, 3, 4, 4, 5, 6, 1, 5, 1 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_example_sauer ( L ) !*****************************************************************************80 ! !! digraph_arc_example_sauer() sets up the arc list associated with a network. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Reference: ! ! Timothy Sauer, ! "How search engines rate page quality", ! Numerical Analysis, ! Pearson, 2006. ! ISBN: 0-321-2698-9, ! LC: QA297.S348 ! ! Output: ! ! integer L(34,2): the arc list. ! implicit none integer, parameter :: arc_num = 34 integer L(arc_num,2) L = reshape ( (/ & 5, 1, 3, 2, 4, 8, 2, 9, 3, 9, & 2, 12, 3, 12, 1, 13, 5, 6, 7, 9, & 14, 6, 7, 8, 12, 14, 4, 15, 10, 14, & 13, 15, 11, 14, & 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, & 7, 7, 8, 8, 9, 9, 10, 10, 10, 10, & 10, 11, 11, 11, 11, 11, 12, 12, 13, 13, & 14, 14, 15, 15 /), (/ arc_num, 2 /) ) return end subroutine digraph_arc_example_sixty ( L ) !*****************************************************************************80 ! !! digraph_arc_example_sixty() sets the arc list for the sixty digraph. ! ! Discussion: ! ! The nodes of the digraph are divisors of 60. There is a link from I to ! J if divisor I can be divided by divisor J. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! ! Output: ! ! integer L(54,2): the arc list. ! There is an arc from I to J if D(I) is divisible by D(J). ! implicit none integer, parameter :: arc_num = 54 integer, parameter :: node_num = 12 integer arc_id integer L(arc_num,2) integer d(node_num) integer i integer j d(1:12) = (/ 60, 30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1 /) arc_id = 0 do i = 1, node_num do j = 1, node_num if ( mod ( d(i), d(j) ) == 0 ) then arc_id = arc_id + 1 L(arc_id,1) = i L(arc_id,2) = j end if end do end do return end