transitive.reduction           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 _r_e_d_u_c_t_i_o_n _o_f _a _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     'transitive.reduction' removes direct edges, which can be
     explained by another path in the graph. Regulation directions 
     inferred via 'infer.edge.type' are taken into account.

_U_s_a_g_e:

     transitive.reduction(g)

_A_r_g_u_m_e_n_t_s:

       g: adjacency matrix

_D_e_t_a_i_l_s:

     'transitive.reduction' uses a modification of the classical
     algorithm from the Sedgewick book for computing transitive
     closures. The so-called "transitive reduction" is neither
     necessarily unique (only for DAGs) nor minimal in the number of
     edges (this could be improved).

_V_a_l_u_e:

     returns an adjacency matrix with shortcuts removed

_A_u_t_h_o_r(_s):

     Holger Froehlich

_R_e_f_e_r_e_n_c_e_s:

     R. Sedgewick, Algorithms, Pearson, 2002.

_S_e_e _A_l_s_o:

     'transitive.closure', 'infer.edge.type'

_E_x_a_m_p_l_e_s:

        V <- LETTERS[1:3]
        edL <- list(A=list(edges=c("B","C")),B=list(edges="C"),C=list(edges=NULL))
        gc <- new("graphNEL",nodes=V,edgeL=edL,edgemode="directed")
        g <- transitive.reduction(gc)
         
        par(mfrow=c(1,2))
        plot(gc,main="shortcut A->C")
        plot(as(g,"graphNEL"),main="shortcut removed")

