transitive.closure            package:nem            R Documentation

_C_o_m_p_u_t_e_s _t_h_e _t_r_a_n_s_i_t_i_v_e _c_l_o_s_u_r_e _o_f _a _d_i_r_e_c_t_e_d _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the transitive closure of a graph. Introduces a direct
     edge whenever  there is a path between two nodes in a digraph.

_U_s_a_g_e:

     transitive.closure(g, mat=FALSE, loops=TRUE)

_A_r_g_u_m_e_n_t_s:

       g: graphNEL object or adjacency matrix.

     mat: convert result to adjacency matrix.

   loops: Add loops from each node to itself?

_D_e_t_a_i_l_s:

     This function calculates the transitive closure of a given graph.
     We use the matrix exponential to find the transitive closure.

_V_a_l_u_e:

     returns a graphNEL object or adjacency matrix

_A_u_t_h_o_r(_s):

     Florian Markowetz <URL: http://genomics.princeton.edu/~florian>

_S_e_e _A_l_s_o:

     'transitive.reduction'

_E_x_a_m_p_l_e_s:

        V <- LETTERS[1:3]
        edL <- list(A=list(edges="B"),B=list(edges="C"),C=list(edges=NULL))
        g <- new("graphNEL",nodes=V,edgeL=edL,edgemode="directed")
        gc <- transitive.closure(g,loops=FALSE)
         
        par(mfrow=c(1,2))
        plot(g,main="NOT transitively closed")
        plot(gc,main="transitively closed")

