acc-methods              package:graph              R Documentation

_M_e_t_h_o_d_s _f_o_r _A_c_c_e_s_s_i_b_i_l_i_t_y _L_i_s_t_s

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

     This generic function takes an object that inherits from the
     'graph'  class and a node in that graph and returns a vector
     containing information about all other nodes that are accessible
     from the given node. The methods are vectorized so that 'index'
     can be a vector.

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

     ## S4 method for signature 'graph, character':
     acc(object, index)
     ## S4 method for signature 'clusterGraph, character':
     acc(object, index)

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

  object: An instance of the appropriate graph class.

   index: A character vector specifying the nodes for which
          accessibilty information is wanted.

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

     The methods should return a named list of integer vectors. The
     'names' of the list correspond to the names of the supplied nodes.
     For each element of the list the returned vector is named. The
     names of the vector elements correspond to the nodes that are
     accessible from the given node. The values in the vector indicate
     how many edges are between the given node and the node in the
     return vector.

_M_e_t_h_o_d_s:


     _o_b_j_e_c_t = _g_r_a_p_h An object of class graph.

     _o_b_j_e_c_t = _c_l_u_s_t_e_r_G_r_a_p_h An instance of the 'clusterGraph' class. 

     _i_n_d_e_x A 'character' vector of indices corresponding to nodes in
          the graph.  

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

      set.seed(123)
      gR3 <- randomGraph(LETTERS[1:10], M<-1:2, p=.5)
      acc(gR3, "A")
      acc(gR3, c("B", "D"))

