traverse Subroutine

recursive subroutine traverse(i)

travere the graph and visit all the connected nodes

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i

Called by

proc~~traverse~3~~CalledByGraph proc~traverse~3 problem_25::traverse proc~traverse~3->proc~traverse~3 program~problem_25 problem_25 program~problem_25->proc~traverse~3

Source Code

    recursive subroutine traverse(i)
        !! travere the graph and visit all the connected nodes
        integer,intent(in) :: i
        integer :: j
        if (visited(i)) return
        visited(i) = .true.
        do j = 1, size(graph(i)%connections)
            call traverse(graph(i)%connections(j))
        end do
    end subroutine traverse