EncodeDirectedGraph      package:GraphAlignment      R Documentation

_E_n_c_o_d_e _d_i_r_e_c_t_e_d _g_r_a_p_h

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

     Encode an adjacency matrix for a directed graph into a symmetric
     matrix.

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

     EncodeDirectedGraph(matrix, P)

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

  matrix: square matrix

       P: permutation vector

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

     This function encodes an adjacency matrix for a directed graph
     into a symmetric matrix. Currently only binary directed graphs are
     implemented. The adjacency matrix of a binary directed graph has
     elements 0, 1. The same graph can be represented by a symmetric
     adjacency matrix with elements -1, 0, 1, with the sign of the
     entry indicating the direction of the link. The result is obtained
     by setting entries (i, j) and (j, i) of the target matrix m' to 1
     if entry m[i, j] = 1 and P[i] > P[j] and to -1 if m[i, j] = 1 and
     P[j] > P[i].

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

     The return value is a symmetric matrix representing the encoded
     input matrix.

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

     Joern P. Meier, Michal Kolar, Ville Mustonen, Michael Laessig, and
     Johannes Berg

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

       dg <- matrix(c(0, 1, 0, 0, 1, 1, 1, 0, 1), 3, 3)
       EncodeDirectedGraph(dg, 1:dim(dg)[1])

