isAcyclic                package:ggm                R Documentation

_G_r_a_p_h _q_u_e_r_i_e_s

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

     Checks if a given graph is acyclic.

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

     isAcyclic(amat)

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

    amat: a square Boolean matrix with dimnames, the adjacency matrix
          of a graph.

_V_a_l_u_e:

     a logical value, 'TRUE' if the graph is acyclic and 'FALSE'
     otherwise.

_A_u_t_h_o_r(_s):

     Giovanni M. Marchetti

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

     Aho, A.V., Hopcroft, J.E. & Ullman, J.D. (1983). _Data structures
     and algorithms._ Reading: Addison-Wesley.

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

     ## A cyclic graph
     d <- matrix(0,3,3)
     rownames(d) <- colnames(d) <- c("x", "y", "z")
     d["x","y"] <- d["y", "z"] <- d["z", "x"] <- 1
     ## Test if the graph is acyclic
     isAcyclic(d)

