Ordering                package:RBGL                R Documentation

_C_o_m_p_u_t_e _v_e_r_t_e_x _o_r_d_e_r_i_n_g _f_o_r _a_n _u_n_d_i_r_e_c_t_e_d _g_r_a_p_h

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

     Compute vertex ordering for an undirected graph

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

     cuthill.mckee.ordering(g)
     min.degree.ordering(g, delta=0)
     sloan.ordering(g, w1=1, w2=2)

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

       g: an instance of the 'graph' class with 'edgemode' "undirected"

   delta: Multiple elimination control variable. If it is larger than
          or  equal to zero then multiple elimination is enabled. The
          value of delta  specifies the difference between the minimum
          degree and the degree of  vertices that are to be eliminated.

      w1: 

      w2: 

     {Heuristical weight for the Sloan algorithm }

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

     The goal of the Cuthill-Mckee (and reverse Cuthill-Mckee) ordering
     algorithm is to reduce the bandwidth of a graph by reordering the
     indices assigned to each vertex. The Cuthill-Mckee ordering
     algorithm works by a local minimization of the i-th bandwidths.
     The vertices are basically assigned a breadth-first search order,
     except that at each step, the adjacent vertices are placed in the
     queue in order of increasing degree. The minimum degree ordering
     algorithm is a fill-in reduction matrix reordering algorithm. When
     solving a system of equations such as A x = b using a sparse
     version of Cholesky factorization (which is a variant of Gaussian
     elimination for symmetric matrices), often times elements in the
     matrix that were once zero become non-zero due to the elimination
     process. This is what is referred to as "fill-in", and fill-in is
     bad because it makes the matrix less sparse and therefore consume
     more time and space in later stages of the elimintation and in
     computations that use the resulting factorization. Now it turns
     out that reordering the rows of a matrix can have a dramatic
     affect on the amount of fill-in that occurs. So instead of solving
     A x = b, we instead solve the reordered (but equivalent) system (P
     A PT)(P x) = P b. Finding the optimal ordering is an NP-complete
     problem (e.i., it can not be solved in a reasonable amount of
     time) so instead we just find an ordering that is "good enough"
     using heuristics. The minimum degree ordering algorithm is one
     such approach. A symmetric matrix A is typically represented with
     an undirected graph, however for this function we require the
     input to be a directed graph. Each nonzero matrix entry A(i, j)
     must be represented by two directed edges (e(i,j) and e(j,i)) in
     G. The goal of the Sloan ordering algorithm is to reduce the
     profile and the wavefront of a graph by reordering the indices
     assigned to each vertex. The Sloan algorithm needs a start and an
     end vertex. These vertices can be asigned manually. But there is
     also  an algorithm sloan-starting-nodes that provides usually
     quite good start and end vertices. Each vertex is asigned with a
     priority. This priority is a weighted sum of the distance of the
     vector to the end vertex (a global criterium) and is called the
     current degree of vertex. This current degree basically reflects
     the status of the renumbering in the neighborhood of a vertex (a
     local criterium). Therefore the Sloan algorithm (in contrast
     to-McKee) takes into account local as well as global criteria for
     the renumbering sequence. One can play around with the relative
     weights, but the default values proposed by Sloan
     (weight1/weight2=1/2) turn out to be pretty good in most cases.

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

cuthill.mckee.ordering: the vertices in the new ordering

min.degree.ordering: the vertices in the new ordering

sloan.ordering: the vertices in the new ordering

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

     Li Long <li.long@isb-sib.ch>

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

     Boost Graph Library by Siek et al.

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

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

     coex <- fromGXL(file(system.file("XML/dijkex.gxl",package="RBGL")))
     coex@edgemode <- "undirected"
     cuthill.mckee.ordering(coex)
     min.degree.ordering(coex)
     sloan.ordering(coex)

