\HeaderA{Ordering}{Compute vertex ordering for an undirected graph}{Ordering}
\aliasA{cuthill.mckee.ordering}{Ordering}{cuthill.mckee.ordering}
\aliasA{kingOrdering}{Ordering}{kingOrdering}
\aliasA{minDegreeOrdering}{Ordering}{minDegreeOrdering}
\aliasA{sloan.ordering}{Ordering}{sloan.ordering}
\keyword{models}{Ordering}
\begin{Description}\relax
Compute vertex ordering for an undirected graph
\end{Description}
\begin{Usage}
\begin{verbatim}
cuthill.mckee.ordering(g)
minDegreeOrdering(g, delta=0)
sloan.ordering(g, w1=1, w2=2)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] an instance of the \code{graph} class with \code{edgemode}
\dQuote{undirected}
\item[\code{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.
\item[\code{w1}] 1st Heuristical weight for the Sloan algorithm 
\item[\code{w2}] 2nd Heuristical weight for the Sloan algorithm 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
According to the documentations on these algorithms in Boost Graph Library:

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 minimum degree ordering algorithm is a fill-in reduction matrix reordering
algorithm. 

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 goal of the King ordering algorithm is to reduce the bandwidth of a graph 
by reordering the indices assigned to each vertex.

See documentations on these algorithms in Boost Graph Library for more details.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{cuthill.mckee.ordering}] returns a list with elements:
\item[\code{reverse cuthill.mckee.ordering}] the vertices in the new ordering
\item[\code{original bandwidth}] bandwidth before reordering vertices
\item[\code{new bandwidth}] bandwidth after reordering of vertices
\item[\code{minDegreeOrdering}] return a list with elements:
\item[\code{inverse\_permutation}] the new vertex ordering, given as the mapping from the new indices to the old indices 
\item[\code{permutation}] the new vertex ordering, given as the mapping from the old indices to the new indices 
\item[\code{sloan.ordering}] returns a list with elements:
\item[\code{sloan.ordering}] the vertices in the new ordering
\item[\code{bandwidth}] bandwidth of the graph after reordering
\item[\code{profile}] profile of the graph after reordering
\item[\code{maxWavefront}] maxWavefront of the graph after reordering
\item[\code{aver.wavefront}] aver.wavefront of the graph after reordering
\item[\code{rms.wavefront}] rms.wavefront of the graph after reordering
\end{ldescription}
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{References}\relax
Boost Graph Library by Siek et al.
\end{References}
\begin{SeeAlso}\relax
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
coex <- fromGXL(file(system.file("XML/dijkex.gxl",package="RBGL"), open="r"))
coex <- ugraph(coex)
cuthill.mckee.ordering(coex)
minDegreeOrdering(coex)
sloan.ordering(coex)
\end{ExampleCode}
\end{Examples}

