reduction             package:relations             R Documentation

_T_r_a_n_s_i_t_i_v_e _a_n_d _R_e_f_l_e_x_i_v_e _R_e_d_u_c_t_i_o_n

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

     Computes transitive and reflexive reduction of an endorelation.

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

     transitive_reduction(x)
     reflexive_reduction(x)
     ## S3 method for class 'relation':
     reduction(x, operation = c("transitive", "reflexive"), ...)

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

       x: an R object inheriting from class 'relation', representing an
          endorelation.

operation: character string indicating the kind of reduction.

     ...: currently not used.

_D_e_t_a_i_l_s:

     Let R be an endorelation on X and n be the number of elements in
     X.

     The _transitive reduction_ of R is the smallest relation R' on X
     so that the transitive closure of R' is the same than the
     transitive closure of R.  The function is implemented using a
     depth-first-search approach with complexity O(n^3).  Currently, it
     can only be used for crisp relations.

     The _reflexive reduction_ of R is computed by setting the diagonal
     of the incidence matrix to 0.

_R_e_f_e_r_e_n_c_e_s:

     S. Warshall (1962), A theorem on Boolean matrices. _Journal of the
     ACM_, *9*/1, 11-12.

_S_e_e _A_l_s_o:

     'relation', 'reflexive_reduction', 'transitive_reduction',
     'reduction'.

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

     R <- as.relation(1 : 5)
     relation_incidence(R)

     ## transitive closure/reduction
     RR <- transitive_reduction(R)
     relation_incidence(RR)
     R == transitive_closure(RR)

     ## same
     R == closure(reduction(R))

     ## reflexive closure/reduction

     RR <- reflexive_reduction(R)
     relation_incidence(RR)
     R == reflexive_closure(RR)
     ## same:
     R == closure(reduction(R, "reflexive"), "reflexive")

