Chapter
1.
Introduction
is
less than
or
equal
to
3n.
The
amortized time
for any one
insertion
is at
most
3.
A
common class
of
graph algorithms consists
of
methods
for
traversing
the
nodes
and
edges
of a
graph.
The
depth-first
search
of a
graph
starts
at a
node
j and
finds
all
nodes reachable
from
node
.;'.
It
explores recursively
by
always examining
the
outgoing edges
of the
latest
node
i
just seen. When
all
edges
of i
have been
explored,
it
backtracks
to the
node
from
which
i was first
discovered. Nodes
are
marked
so
that
they
are not
searched twice.
The
time taken
by a
depth-first search
is
O(s + e),
where
s =
|Reach(i)|
and e is the
number
of
edges
in the
subgraph
induced
by s.
This subgraph
is
connected
by the way it is
constructed. Traversing
the
entire graph
in a
depth-first manner requires
the
traversal
to be
repeated until
all
nodes
are
visited.
A
depth-first search produces
a
list
of
nodes
of a DAG in
topological
order,
i
appears
before
j if i
^
j is a
path
in G.
The
breadth-first
search
traverses
a
graph
in a
different
order. Starting
at
node
i, it first
examines
all
nodes adjacent
to i.
Next,
it
examines
all
nodes
j
whose
shortest path
i
^
j is of
length
2,
then length
3, and so on.
Like
the
depth-first
search,
it too
traverses
all
nodes
in
Reach^).
Unlike
the
depth-first search,
it
traverses these nodes
in
order
of the
shortest
path
from
i, not in
topological order.
A
graph
is
denoted
as G or
Q,
and T
denotes
a
tree
or
forest.
S
denotes
the
element lists
in the
minimum
degree ordering algorithm, discussed
in
Chapter
7.
1.3
Further
reading
Golub
and Van
Loan
[114]
provide
an
in-depth
coverage
of
numerical linear
algebra
and
matrix computations
for
dense
and
structured matrices; Strang [193] gives
an
introduction
to
linear algebra.
Moler
[157] provides
an
introduction
to
numerical
computing
with
a
strong MATLAB
focus.
Stewart presents
an
in-depth look
at
matrix decompositions [190]
and
eigenvalue problems
[191].
Higham
[135] discusses
the
behavior
of
numerical algorithms
in finite
precision arithmetic.
Gormen,
Leiserson,
and
Rivest [23] discuss algorithms
and
data
structures
and
their analysis, including graph algorithms. Kernighan
and
Ritchie [141]
give
a
concise coverage
of the C
programming language. Higham
and
Higham [133],
Davis
and
Sigmon [38],
or the
online documentation
for
MATLAB
are
good places
to
learn more about
MATLAB.
The
books
by
Duff,
Erisman,
and
Reid [53]
and
George
and Liu
[89] both deal
with
direct methods
for
sparse matrices;
the
latter
focuses
on
symmetric positive
definite
matrices. Gilbert [101]
and Liu
[150] provide
an
overview
of
much
of the
graph
theory related
to
sparse direct methods. Stewart [192] provides
a
tutorial-
level
description
of
sparse
Cholesky. Gould,
Hu, and
Scott
[116]
survey
a
wide
range
of
software
packages
for the
factorization
of
sparse symmetric matrices. Iterative
methods
for
sparse linear systems
and the
incomplete factorization methods they
rely
on are
discussed
by
Saad
[178],
Greenbaum
[117],
and
Barrett
et
al.
[15].
Bjorck
[17]
presents direct
and
iterative methods
for
sparse least squares problems.
Parlett
[164]
provides
an
in-depth
look
at the
symmetric eigenvalue problem
for
sparse
matrices.
Demmel
[39] interleaves
a
discussion
of
numerical linear algebra with
a
description
of
related
software
for
sparse
and
dense problems.
6