1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
\par
\section{Data Structure}
\par
There are four typed objects.
\begin{itemize}
\item
{\tt MSMD} : the main object.
\item
{\tt MSMDinfo} : an object that communicate parameter choices from
the caller to the {\tt MSMD} object and information and statistics
from the {\tt MSMD} object to the caller.
\item
{\tt MSMDstageInfo} : an object that contains statistics for a
stage of elimination, e.g., number of steps, number of vertices
eliminated, weight of vertices eliminated, etc.
\item
{\tt MSMDvtx} : an object that models a vertex.
\end{itemize}
A user needs to understand the {\tt MSMDinfo} object,
so this is where we will start our description.
\par
%-----------------------------------------------------------------------
\par
\subsection{{\tt MSMDinfo} : define your algorithm}
\par
\begin{itemize}
\item
{\tt int compressFlag} -- define initial and subsequent compressions of
the graph.
\par
We compress a graph using a checksum technique.
At some point in the elimination, vertices in the reach set (those
adjacent to vertices just eliminated) have a checksum based on
their adjacencies computed, and then vertices with the same
checksum are compared to see if they are indistinguishable.
This operation has a cost, and there are classes of vertices for
which there is a large amount of compression, and for other
classes there is little.
Compression is a powerful tool, but we need a way to control it.
\begin{itemize}
\item
{\tt compressFlag \% 4 == 0}
--- do not perform any compression after each elimination step.
\item
{\tt compressFlag \% 4 == 1}
--- after each elimination step, consider only those nodes that are
{\it 2-adjacent}, adjacent to two eliminated subtrees and having no
uncovered adjacent edges.
\item
{\tt compressFlag \% 4 == 2}
--- after each elimination step, consider all nodes.
\item
{\tt compressFlag / 4 >= 1} --- compress at stage zero before any
elimination.
\end{itemize}
The default value is {\tt 1}, no initial compression and
consider only 2-adjacent nodes after each elimination step.
\item
{\tt int prioType} ---
define the priority to choose a vertex to eliminate.
\begin{itemize}
\item
{\tt prioType == 0}
--- zero priority
\item
{\tt prioType == 1}
--- exact external degree for each vertex
\item
{\tt prioType == 2}
--- approximate external degree for each vertex
(${\hat d}$ from \cite{ame96-amd})
\item
{\tt prioType == 3}
--- exact external degree for 2-adjacent vertices, approximate
external degree for the others
\end{itemize}
The default value is {\tt 1}, exact external degree for each vertex.
\item
{\tt double stepType} --- define the elimination steps.
\begin{itemize}
\item
{\tt stepType == 0}
--- only one vertex of minimum priority is eliminated at each step,
e.g., as used in SPARSPAK's {\tt GENQMD}, YSMP's ordering,
and {\tt AMD} \cite{ame96-amd}.
\item
{\tt stepType == 1}
--- an independent set of vertices of minimum priority is eliminated
at each step, e.g., as used in GENMMD, multiple minimum degree.
\item
{\tt stepType > 1}
--- an independent set of vertices is eliminated whose priorities
lie between the minimum priority and the minimum priority
multiplied by {\tt stepType}.
\end{itemize}
The default value is {\tt 1}, multiple elimination of vertices with
minimum priority.
\item
{\tt int seed} --- a seed used for a random number generator, this
introduces a necessary random element to the ordering.
\item
{\tt int msglvl} -- message level for statistics, diagnostics and
monitoring. The default value is zero, no statistics.
Set {\tt msglvl} to one and get elimination monitoring.
Increase {\tt msglvl} slowly to get more mostly debug information.
\item
{\tt FILE *msgFile} -- message file, default is {\tt stdout}.
\item
{\tt int maxnbytes} -- maximum number of bytes used during the ordering.
\item
{\tt int nbytes} -- present number of bytes used during the ordering.
\item
{\tt int istage} -- present stage of elimination.
\item
{\tt int nstage} -- number of stages of elimination.
\item
{\tt MSMDstageInfo *stageInfo} -- pointer to vector of
{\tt MSMDstageInfo} structures that hold information about each
stage of the elimination.
\item
{\tt double totalCPU} -- total CPU to find the ordering.
\end{itemize}
%-----------------------------------------------------------------------
\par
\subsection{{\tt MSMD} : driver object}
\par
A user need not know anything about the internals of this object,
just the methods to initialize it, order the graph, and extract the
permutation vectors and/or a front tree.
\par
\begin{itemize}
\item
{\tt int nvtx} --- number of internal vertices in the graph.
\item
{\tt IIheap *heap} --
pointer to a {\tt IIheap} object that maintains the priority queue.
\item
{\tt IP *baseIP} -- pointer to the base {\tt IP} objects, used to hold
subtree lists
\item
{\tt IP *freeIP} -- pointer to the list of free {\tt IP} objects
\item
{\tt int incrIP} -- integer that holds the increment factor for the
{\tt IP} objects.
\item
{\tt MSMDvtx *vertices} -- pointer to vector of {\tt MSMDvtx}
objects that represent the vertices.
\item
{\tt IV ivtmpIV} -- {\tt IV} object that holds an integer temporary
vector.
\item
{\tt IV reachIV} -- {\tt IV} object that holds the reach vector.
\end{itemize}
\par
%-----------------------------------------------------------------------
\par
\subsection{{\tt MSMDstageInfo} : statistics object for a stage of
the elimination}
\par
This object stores information about the elimination process at a
stage of the elimination.
\par
\begin{itemize}
\item
{\tt int nstep} --- number of elimination steps in this stage
\item
{\tt int nfront} --- number of fronts created at this stage
\item
{\tt int welim} --- weight of the vertices eliminated at this stage
\item
{\tt int nfind} --- number of front indices
\item
{\tt int nzf} ---
number of factor entries (for a Cholesky factorization)
\item
{\tt double ops} ---
number of factor operations (for a Cholesky factorization)
\item
{\tt int nexact2} ---
number of exact degree updates to 2-adjacent vertices
\item
{\tt int nexact3} --- number of exact degree updates
to non-2-adjacent vertices
\item
{\tt int napprox} --- number of approximate degree updates
\item
{\tt int ncheck} --- number of comparisons of vertices with the same
checksum during the process to find indistinguishable nodes
\item
{\tt int nindst} --- number of indistinguishable nodes that were
detected.
\item
{\tt int noutmtch} --- number of nodes that were outmatched
\item
{\tt double cpu} --- elapsed CPU time for this stage of the elimination.
\end{itemize}
\par
%-----------------------------------------------------------------------
\par
\subsection{{\tt MSMDvtx} : vertex object}
\par
This object stores information for a vertex during the elimination.
\par
\begin{itemize}
\item
{\tt int id} --- id of the vertex, in range {\tt [0,nvtx)}
\item
{\tt char mark} --- character mark flag, {\tt 'O'} or {\tt 'X'}
\item
{\tt char status} --- character status of the vertex
\begin{itemize}
\item {\tt 'L'} -- eliminated leaf vertex
\item {\tt 'E'} -- eliminated interior vertex
\item {\tt 'O'} -- outmatched vertex
\item {\tt 'D'} -- vertex on degree (priority) heap
\item {\tt 'R'} -- vertex on reach set
\item {\tt 'I'} -- vertex found to be indistinguishable to another
\item {\tt 'B'} -- boundary vertex, to be eliminated in another stage
\end{itemize}
\item
{\tt int stage} --- stage of the vertex. Stage 0 nodes are
eliminated before stage 1 nodes, etc.
\item
{\tt int wght} --- weight of the vertex
\item
{\tt int nadj} --- size of the {\tt adj} vector
\item
{\tt int *adj} ---
for an uneliminated vertex, {\tt adj} points to a list
of uncovered adjacent edges; for an eliminated vertex, {\tt adj}
points points to a list of its boundary vertices (only valid when
the vertex is a leaf of the elimination tree or a root of a subtree
of uneliminated vertices).
\item
{\tt int bndwght} --- for an eliminated vertex, the weight of the
vertices on its boundary.
\item
{\tt MSMDvtx *par} --- for an eliminated vertex,
{\tt par} points to its parent vertex in the front tree
({\tt NULL} if the vertex is the root of a subtree).
For an indistinguishable vertex, {\tt par} points to its
representative vertex (which may have also been found to be
indistinguishable to another).
\item
{\tt IP *subtrees} --- pointer to a list of {\tt IP} objects to store
the adjacent subtrees, valid only for uneliminated vertices.
\end{itemize}
|