ALGORITHMIC ASPECTS-OF VERTEX

ALGORITHMIC ASPECTS-OF VERTEX ELIMINATION
ON DIRECTED GRAPHS
bY
Donald J. Rose
Robert E. Tar jan
STAN-CS-75-531
NOVEMBER 1975
COMPUTER SC IENCE DEPARTMENT
School of Humanities and Sciences
STANFORD UNIVERSITY
ALGORITHMIC ASPECTS OF VERTEX ELIMINATION ON DIRECTED GRAPHS
*
Donald J. Rose -I
Applied Mathematics, Aiken Computation Laboratory
Harvard University, Harvard, Massachusetts 02138
**
Robert Endre Tarjan -I
Computer Science Department
Stanford University, Stanford, California 94305
c
Abstract
We consider a graph-theoretic elimination process which is related
to performing Gaussian elimination on sparse systems of linear equations.
We give efficient algorithms to:
(1)
calculate the fill-in produced by any elimination ordering;
-=.
(2) find a perfect elimination ordering if one exists; and
(3) find a minimal elimination ordering.
We also show that problems (1) and (2) are at least as time-consuming
as testing whether a directed graph is transitive, and that the problem
of finding a minimum ordering is NP-complete.
Keywords:
directed graph, elimination ordering, fill-in, Gaussian
elimination, NP-complete problem, perfect elimination graph,
sparse linear system.
*
f
Research partially su-pported by the Office of Naval Research under
contract ~000%67-A-0298-0034 at Harvard University.
El Research partially supported by a Miller Research Fellowship at
University of California, Berkeley; by National Science
Foundation, grant DCR72-03752 A02 and by the Office of Naval
Research contract NR 044-402. Reproduction in whole.or in part
is permitted for any purpose of the United States Government.
1
1.
Introduction and Notation.
A directed graph (digraph) is a pair G = (V,E) where V is a
elements called vertices and E c f(v,w) \ v,w EV,
finite set of n = \V\
-1
I
v # w] is a set of
c
Given veV , the set
-
ordered
vertex pairs called edges.
..
e = IEI
A(v) = {weV 1 (v,w) EE] is the set of vertices
adjacent out from v ; the set B(v) = [XV \ (u,v) EE] is the set
A(v) and B(v) are called the
of vertices adjacent into v .
\Nv) \ = do(v) is the out-degree
adjacency sets for vertex v .
\B(v) I = P(v) is the in-degree of v . The notation v -,w
of v ;
means weA ; v hw means wfA(v) . If W 2 V , the induced
subgraph
of G is the subgraph G(W) = (W,E(W)) where
G(W)
--.
L.
E(W)
=
CbY)
E
E
\
X,Y
4
l
For distinct vertices v,weV , a
p = [v = v1,v2, .."vk+l = w]
sequence of distinct vertices
v. 3v i+l
1
v,w path of length k is a
for i = 1,2,...,k .
A graph is strongly connected if there
is a path from every vertex to every other.
a sequence of distinct vertices
such that
A cycle of length k is
k = [v1’v2,““vk1
such that
v
i 3 vi+l
A graph is acyclic if it has no cycles.
for 1,2,...,k and vk --) v1 .
The transitive closure of graph G = (V,E) is the graph G" = (V,E+) ,
where
(v,w) eE+
to w in G .
transitive
forall
if and only if v f: w
A graph G is transitive if it is equal to its
G is transitive if and only if
closure. Equivalently,
u,v,w,
and there is a path from v
u-+v
and
vdw
togetherimply
u-rw
or
u=w.
A clique is a graph G = (V,E) with E = ((v,w) \ v,weV, v f w] .
For a graph G = (V,E) with IV\ = n , an ordering of V is a
Ga = (V,E,a) is an ordered graph.
bijection a: {1,2,...,n] * V .
2
c
For a vertex
v , the deficiency D(v) is the set of edges
defined by
D(v)
=
~(XYY)
\
x
-+
VY
v
+
YY
x
f,
The graph Gv = (V-b] Y E(V-{v)> UD(v>>
..
graph of G .
YY
x
+
Y]
l
is called the v-elimination
For an ordered graph Ga = (V,E,a) , the elimination
i
Process
P( Gal = [G = Ga,Gl,G2, . . ..Gnwl]
t
is the sequence of elimination graphs defined recursively by Go = G ,
1-1) a(i) for i = 1,2,...,n-1 . If Gi = (Vi,Ei) for
Gi = (G.
i = O,l,...,n-1 , the fill-in F(GQI) is defined by
--.
L
F(G,)
where
D i_lCa( i> 1
n-l
= U Di-l(a(i)I
i-l
is the deficiency of a(i)
elimination graph Gz
in
G i-l ' and the
is defined by
G; = (V, EUF(G&
.
The notion of vertex elimination arises in the solution of sparse
systems of linear equations by Gaussian elimination.
Given any nxn
matrix M = (mij) which represents the coefficients of a set of linear
equations, we can construct an ordered graph Ga = (V,E,a) , where
vertex
m
ij
f0
v
i
and
corresponds to row i , and (vi,vj) EE
i{j.
The unordered graph G = (V,E)
if and only if
corresponds to
the equivalence class of matrices PMPT , where P is any permutation
matrix.
If we solve the system with coefficients M using Gaussian
elimination, eliminating variables in the order 1,2,...,n , then the
edges
D
i-l
(v.)
1
correspond exactly to the new non-zero elements
created when row i
is eliminated (assuming no lucky cancellation
k
of non-zero elements).
see [lO,ll].
For further discussion of this correspondence,
To make the eliminat.ion process efficient, we might, for
example, like to create no more non-zero elements than necessary,
L
that is, to find an elimination ordering which minimizes the fill-in.
Given a graph G = (V,E) , an ordering a of V is a perfect
elimination ordering of G if F(Ga) = # .
i
ordering if u --) v, v ---) w,a
imply
L
u=w
or
u-+w.
-1
(u)
< min(a
-1
Thus a is a perfect
(v) ,&l(w)) together
A graph which has a perfect elimination
ordering is --. called a perfect elimination graph.
An ordering
a minimal elimination ordering of G if no other ordering @
F(Gp) = F&J
where the containment is proper.
Imp1 l < IF&J l
graph, since
l
Any elimination graph Gi
satisfies
is a perfect elimination
a is a perfect ordering of this graph.
ordering of a graph is minimum,
satisfies
An ordering a is a
minimum elimination ordering of G if no other ordering 8
t
a is
Any perfect
and any minimum ordering is minimal.
If a graph is a perfect elimination graph, any minimal ordering is
perfect.
A problem important in practice is that of finding a minimum
elimination ordering for any graph G . We shall show that this
*
problem is NP-complete. -I To balance this negative result, we give
polynomial-time algorithms for some simpler problems. We present
?Y
The so-called NP-complete problems are the hardest problems solvable
by non-deterministic Turing machines in polynomial time. Either all
the NP-complete problems have polynomial-time algorithms, or none of
them do. Such famous hard problems as the traveling salesman
problem, the satisfiability problem of propositional calculus, and
the maximum clique problem are NP-complete. See [2,6].
4
methods for
0)
computing the fill-in produced by any ordering a , in O(ne)
time;
(2) generating a perfect ordering, if one exists, in o(ne) time;
(3) generating a minimal ordering, in
(For all time bounds we assume
O(n 4 )
n<et-1,
time.
which holds for all graphs
that are at least weakly connected.)
We shall also show that any method for either (1) or (2) can be
L
used to test whether an arbitrary directed graph is transitive.
achieving a time bound of better than O(min(ne, n '081))
L
for either of
these problems would improve on the best bound known for Boolean matrix
multiplication [3].
0)'
L
Thus,
The restrictions to undirected graphs of problems
WY (3) h ave been considered in [12], which presents an
O(n+ er)
algorithm for (1) (where e'
an O(n+ e)
is the number of edges in Gz ),
u
algorithm for (2)' and an O(ne) algorithm for (3)
(Ohtsuki [9] has also devised an O(ne) algorithm for (3)).
L
This paper is divided into several sections. Section 2 contains
some properties of fill-in and elimination orderings which provide a
basis for the algorithms.
algorithms.
Section 2 also informally describes the
Section 3 contains implementations of the algorithms and
analyses of their running times.
Section 4 describes relationships
among problems (1)' (2)' and the transitive closure problem, and between
the minimum ordering problem and the NP-complete problems.
2.
Properties of Fill-in and Elimination Orderings.
Our first result characterizes the fill-in produced by any
i
elimination ordering.
L-al.
c
Let G = (V,E,a) be an ordered digraph.
Then
(v,w)
is
an edge of Gi = (V,EUF(G~)) if and only if there exists a path
p=[v=v f5’
(1)
l
l
dk+l
= w] in Ga such that
CC1(vi) < min(CX-l(v),CX-l(w))
Proof.
for
2<i<k.
- -
We show by induction on 1 = min(a -1 (~),a -1 (w))
that, given
any edge (v,w) in Gz , there exists a path from v to w with
the required property (1). If I = 1 , (v,w) is in G and (1)
holds vacuously.
let
c
1 = ao+l .
Otherwise
Suppose the result holds for all l,< 1 ,< lo and
If
v-'w
in G then (1) again holds vacuously.
and we have by the definition of F(G,) an
(VYW> E F(G,)
xeV with C?(x) < min(c?(v),&w))
and v --,x ,
x 4 w in G*
a
l
The induction hypothesis implies the existence of v,x and x,w
c
paths in Ga
required
satisfying (1) and combining these paths gives the
v,w
path.
The converse is established by induction on k , the length of p .
c
If
k=l,
all
k-<ko
v-'w
in
and let k =
be a path in Ga
trivially.
Gi
ko
+l .
Suppose the converse holds for
Let p = [v = vl,v2,~~~,vk+l = w]
satisfying (1) and choose x = v.
1
such that
&Vi) = max(&vj) \ 2 ,< j 5 k) . The induction hypothesis implies
*
*
that v 4 x and x ---) w in G
a ' hence v -rw in G
l
c
a
6
l
l
We can use this lemma as the basis of an O(ne) time algorithm
for computing the fill-in produced by any ordering a . It is
i
sometimes more efficient, however, to compute the fill-in directly.
If
v
and
w
are any vertices,
or there isa
(v,w) EE
(v,w) eEUF if and only if either
such that 8(u) < mir&(v),a-l(w)) ,
u
We can compute the fill-in edges
-I
b’W> ’ in increasing order on the value of (X-~(V) , by using this
(v,u) EEUF, and
observation.
(uyw) EEUF
l
This method of computation is called row elimination
or Doolittle elimination [4] when it is used to carry out numeric,
rather than symbolic, Gaussian elimination.
L
algorithms for computing fill-in, one based on this direct method and
--.
one based on Lemma 1.
Lemma2.
L
Section 3 discusses two
Let G = (V,E) be a perfect elimination graph, with perfect
ordering a .
Let xeV and let Gr = (V, EUD(x)) . Then Q! is a
perfect elimination ordering of G' .
Proof.
c
We must show that given w + y ,
y+z
in
We must consider three cases. If (w,y),(y,z) EE ,
I
with w # z
, it follows that w -+ z in G' .
and a-'(y) < min(&w),&z))
a is perfect.
Gr
(w,z) EE since
If (~,y),(y,z) ED(X) , then w --) x , x 3 z in G
and (w,z) cEUD(x) . The last case is (w,y) EE , (y,z) ED(X)
(or equivalently (w,y) ED(X) , (y,z) EE ). In this case y + x ,
x4z
c
in
G
and
ybz
in
If w=x,then (w,z)~E.
-1
-1
Otherwise (i.e., if w { x ), a (x) >Q (y) since a is perfect,
and w 4 x in G , also since
in G imply (w,z)
G.
CX is perfect.
EE UD(x) . 0
c
7
But w 4x ,
x4z
Corollary 1.
If G = (V,E)
is a perfect elimination graph and x
is any vertex, the x-elimination graph Gx = (V-{x], E(v-(x)) UD(x)]
is also a perfect elimination graph.
Corollary 2.
i
c
is a perfect elimination graph and x
is any vertex with D(x) = $ , there is a perfect elimination ordering
a with
c
If G = (V,E)
a(l) =x.
Corollary 2 implies the correctness of the following algorithm
for finding a perfect ordering if one exists.
algorithm PERFECT(G): bs
i :=--. 0;
while G has some vertex v with D(v) = @ do begin
NVi := i+l;
a(i) := v;
delete v and all incident edges from G;
end end PERFECT;
NCNIf this algorithm succeeds in ordering all the vertices,
perfect; if not,
G is not perfect.
G
is
Section 3 gives an O(ne) time
implementation of this algorithm.
Our next results give properties of minimal orderings. Let
G = (V,E) be a graph.
A set F of edges is a fill-in for G if
EnF =@ and G'=(V,EUF)
is a perfect elimination graph.
F is a minimal fill-in if no set
c
c
is a perfect elimination graph.
F. C F is such that Go = (V, EUFO)
Lemma3.
Let G = (V,E) be a perfect elimination graph. Suppose
is a fill-in for G .
FM
that Gf-f = (V,EUF-{f))
Let
.
Then
is perfect elimination (i.e.,
a fill-in).
Proof.
G' =(V,EUF)
3feF
such
F-(f)
is
..
We prove the lemma by induction on n = 1~1 . If n <- 2 ,
the result is obvious since any graph with one or two vertices is
perfect elimination.
L
Suppose the result is true for all n ,< no and
let n = no+1 . Let R = (x 1 D(X) = $$) where D(x)
in G and let S = [x 1 D'(X) = @) where
in G' .
L
D'(x) is the definiciency
We know R # fl and S # fi . We must consider two cases.
--.
(i)
For
some
x63 there exists an edge
or f = (x,u) .
feF of the form f = (u,x)
By Corollary 2 there is a perfect elimination
order 8 for Gr with ~(1) = x .
b
is the deficiency
Then f3 is also a perfect
order for G'-f .
(ii) Case (i) does not hold. We prove 3xeS with F &D(x) .
any
c
ZES .
If FQW ’ let x = z .
Otherwise, since
D(Z) C, F , F = D(z) . In this case, let x be any vertex in R .
By Corollary 2, there is a perfect ordering
a(1) = x ' and by Lemma 2,
c
Pick
Thus x& . Since
Now
cx of G such that
a is a perfect ordering of G' .
D(x) =
@
’
F
g
D(x)
Gx = (V-{X}~ E(V-(x]> UD(x>) and G-3; =
are perfect elimination by Corollary 1.
l
(V-(x),E(V-{x))~JFuD(x))
By the induction hypothesis
L
3f EF-D(X) such that Gx-f is perfect elimination. But then G*-f
is perfect elimination since
L
f/D(x)
Lemma 3 gives the following theorem.
9
c
l
c]
Theorem 1.
Let G = (V,E,a) be an ordered graph. Then a is a
minimal elimination ordering if and only if for each
G;-f = (V, EUF(G,)-{f])
Suppose G = (V,E)
L
-(G,) I
is not perfect elimination.
is a graph and
F is a fill-in for G .
Lemmas 2 and 3 lead to the following recursive procedure for finding
a minimal fill-in F. c- F .
c
WMINFILL (VyE,F,Fo); begin
declare FlyF2 set variables= to procedure MINFILL;
EG = (V,E) has no vertex x with D(x) c F then F
-0 := F
L
else begin
Nyvv-.m.
let x be a vertex with D(x) c F;
call 1: MINFILL (V-[x},E(V-{x}) UD(x),F(V-(x))-D(x),Fl);
ED(x) = #
else begin
c
call Gmz (V, EUFl,D(x),F2);
F. := yJF2;
end end end MINFILL;
NW-It is not hard to see that this procedure works correctly: If
every vertex x
vertex
x
has
has D(x) = F then F is clearly minimal. If some
D(x)cF , then the first recursive call on MINFILL
produces a fill-in
Fl -C F minimal for Gx .
minimal for G by Corollary 2.
If' D(x) = fl , Fl is
If D(x) # fl , then for all proper
subsets Fi C Fl and all subsets F2 c- D(X) ,
G" = (V, EUFiUF2)
is not a perfect elimination graph by Lemma 2 and Corollary 2.
if F2 CD(x)
is a minimal fill-in for G" = (V, EUFl) , then
FlUF2
is a minimal fill-in for G .
10
Thus,
IL-
(':mbining MU!1 I~'lr,l, with the algorithms for computing fill-in
and finding a perfect ordering,
find a minimal ordering.
it is easy to build an algorithm to
Section 3 contains such an algorithm,
i.mplemented so that it runs in
O(n2e')
time, where
e' = IEUF\ .
We conclude this section with a lemma proved in [5] giving a
L.-
necessary condition for a graph to be perfect elimination.
We shall
use the lemma in Section 4.
c.
Lemma 4 (Haskins and Rose [5])*
graph
i
i
l
Then for every set
Let G be a perfect elimination
X of k > 2 vertices there is a subset
Y of k-l vertices such that any cycle on
--.
is a cycle on Y .
X has a subsequence which
3.
Implementation and Complexity of the Algorithms.
Fill-in.
To calculate the fill-in produced by an ordering a using Lemma 1
we must find the vertices w
..
reachable from each vertex
whose intermediate vertices satisfy (1).
a fixed vertex v
from v .
L
v by a path
To find paths which start at
and have this property, we conduct a search starting
First we allow the search to pass through only the vertex
of lowest elimination number.
Then we extend the search through
vertices of second lowest number, third lowest number, and so on.
i
In this way we can find appropriate paths efficiently. A program to
-.e.
implement this method appears below in Algal-like notation. Given an
ordered digraph
Ga = (V,E,CX) with adjacency list A(v) for each WV ,
*
it calculates the edges in G .
a
12
e
Algorithm FILL1 (G,): bs
zi := lmunnd&ba
v= a(i) ;
aj := 1 e n NVdo begin
..
reach(j) := #;
mark(j) := ,f*;
L
end;
zk(i) := ts
Ew EA(v) do
begin
-mark@(w)) := *;
c
add w to reach (6'(w));
mark (v,w) as an edge of Gi;
2;
c
search:
:= 1 mun i-l do
while
reach(j) h #do
begin
--delete a vertex w from reach(j);
-1
begin
E z CA(W) sg -I mark@ (z)) then
-mark (a-'(z)) := true;
l
if a-'(z) > j thexgin
---=Iadd z to reach (a (z));
mark (v,z) as an edge of Gz;
c
end else add z to reach(j);
lvvvend end end FILLl;
mmIt is easy to show, using Lemma 1, that this algorithm correctly
calculates the fill-in produced by a .
of statement search
mark(v)
The time required per execution
is O(e) since each vertex v can only have
set true once and thus each edge can only be examined once.
The total time for algorithm FILL1 is thus O(ne) . FILL1 requires
O(e) storage space, plus space for the output.
For graphs with a small number of edges but a large fill-in,
FILL1 is an efficient way to compute the fill-in.
13
For graphs with
smaller fill-in, it is more efficient to use a direct method based
on the observation following Lemma 1.
The only tricky part of such
an algorithm is avoiding adding edges to the fill-in twice.
To handle
this difficulty, we use a bit vector fill(j) which records, for some
current value of i , whether
e
(a(i)ya(j>>
has b een added as a fill-in
edge.
algorithm FILL2 (G,): bs
Ej := lmunn do- fill(j) := m
c
for i := 2 murxn ado
" " " '" " " " begin
list := $8;
E (a(i),w) EE S&B
fiAl(O?(w)) := t2;
x c2(w) < i then add w to list;
end;
while
list f fl do
begin
--rcNIcw
delete some w from list;
-I
7
z (w,y) EE UF with a-"(w) < a-'(y) do-1
if lfill(a
(y)) then
begin
-add (a(i),y) to F;
if a-'(y) < i then add y to list;
end end
f&T(z) EEUF gk~ fill@?(w))
:= E;
end end FILL2;
-It is immediate that this algorithm correctly computes the fill-in
F produced by an ordering a .
where
e' = IEUF~ .
FILL
0
(er)
storage space,
To estimate the time requirements of FILL2, let
dl(v) = ((v,w) eEUF 1 Q+(V) > a-'(w))
d2!v)
requires
and let
= ((v,w) EE U F I a-'(v) < C?(W)) . Then FILL2 requires
er + c dl(v)'d2(v)
VEV
>
time.
1
14
Algorithm FILL2 has the advantage that its computation time is
i
proportionalto the number of arithmetic operations necessary to do
numeric Gaussian elimination.
Thus FILL2 can be used to precompute
the fill-in for a numeric equation solver at a cost of only a constant,
factor in the running time.
(See [16].) This is not necessarily true
of FILLl. However, for sparse graphs or graphs with large fill-in
algorithm FILL1 is more efficient.
c
Perfect Orderings.
To implement the perfect ordering algorithm so that it is
c
efficient, we need lists to keep track of the deficiencies of each
vertex.
We use the following lists. For each VEV , D(v) is a
list of triples
of v .
(X'V'Y)
For each XEV ,
of a triple of the form
such that (x,y) is in the deficiency
L(x) contains one pointer to each occurrence
(x,v,y) in some D(v) , and one pointer to
each occurrence of a triple of the form (y,v,x) in some D(v) .
When a vertex x
is deleted from the graph, we use
L(x) to update
the deficiency lists of the vertices.' We need two other variables:
is a Boolean array used to help initialize the
a(v)
and N is a list of the vertices
D
and
L
lists,
v with D(v) = # .
Until N=# , the algorithm must carry out the following steps:
find a vertex in N ; delete it and its incident edges from the graph;
and update the
D lists appropriately.
below.
15
c
An implementation is presented
algorithm PERFECT(G); b*
f=veV gb&D(v) := L(v) := $; a(v) := false
end;
-N := $8;
comment
compute initial deficiencies;
._
init: gu~v &b&
L
zw EA(u) ds
44 := tz;
E v CA(U) g
for-wt-A(v) $o- El a(w) ar& (w { u) t-badd triple (u,v,w) to D(v);
add to lists L(u) and L(w) pointers to this triple (u,v,w);
L
end;
z w EA(u) & a(w) := e
en&;
c
comment
initialize list of deletable vertices;
EVEV ggD(v) := # t&add v to N;
e delete as many vertices as possible;
i := 0;
delete: y*N { @ do
begin
-delete some vertex u from N;
a-3 U 1 := i := i+l;
a(i) := u;
update: E p EL(U) NVdo begin
delete from D(v) the triple (x,v,y) at which p points,
if this triple has not been deleted already;
if D(v) = # then add v to N;
end end;
NWcomment
if i := n then G is a perfect elimination graph;
otherwise G is not a perfect elimination graph;
end PERFECT;
This program clearly implements algorithm PERFECT correctly. We
analyze the running time of the program.
c
program spends
w+ do(v))
For each edge
(u'V> ' f2-E
t ime in the initialization loop
16
init .
The total time spent in
init is thus
0
.
n+ e+ c dI(v) do(v)
WV
Since all the entries in the D and L lists are created in init ,
and each vertex is added to N at most once, the total storage
requirements of PERFECT are
spent executing statement
0
n+ e+ c dI(v) do(v)
vcv
delete
is
0
since the amount of time spent in update
c
. The time
n+ e+ c d,(v) do(v)
VEV
>
is proportionalto the
number of entries in the D and L lists, and the amount of time
spent in delete outside of update is O(n) . Thus PERFECT requires
0
n+ e+ c dI(v) do(v)
VEV
>
time total.
Since do(v) <n for all v
and c dI(v) = e , the running time is O(ne) . If d,(v)+ do(v) <- d
VEV
for all vertices, the bound is O(nd2) .
If storage space is at a
premium, PERFECT can be implemented to run in O(n+e) space and O(n2e)
time.
Minimal Orderings.
i
We can use procedure MINFILL in combination with FILL and PERFECT
to compute a minimal ordering for any graph. Given a graph G = (V,E)
we choose any ordering
CX and calculate its fill-in F = F(G,)
using
i
FILL.
Next, we compute certain sets which MINFILL needs for its
calculations.
c
These include the deficiency D(x) in Gz
for each
vertex x , the set DF(x) = ((u,v) I u 4 x,x 3 v in Gz, u # v, and
b' 4
is a fill-in edge) for each x , and certain lists necessary
for updating the graph and the sets D(x) and DF(x) . Then we apply
c
MINFILL(F)
l
MINFILL(F) is coded as a recursive procedure which,
17
L
given a graph G = (V,E) and a fill-in F , finds a minimal fill-in
F. C F and updates G to include the edges in F. . Once a minimal
c
fill-in
of
is found, we apply PERFECT to find a perfect ordering @
F.
G' = (V,EUFO)
l
This ordering is a minimal ordering of the
..
original graph G .
An outline of the algorithm appears below.
algorithm MINIMAL(V,E); begin
MINFILL(Gs
delete:
we some undeleted vertex x has D(x) = @ and 3 an edge
(u,x) or (x,u) in F do
delete all edges (u,x) or (x,u) from F, updating
lists representing graph accordingly;
split:
E some undeleted vertex x has (D(x) = @) g (DF(x) c I?)
--then
begin
-delete edges in DF(x) from fill-in and add to graph
temporarily;
delete x and incident edges from graph;
F := F-DF(x);
call 1:
MINFILL(F);
add x and incident edges to graph;
gDF(x) { fl then
begin
-delete edges in DF(x) from graph and add to fill-in;
F := DF(x);
call 2: MINFILL(F);
end end else add all edges in F to F. and to graph, and
--setF:= $ ;
end MINFILL;
find any ordering a of vertices V;
compute fill-in F = F(G,) using FILL(Gol);
compute initial deficiencies;
F. := PI ;
MINFILL(F);
18
comment
as MINFILL executes, it adds to FO and to the graph
edges which are found to be in a minimal fill-in;
find a perfect ordering p of graph GO = (V, EUFO) using
PERFECT(G0);
B ,!3 is a minimal ordering of G;
..
end MINIMAL;
We still need to fill in the details of this algorithm and to
estimate its time and space requirements.
L
The tricky part of the
implementation is representing the deficiencies so that they are easy
We use various lists similar to those used in PERFECT; we
to update.
need extra lists here since we must keep track of the fill-in edges.
c
For each v<V ,
A(v) and B(v) are adjacency
and A'(v) and B'(v) are adjacency
M(v,w) is an n xn
e
Mbv)
c
EUF,
(u,w)
lists for v
in
G' =(v,EUF)
.
matrix such that M(v,w) = 0 if (v,w)bEUF ,
= 1 if (v,w) EF ., and M(v,w) = 2 if (v,w) EE . For each
vertex v ,
in
lists for v in G ,
D(v) is a list of edges (u,w)
v -,w
u /= w ) and u /+w in EUF . DF(v) is a list of edges
such that u 3 v ,
pb,w)
such that u 4 v ,
VOW
in
EUF,
u # w 9 and (u,w) EF .
is an array of pointers such that P(u,v,w) = 0 if
(J&W) bD(v) UDF(v) otherwise. For each veV , g(v) = true if v has
not been deleted from the graph;
false if v has been deleted.
g(v) = -
Below is an implementation of MINIMAL which uses these data
structures.
c
19
algorithm MINIMAL(G): s
procedure MINFILL(F); bs
delete:
WE some vertex x has g(x) and (D(x) = @) and
((A'(x)-A(x)) U (B'(x)-B(x):@) do begin-s delete edges in fill-in which are incident
to x from graph;
for (u,v) E (A'(X)-A(X)) U(B' (X)-B(X)) do begin
,- F := F-{(u,v)];
M(u,v) = 0;
for ~~3.7 -do if g(w) then
begin
-g P(u,v,w) k 0 then begin
delete corresztizry in D(v) UDF(v);
P(u,v,w) := 0;
end;
if P(w,u,v) # 0 then begin
Ivv delete correslp‘;;E;;;izry in D(u) UDF(u);
P(w,u,v) := 0;
end end end;
--MN
for (u,v) E @'(X)-A(X)) u(Bf(x)-B(X)) do
EWEV gg (M(u,w) > 0) s (M(w;) > 0)
then begin
Nvwdelete entry (u,v) from DF(w) using pointer
pb, WY v> ;
add entry (u,v) to D(w) and put a pointer to
this entry in P(u,w,v);
delete (u,v) from A'(u) and B'(v);
end;
split:
end delete;
if some vertex x has g (x) and (D(x) = @)
then begin
-comment
delete edges in DF(x) from fill-in and add to
graph temporarily;
comment also delete x and incident edges;
E (u,v) CA(X) UB(x) do-M(u,v) := 0;
z (u,v) EDF(x) &+M(u,v) := 2;
20
for distinct u,v,w~V such that (g(u) = g(v) = g(w) =
tr& and
do
- XE(U,W] if P(u,v,w) { 0 then begin
Adelete corresztizry from D(v) UDF(v);
I
P(u,v,w) :*7 0;
end;
g(x) := e;
E (u,v) EDF(x) do
for weV do
L-
and (w f x) and
begin
.- g(w) then
M/W<delete corresponding entry from DF(w);
c
P(u,v,w) := 0;
end;
F := F=(x);
i
--.
call 1:
MINFILL(F);
comment
restore x and incident edges to graph;
comment
delete edges in DF(x) from graph and add
to fill-in;
L
g(x) := true;
f& (u,;=(x) UB(x) do-M(u,v) := 2;
for (u,v) EDF(x) zM(u,v) := 1;
ff distinct u,v,w EV such that x E (u,w] 2 (u,w) EDF
a& (x # v>> g
if M(u,v) > 0 and M(v,w) > 0 then begin
gM(u,w) = 0 s add (u,zoG and
put a pointer to this entry in P(u,v,w);
c
gM(u,w) = 1 tz add (u,w) to DF(v) and put
a pointer to this entry in P(u,v,w);
end;
call 2:
gzx) + $8 tg$in- F := DF(x); MINFILL(F) e&;
end else for (u,v) E F do begin
-/cNw-comment F is a minimal fill-in;
comment
add edges in F to F and to graph;
0
comment delete all edges from fill-in;
21
M(u,v) := 2;
2WEV zg P(u,w,v) # 0 -in+
delete corresponding entry from DF(v);
P(u,w,v) := 0;
end;
add (u,v) to F. -and to E;
add v to A(u);
L
add u to B(v);
F := fl ;
end E;
c
end MIGLL;
find any ordering a of vertices V;
compute fill-in F = F(Ga) using FILL(G,);
comment initialization;
I
compute matrix M(v,w);
for WV g D(v) := DF(v) := @;
for u,v,w EV do
begin
-g (M(u,v);O) ar& (M( v,w) > 0) a& (u f: w) then
-if M(u,w) = 0 then add (u,w) to D(v) and put a pointer
to this entzn P(u,v,w)
else if M(u,w) = ltz add (u,w) to DF(v) and put a
-pointer to this entry in P(u,v,w)
L
* P(u,v,w) := 0;
end else P(u,v,w) := 0;
-Fo:= # ;
$r- VEV do- g(v) := t=;
e
MINFILL(F);
find a perfect ordering p of Go = (V, E UFO) using PERFECT(GO);
comment p is a minimal ordering of G;
end MINIMAL;
A few observations help in seeing that this program correctly
implements MINFILL.
Matrix M and Boolean array g always encode
the current graph, with deleted vertices excluded.
22
Every deleted
vertex has all its incident edges in
E (not in F ) when it is deleted.
When a vertex is deleted, the value of DF(x) is left intact, as are
all pointers of the form
PbYXYW)
l
This gives us a place to save
DW Y and makes updating the graph after
call 1 easier.
The graph
updating throughout the program is straightforward.
It is an interesting exercise to figure out the resource requirements
of the algorithm.
Let
e1
be the number of edges in the graph Gz
a is the arbitrary ordering selected initially.
where
We shall show that the
total number of calls on MINFILL is O(er) , the maximum depth of nested
calls on MINFILL is O(n) , and MINIMAL uses O(n3) space and O(n*e')
time.
We make several observations which lead to these bounds. First,
--.
the time spent in MINIMAL outside of MINFILL is clearly O(n 3 ) . Also,
the storage required, not counting storage for the procedure parameter
F in MINFILL, is clearly
O(n 3 ) .
Now consider the nested recursive calls on procedure MINFILL.
Either a procedure call MINFILL(F) is a bottom-level call on MINFIL or
it leads to two nested calls MINFILL(F') and MINFILL(F"), where
F' = F-DF(x) f $8 and F" = DF(x) { # .
Thus the nested calls on
MINFILL may be represented as a binary tree. The topmost vertex of
the tree corresponds to the outer call MINFILL(F(G,)) . Each leaf
of the tree corresponds to an innermost call on MINFILL.
.
If
Fl,F2,.=.,Fk
are the values of the parameters in these innermost calls, then
FinFj = $ and Fi 5 F(Ga) for all i, j . Since
IF(Ga) 1 -c e' Y
k < e' , and the total number of calls on MINFILL is O(e') .
Consider the depth of nested calls on MINFILL. Suppose the call
MINFILL(F) leads to a call MINFILL(F') with F' = F-DF(x) by
23
statement
call 1 with F' = F-DF(x) and to a callMINFILL(F")
with F" = DF(x) by statement call 2 .
Suppose we name x the
splitting vertex for the call MINFILL(F). Vertex x is absent from
all graphs considered during the execution of MINFILL(F'). The
fill-in is always contained within DF(x) for all graphs G1
considered during the execution of MINFILL(F"). Thus x cannot
be a splitting vertex for the calls MINFILL(F'), MINFILL(F"), or any
calls nested within them.
It follows that each nested call on MINFILL
has a different splitting vertex (unless it is an innermost call with
no splitting vertex) and the maximum depth of nested calls on MINFILL
is
o(n)
l
--_
Since parameter storage space for one call on MINFILL is O(n2) ,
the total parameter storage requirements for nested calls on MINFILL
are O(n3) , and the total storage required by MINIMAL is
O(n') .
Consider the time used during one call on MINFILL, not counting
time spent in nested calls.
Time spent testing the condition in while
loop delete is O(n) if we keep track of the sizes of all A(x) ,
A'(x) Y B(x) Y B'(x) as the graph changes. Time spent executing
WE loop
delete is O(n) per edge deleted from the fill-in.
.
Once an edge is deleted in step delete , it never reappears. Thus
the total time spent in
delete over all calls on MINFILL is o(ne')
to test the condition plus
O(ne') to delete edges from F and update
the graph.
Time spent testing the
if condition in statement
-
split
if we keep track of the size of each DF(x) and the size of
the graph changes.
is
F
as
Time spent executing the then branch of split
O(n)
is O(n2) to update the graph by deleting and later adding x ,
L
O(n) time per edge in
DF(x) to update the graph, and O(e') time
generating each nested call on MINFILL (since the sets F-DF(x) and
DF(x) together have at most O(e:)
I-
spent in the
O(n2ef)
then branch
plus
elements).
of split
Thus the total time
over all calls on MINFILL is
O(n) time per edge in DF(x) .
The time spent in the else branch of split is O(n) per edge
e
added to
F
An edge added to I?~
0
deleted.
is added to the graph and never
l
Thus the total time spent in the else branch of split
over all calls on MINFILL is O(ne') .
In summary the total time required by MINFILL is O(n2ef) plus
L
O(n) time for each edge in each set DF(x) where x is a splitting
vertex.
c
If x is the splitting vertex for the call MINFILL(F), each
edge in DF(x) must be in F .
with
The two nested calls MINFILL(F')
F' = F-DF(x) and MIXFILL with F" = DF(x) produced by
MINFILL(F) have parameters which are disjoint sets. Thus each edge
c
can only occur in
O(n)
parameters, since the maximum depth of nested
calls on MINFILL is O(n) .
Thus the O(n) time per edge in each set
DW Y when summed over all splitting vertices, is
‘c
.
The
total time required by MINFILL is thus O(n2er) , and MINIMAL requires
O(n2er)
time,
O(n 3 )
space,
O(e') calls on MINFILL, and an O(n)
maximum depth of nested calls on MINFILL.
L
O(n2eY)
If storage space is costly,
we can implement MINIMAL to run in the same time using only O(net>
storage space, or to run in O(ne')*) time using only O(e')
space.
25
storage
4.
Computational Relationships with Other Problems.
In this section we show that algorithms FILL and PERFECT cannot
be improved too much without finding a new and better transitivitytesting algorithm, and that the minimum fill-in problem is very hard.
c
In particular, we show that (1)
any algorithm which computes an
ordering's fill-in can be used to compute the transitive closure of
a graph;
any algorithm which tests whether a graph has a perfect
(2)
elimination order can be used to test a graph for transitivity; and
(3)
any algorithm which determines whether a graph has a fill-in of
some size ef
or less can be used to test a propositional formula for
satisfiability.
Fill-in, Perfect Orderings, and Transitivity.
Given any acyclic graph G = (V,E) , consider the graph
G2 = (V2,E2) , where V2 = (v(i) I veV, ie {1,23] and
E2 = [(v(2)+(2))
ordering on
\ (v,w) EEL U {(v(l),v(2)) I WV] . Let a be an
V such that (v,w) EE implies a
-1
(v) <a-'(w) .
(Such
an ordering is called a topological sorting of G [?I.) Let a2 be
the ordering on
V2 defined by c$'(v(i)) = n(2-1)+6'(v) .
Applying Lemma 1, it is clear that the fill-in
F((G2)a
) is
2
defined by
F((G2)a ) = ((v(l),w(2)) 13 a path from v to w in G) .
2
Given G , it is easy to construct
26
G2
in
O(n+e)
time.
Thus we have
Given an acyclic graph G , we can construct in O(nte)
Theorem 2.
time a graph G2
a2 ,
edges, and an ordering
with 2n vertices and nte
such that the edges in
N(G2)a >
correspond one-to-one with the
2
edges in the transitive closure of G .
Thus any algorithm for computing fill-in can be converted into an
algorithm (with the same time and space requirements, to within a
constant factor) for computing the transitive closure of an acyclic
(The requirement that the graph be acyclic is not a significant
graph.
restriction; see [3,8 I.) Thus the fill-in problem is at least as hard
as the transitive closure problem.
Given any
acyclic graph G = (V,E) , consider the graph
--.
G3 = (V3,E3) , where
V3 = (v(i) \ veV, ie [1,2,3))U {s} , and
E3 = b(%v(j>> \ (uy~-> 6 i < j} U {(s,v(l)) I
WV)
U {(v(3)+) 1 veV)U {(s,v(3)) \ WV) . Given G , it is easy to
construct
G
Lemma 5.
G is transitive if and only if
Proof.
u-+v
3
in
O(n+e)
time.
Suppose G is transitive.
and v dw
the vertices of
3
3
is perfect elimination.
Then for all distinct u, v, w ,
in G imply u 4 w .
G
G
Let cx be any ordering of
such that
&v(2)) E (1,2,...,n) for veV ,
a-'(v(1)) E (n+l,...,2n) for
VEV ,
&v(3)) E {2n+l,...Jn) for veV , and
a-f s) =3n+l
.
If G is transitive, elimination of the vertices
no fill-in, since
b(2) 3
causes
(‘d&V(2)) Y (v(%w(3)) cE3 imply (u(l)+(3))
.
27
cE3
l
c
Then elimination of the vertices
causes no fill-in, since
b(l) 3
(s,v(l)) , (v(l),w(3)) eE3 imply (s,w(3)) eE3 . Then elimination of
the
vertices {v(3))
causes no fill-in, since s
vertex adjacent to any
v(3)
l
Thus,
if G is
is the only remaining
transitive, G, is
perfect elimination.
For the converse, suppose u 3 v and v dw in G . Consider
the cycle k = [u(l),v(2),w(3),s]
that if G3
joining
l
It
follows from Lemma
is perfect elimination, there must be an edge in
u(l) and
w(3)
edge possible is
transitive.
in G3
or joining
(u(l),w(3))
4
G3
v(2) and s . The only such
. Thus u 3 w in G , and G is
0
--.
Summarizing we have
Theorem 3.
Given an acyclic digraph G , we can construct in O(n+e)
time a graph G3
with 3n+l vertices and 3e+ 3n edges such that
G is transitive if and only if G3 is perfect elimination.
Thus any algorithm for testing whether a graph is perfect
elimination can be used to test a graph for transitivity, at a cost
of only a constant factor in the running time.
Munro [8] has shown
that the transitive closure of a graph can be computed in
O(n 2.81 )
time using Strassenk fast matrix multiplication method [13]. Various
problems, including transitive reduction [1] and Boolean matrix
multiplication [3] are known to be computationally equivalent to
transitive closure.
There may be a way to solve the fill-in and
perfect ordering problems in
O(n 2.81)
t.une, by reducing them to
transitive closure problems, but any improvement beyond O(n 2.81 )
improve the best bound-known for Boolean matrix multiplication.
28
would
Minimum Orderings and the Satisfiability Problem.
Now we show that the problem of finding a minimum elimination
L
ordering for a graph is NP-complete.
For this purpose, we formulate
the problem in the following way: given any graph G = (V,E) and a
size
L
ef , does G have an ordering which produces a fill-in of e'
edges or less?
To show that this problem is NP-complete, we must
demonstrate that (1) there is a non-deterministic
polynomial-time
algorithm for solving the problem; and (2) given any instance P
c
of a known NP-complete problem p , there is a polynomial-time transformation which converts
P into a graph G and a size ef , such
that the answer to P is "yes" if and only if G has an ordering
with a filLin of ef
edges or less.
(For those not familiar with
the notion of an NP-complete problem, references [2,6] provide an
extensive discussion.)
Part (1) is easy:
to discover whether
produces a fill-in of size e'
or less, we guess an ordering and
calculate its fill-in using FILL.
L
G has an ordering which
Guessing an ordering and checking
its fill-in clearly require polynomial time.
This algorithm is
non-deterministic; it can guess all possible orderings.
them produces fill-in ef
c
If one of
or less, the algorithm answers "yes".
Part (2) is quite a bit harder.
For p we choose the satisfiability
problem of propositional calculus, which is known to be NP-complete [2].
Let P be any propositional
I
that P is in conjunctive normal form with three literals per clause [2].
Let
size
c
formula with m variables. We may assume
P
have
e'(P)
k
clauses.
We shall construct a digraph G(P) and a
such that G(P) has an ordering with fill-in of size
e'(P) or less if and only if there is a truth assignment to the
variables which makes- P
true.
29
We use letters
x, y, z to denote variables and p, q , r to
denote literals (variables or their negations). We use ? to denote
the negation of x ; we regard z
as another notation for x .
will contain some individual vertices and some cliques of
G(P)
various sizes.
(XY y>
If X and Y are cliques, we use a single "edgeri
as shorthand to denote all possible edges from vertices in X
to vertices in Y . Similarly, the "edge"
c
(5 x>
will denote all
possible edges from vertex v to vertices in clique X .
The basic building block in the construction is the "ground"
configuration illustrated in Figure 1, consisting of a vertex v and
c
three cliques
Xl, X2 and
--.
X
.
3
eliminated first and vertices in
of this grahh.
Observe that vertex v must be
X
1
second in any perfect ordering
(Any other ordering produces fill-in at least
min{\X21, IxJ~\xJ~~x~~, IxJ*~x~\} .) This construction also works
c
if all the edges are reversed.
Without loss of generality we may assume that for each variable x ,
X
and G occur the same number of times in the clauses of P .
(0therwise, we can add a suitable number of dummy clauses of the form
G
or
xx% .) We may also assume that no occurrence of any variable
x follows an occurrence of G *in a clause.
For each variable x in P ,
corresponding to x
c
and one to ? .
G(P)
contains two vertices, one
We shall use x and z to
denote these vertices. For each clause (pvp vr) in P ,
G(P)
contains three vertices and three cliques, denoted by pqr(i) for
i = 1,2,3 , and
X31(pqr(i))
for i = 1,2,3 . Thus each literal
occurring in a clause has one vertex and one clique corresponding to
c
30
c.
it
(i-e*,
Y X31(P9m)
pqr(2)
correspond to the literal q in
G(P) contains nineteen other cliques, denoted by
(PtJqvr) )*
, and Xij for i = 1,2,4,5,6
X2o,X5o,X32,X33
and j = l,2,3 .
The cliques are arranged into sixL. grounds.
Table 1 gives all the adjacencies in G(P) and the sizes of all
i
the cliques appear in Table 2.
The sizes of the cliques are chosen to
make the calculations simple, not to be as small as possible.
I
illustrates
G(P)
for
Figure 2
P = (xv~vz)A (xvyvz) .
It is clear that the size of G(P) is polynomial in the length
of
P, and that G(P) can be constructed in polynomial time given P .
G(P)
L
is designed so that producing a small fill-in requires that
--.
vertices corresponding to the false literals for some truth assignment
of P must be eliminated before any vertices in cliques
L.
x61 Y x5o
Y Or x41
xlJ' x2o'
If some truth assignment satisfies P , there is
l
a corresponding elimination order which produces a small fill-in. If
no truth assignment satisfies P , there is no elimination order with
c
small fill-in.
The next result formalizes this idea, and finishes
the proof that the minimum fill-in problem is NP-complete.
Theorem 4.
G(P) has an ordering with fill-in
m+ $+ 1
b-l
>
or less if and only if P is satisfiable.
Proof.
First we show that if F is not satisfiable, every ordering
of
produces
G(F)
is not satisfiable.
fill-in
m + F+ 1 b or greater. Suppose F
1
(
Let a be any elimination ordering. We must
consider several cases.
31
c
( i>
Some vertex pqr(i) representing a literal is eliminated after
X 31(pqr(i))
some vertex in
l
Then depending on whether a
vertex in X31(pqr(i)) , X32 , or X33 is eliminated first,
the fill-in is at least c2 , 4c , or c 4 . Examining Table 2,
we see that b < (2m+7k+l)c and
-< c2 .
(ii)
Case (i) does not hold and some vertex pqr(i) representing a
literal is eliminated before the corresponding variable vertex
(P if i = 1 , q if i = 2 , r if i = 3 ). Then the
fill-in is at least c2 >
m+$+lb.
>
(iii) Cases (i) and (ii) do not hold and some vertex v
vertex, not a literal vertex, not in
=Y
X31(Pqr(i))
eliminated.
or X33 , and not in
is eliminated before any vertex in
Xu
is
The first such vertex v eliminated causes a
fill-in of at least c2 ->
(iv)
X 32
not a variable
(
m+$+lb.
>
Cases (i), (ii), and (iii) do not hold and at most
r-n+% -1
vertices among the x , G , and pqr(i) are eljrninated before
any vertex in
xl1
(4
xl1
Then the first elimination of a vertex in
l
causes a fill-in of at least
C
m+$+lb.
>
Cases (i), (ii), (iii), and (iv) do not hold. Then before any
vertex in
X
and
;;
X
61"20 “50 “41
or three vertices
is eliminated, either two vertices
pv(l)
, mr(2) , and pqr(3) must
i
have been eliminated (since F is not satisfiable). Either case
produces a fill-in of at least
c
32
C2
->
m+$+lb.
>
Now suppose that
P is satisfiable.
for the variables which satisfies P .
Choose a truth assignment
Consider the elimination order
i-
A careful examination of the adjacencies given in
given in Table 3.
Table 1 reveals that the fill-inlisted in Table 3 is correct. The
size of the fill-in is bounded by (m+ 4k)c+
L
m+g+lb-1.
>
0
The graph G(P) used in this construction is not strongly
i
connected, but it can be made strongly connected by adding a new
vertex
s
and edges (s,x)
original graph.
i
and (x,s) for all vertices x
in the
Such an addition does not affect the minimum fill-in.
It seems likely that there is a similar construction which shows
that the minimum fill-in problem for undirected graphs is W-complete,
but such a construction is still undiscovered.
c
(See [12] for a
discussion of elimination orderings on undirected graphs.)
c
c
33
I
50
Remarks.
This paper has given an
L-
O(ne) algorithm for computing the
fill-in of any elimination ordering on a graph, an O(ne) algorithm
for finding a perfect ordering, and an O(n2ef) algorithm for finding
a minimal ordering.
There may be a way to solve the fill-in and
perfect ordering problems in
O(n
2.81
)
time, but any improvement
beyond this would improve upon the best algorithm known for transitive
closure.
4
The minimal ordering algorithm may be improvable to O(n2e)
or even to O(n3) .
The construction in Section 4 shows that the problem of finding
a minimum ordering is NP-complete.
Since this probably implies that
--.
exponential time is required to find a minimum ordering, any practical
method for getting a small fill-in must be based on a heuristic.
Two heuristics, the minimum degree heuristic and the minimum fill-in
heuristic [ll], seem to work well in practice, but there are no
theoretical results to support this assertion. The theoretical study
of such heuristics seems to be a good area for future research.
[12,13,16] for further comments regarding related issues.
34
See
c
References
PI
A. Aho, M. Garey, and J. Ullman, "The transitive reduction of a
directed graph," SIAM J. Comput l , Vol. 1 (1972)) 131-137.
PI
S. Cook, "The complexity of theorem-proving procedures,"
Proceedings Third Annual ACM Symposium on Theory of Computing
..
(197% 151-153.
I31
M. Fischer and A. Meyer, "Boolean matrix multiplication and
transitive closure," Twelfth Annual Symposium on Switching and
Automata Theory (19711, 129431.
I?+1
G* E. Forsythe and C. B. Moler, Computer Solution of Linear Algebraic
Equations, Prentice-Hall, Englewood Cliffs, N. J. (1967).
L. Haskins and D. Rose, "Toward characterization of perfect
elimination digraphs," SIAM J. Cornput., Vol. 2 (1973), 217-224.
R. Karp, "Reducibility among combinatorial problems, If Complexity
of Computer Computations, R. E. Miller and J. W. Thatcher, eds.,
Plenum Press, N. Y. (1972), 85-104.
[51
WI
[71
D. Knuth, The Art of Computer Programming, Vol. 1: Fundamental
Algorithms, Addison-Wesley, Reading, Mass., (1968), 258-265.
Ku
I. Munro, "Efficient determination of the transitive closure of
a directed graph," Info. Proc. Letters, Vol. 1 (1971), 56-58.
I91
T. Ohtsuki, "A fast algorithm for finding an optimal ordering in
the vertex elimination on a graph," SIAM J. Cornput., to appear.
DW
D. J. Rose, "Triangulated graphs and the elimination process,'r
Journal of Mathematical Analysis and Applications, Vol. 32 (1970),
597-609.
D11 D. J. Rose, "A graph-theoretic study of the numerical solution of
sparse positive definite systems of linear equations," Graph
Theory and Computing, R. Read, ed., Academic Press, N. -1973),
183-217.
c
e
L
WI
I131
D. Rose, R.
elimination
D. Rose and
Proceedings
Tarjan, and G. Lueker, "Algorithmic aspects of vertex
on graphs," SIAM J. Comput., to appear.
R. Tarjan, "Algorithmic aspects of vertex elimination/
Seventh Annual ACM Symposium on Theory of Computing
(19751, 245-254.
cw
V. Strassen, "Gaussian elimination is not optimalytr Numer. Math.,
D51
R. Tarjan, "Depth-first search and linear graph algorithmsyff
SIAM J. Comput., vol. 1, (1972), 146-160.
Ml
R. Tarjan, "Graph theory and Gaussian elimination," Sparse Matrix
Computations, J. R. Bunch and D. J. Rose, eds., Academic Press,
New York, to appear.
Vol. 13, (1969)y 354-356.
35
c
Vertex or
Clique
Size
t
X
1
Adjacencies In
Adjacencies Out
X,X
x2o' x22
all
pqr(i)
ll,x41,
containing
x or G,
X31(pqr(i)
1 with _pqr
containing
x
X31(xqrW
except
or
all
x
1,
X31hd2) 1, X31(p4x(3) 1.
X
1
Xl1 ,XG1 yX41y Gqr (i) for
i = 1,2,3, p&(i) for
xy x22
i = 2,3, PGW, X31(p4rW)
with pqr containing
x
or
c
x
except
X31hqr(l)),
X31(x4'(1) 1, Xjl(wrW 1,
X31(p&2)l, X31(p4xW),
x31(Pqa3)~
pqr(l)
1
l
pqr(2), X31(p9'(1)) ,Xll
x5O,x52,x2O,x22,
PyP,q,i,r,T corresponding
to variables, p,p
corresponding to negation
of variables
pqr(2)
1
pqr(l) ,X 52,'20,'22,
PyP,q,i,r,~
pqr(3) ,X31(P4r(2)) ,Xll
corresponding
to variables, p,F,q,i
corresponding to negation
of variables
Table 1:
Clique sizes and adjacencies in G(P)
Values of constants appear in Table 2.
36
Vertex or
Clique
Size
e
PqrW
1
Adjacencies In
Adjacencies Out
wir(2) ,X 52*x20'x22P PSP,
X41' x3l(Pqr(3)), Xl1
Q&G
L
x41
C
pqr(3) 9 X
52'x20'x22'x21'
'42
x43’x9~
'42
c
x43
x5o
c
c2
c2
C
x41*x43
x43
'42
x4l'x42
x51
-.b.
x51
'52
1
X
c2
52
X51J53mr~1) ,X
x53
X12, X31(pq’(l))~
L
x53
c
KJPclr(l))
c2
C
2
'51"52
'52
Pqr(l),q,q,r,;,X50,X51,
'32
x52~x20~x21~x22~x3~~P
if
p is the-negation of a
variable
c
X&w-C9
c2
'32
X52’X2~‘X21’x22,X33~~
is the negation of a
variable
c
Table 1 (cont.)
37
if Q
41'xl1'
c
Vertex or
Size
Clique
c
Pqr(3),P,;,q,~,X50,X519
F
x52sx20'x219x22'x33'
if r is the -. negation
of a variable
'32
x33
x11
xl2
xl3
c
'61
'62
'63
x2o
x21
x22
'23
Adjacencies Out
Adjacencies In
'32
c2
1
C
'32
2
b--'
1
xl2
ii,X
C
C
C
63"22
'62
'61"63
'63
'62
'61"62
x21
x'x11'x129x41' X 31 (pqr(i)),
pqr (i)
x22
x23'x20'x41' X 31 (pqr(i)>
2
1
C
xll'x12
2
C
C
xl3
2
'23
2
x21'x22
x22
Table 1 (cont.)
38
C =
(m+T
+ l)(Zm + 7k + 1) + 1
b = (m+4k)c+m+3k+l
I531 = Ix2,l = Ix331 = Ix,,1 = 1
IXl2I
= b
1'201 = 1'501 = 1'411 = 1'611 = '
All other cliques have size
c2 .
c
Table 2:
Constants for clique sizes in G(P).
39
Elimination Order
Fill-in
Vertices corresponding to
Size
mc
x2()+x’x+x6-
false variables and negations
of true variables
..
Vertices
pqr(i)
corres-
ponding to false literals,
X5o + pqr(Z), X5o + pqr(3)
< 4kc
-
pqr (1) -+ X 41' pqr(2) -+ X41
in order pqr(l) ,pqrW ,pqW)
X + Xl29 x + X12, p4rW -+
xl1
(m + ?$b
xl2
0
xl3
c
-
xl2
0
5+ x9 51 + x9 51 +
x2o
m++
pqr(i)
x21
0
'23
0
x22
0
Rest of vertices corresponding
0
e
to variables
2s
x51 + pqr(i)
x5o
2
0
x51
Table 3:
Elimination order for
40
G(P)
if
P
is
satisfiable.
.
Fill-in
Elimination Order
0
x53
0
'52
rest of vertices
order
0
pqr(i) in
pqr(l) s PqrW 9 p4rW
x33
'32
--
x41
x43
c
'42
'61
c
'63
Table 3 (cont.)
Total fill-in is
3k
z(m+4k)c+(m+-$b+m+3k
41
c
Size
c
e
c
Figure 1:
A "ground" configuration used as building block
in NP-completeness
c
construction. Point v is
a single vertex; circles denote cliques.
42
‘62
‘63
‘42
x43
Figure 2(a).
Edges in G(P) for P= (Gvyvz) A (xvyv;)
43
.
c
r
c
x