compBijection             package:ScISI             R Documentation

_A _r_e_c_u_r_s_i_v_e _f_u_n_c_t_i_o_n _t_h_a_t _g_r_e_e_d_i_l_y _h_a_n_d_l_e_s _t_h_e _a_l_i_g_n_m_e_n_t _i_s_s_u_e

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

     This function takes a matrix of similarity measures (e.g. Jaccard
     Index) between the TSNMat and the estMat and finds the maximal
     value of this matrix and records its position (i,j). Then it
     matches C-i to K-j and then deletes row i and colunm j creating a
     matrix with one less row and one less colunm. The function calls
     itself recursively using this smaller matrix as the new argument.
     It stops when there are either no rows left or no columns left or
     the matrix of similarity measures is reduced to a 0-matrix and
     breaks from the recursive loop.

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

     compBijection(TSNMat, estMat, c2kMatrix, bijMat, counter = 1)

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

  TSNMat: The first bipartite graph matrix

  estMat: The second bipartite graph matrix

c2kMatrix: A matrix of similarity measure

  bijMat: A recording matrix to keep the alignment

 counter: A place keeping index

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

     The function creates a greedy matching between two bipartite
     graphs (where complexes C-i of the first bipartite graph matrix,
     bg1, is matched to complexes K-j of the second bipartite graph
     matrix, bg2). The particular greedy algorithm is as follows:

     1. When the function is called, the parameter c2kMatrix is parsed
     and the maximal element, m, is found. If m is not unique in the
     matrix, the function looks to every position where m occurs:
     (i,j)...(m,n). To chose a particular position, the size of the
     complexes are taken into consideration, i.e. the function compares
     the cardinalities of (C-i + K-j) ... (C-n + K-n). And the pair,
     wlog (i,j), of complexes with the largest cardinality is selected
     (if there is again a tie amongst cardinalities, then a random
     choice is made).

     2. The function matches C-i to K-j and records this alignment into
     bijMat. Row i and colunm j is deleted from c2kMatrix, creating a
     new matrix called c2kM.

     3. If the dimension of this matrix is nonzero or if the matrix
     itself has some nonzero element, the function recursively calls
     itself with the new argument, c2kM.

     4. Because the dimension is always decreased with every call, this
     function must terminate in some finite number of steps.

     5. bijMat will have recorded the greedily matched complexes
     between bg1 and bg2.

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

     A matrix with the rows recording the alignment: the first colunm
     records complexes of TSNMat; the second column records complexes
     of estMat; and the third column records the similarity measure.
     The rows will also denote the ordering of the matchings, i.e. row
     1 will denote the first match, etc.

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

     Tony Chiang

