separates                package:RBGL                R Documentation

_A _f_u_n_c_t_i_o_n _t_o _t_e_s_t _w_h_e_t_h_e_r _a _s_u_b_s_e_t _o_f _n_o_d_e_s _s_e_p_a_r_a_t_e_s
_t_w_o _o_t_h_e_r _s_u_b_s_e_t_s _o_f _n_o_d_e_s.

_D_e_s_c_r_i_p_t_i_o_n:

     The function tests to see whether a set of nodes, 'S1', separates 
     all nodes in 'a' from all nodes in 'a'.

_U_s_a_g_e:

     separates(a, b, S1, g)

_A_r_g_u_m_e_n_t_s:

       a: The names of the nodes in the from set. 

       b: The names of the nodes in the to set. 

      S1: The names of the nodes in the separation set. 

       g: An instance of the 'graph' class. All nodes named in the
          other arguments must be nodes of this graph. 

_D_e_t_a_i_l_s:

     The algorithm is quite simple. A subgraph is created by removing
     the nodes named in 'S1' from 'g'. Then all paths between elements
     of 'a' to elements of 'b' are tested for. If any path exists the
     function returns 'FALSE', otherwise it returns  'TRUE'.

_V_a_l_u_e:

     Either 'TRUE' or 'FALSE' depending on whether 'S1' separates 'a'
     from 'b' in 'g1'.

_A_u_t_h_o_r(_s):

     R. Gentleman

_R_e_f_e_r_e_n_c_e_s:

     S. Lauritzen, Graphical Models, OUP.

_S_e_e _A_l_s_o:

     'johnson.all.pairs.sp'

_E_x_a_m_p_l_e_s:

       km <- fromGXL(file(system.file("XML/kmstEx.gxl",package="RBGL")))
       separates("B", "A", "E", km)
       separates("B", "A", "C", km)

