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 'b'.

_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)

