DFS                  package:graph                  R Documentation

_D_e_p_t_h _F_i_r_s_t _S_e_a_r_c_h

_D_e_s_c_r_i_p_t_i_o_n:

     This function implements algorithm 4.2.1 of Gross and Yellen. The
     input is a 'graph' and a 'node' to start from. It returns a
     standard vertex labeling of 'graph'. This is a vector with
     elements corresponding to the nodes of 'graph' and with values
     that correspond to point in the depth first search the node is
     visited.

_U_s_a_g_e:

     DFS(object, node, checkConn=FALSE)

_A_r_g_u_m_e_n_t_s:

  object: An instance of the 'graph' class. 

    node: A 'character' indicating the starting node. 

checkConn: A 'logical' indicating whether the connectivity of the graph
          should be checked. 

_D_e_t_a_i_l_s:

     This function implements algorithm 4.2.1 of Gross and Yellen.
     Specific details are given there.

     It requires that the graph be connected. This can be checked, but
     is expensive and is only done when requested.

     A faster and mostly likely better implementation of depth first
     searching is given by 'dfs' in the 'RBGL' package.

_V_a_l_u_e:

     A vector with names given by the nodes of 'graph' whose values are
     '0' to one less than the number of nodes. These indices indicate
     the point at which the node will be visited.

_A_u_t_h_o_r(_s):

     R. Gentleman

_R_e_f_e_r_e_n_c_e_s:

     _Graph Theory and its Applications_, J. Gross and J. Yellen.

_S_e_e _A_l_s_o:

     'boundary'

_E_x_a_m_p_l_e_s:

       RNGkind("Mersenne-Twister")
       set.seed(123)
       g1 <- randomGraph(letters[1:10], 1:4, p=.3)
       RNGkind()
       DFS(g1, "a")

