Generating all maximal independent sets : NP-hardness and
polynomial-time algorithms
Citation for published version (APA):
Lawler, E. L., Lenstra, J. K., & Rinnooy Kan, A. H. G. (1980). Generating all maximal independent sets : NP-hardness and polynomial-time algorithms. SIAM Journal on Computing, 9(3), 558-565.
https://doi.org/10.1137/0209042
DOI:
10.1137/0209042
Document status and date: Published: 01/01/1980 Document Version:
Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication:
• A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website.
• The final author version and the galley proof are versions of the publication after peer review.
• The final published version features the final layout of the paper including the volume, issue and page numbers.
Link to publication
General rights
Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain
• You may freely distribute the URL identifying the publication in the public portal.
If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement:
www.tue.nl/taverne Take down policy
If you believe that this document breaches copyright please contact us at: openaccess@tue.nl
providing details and we will investigate your claim.
SIAM J. COMPUT. Vol.9,No.3,August1980
1980 Society for Industrial and Applied Mathematics 0097-5397/80/0903-0009 $01.00/0
GENERATING
ALL
MAXIMAL INDEPENDENT SETS:
NP-HARDNESS AND POLYNOMIAL-TIME
ALGORITHMS*
E. L. LAWLERS", J. K. LENSTRA$ AND A. H. G. RINNOOY KAN
Abstract. Supposethat an independence system(E, )is characterizedbya subroutine whichindicates in unit time whetherornot agiven subset ofEis independent.Itisshown that there is no algorithm for
generatingall theKmaximalindependentsets ofsuch anindependencesystem in timepolynomialin
IEI
and K,unless V. However,itis possible toapplyideasof Paull andUngerandofTsukiyamaetal.toobtain polynomial-timealgorithmsfor anumberofspecial cases,e.g. the efficientgenerationofall maximal feasible solutionstoaknapsack problem.Thealgorithmictechniques bear an interestingrelationshipwiththoseof Read for the enumeration ofgraphsand other combinatorialconfigurations.Keywords, independencesystem,satisfiability, maximalitytest, lexicography test, setpacking, clique, completek-partite subgraph, knapsack problem,on-time set of jobs,inequalitysystem, facet generation, matroidintersection
1. Introduction. LetEbe a finite set ofelements and let5 be anonempty family
of subsets ofE satisfyingasingle axiom" if 165 and
I’
___
I, thenI’
5. Under theseconditions,(E,5)is said to be anindependencesystem and5is itsfamilyofindependent
sets.
An
independentsetI
is said to be maximal ifthereis noI’
5suchthatI’
=
I.Thesubsetsof
E
that are not contained in5 aredependentsets. AdependentsetJiscalledminimal if
J’
foreachJ’
cJ.Suppose
thatIEI-
n and that (E, 5) is characterized by a computer subroutine which indicates in unit timewhetheror notagiven subsetofEis anindependentset.All independent sets can be generated inO(nll)
time: given an independentset,O(n)
applications of the subroutine suffice to determine the next independent set in a
lexicographic listing. But suppose that one is interested only in all the maximal
independent sets,of which there are
K,
K=< I 1,
These can befoundin timepolynomialin n andK onlyin theunlikelyeventthat
,
as weshow in 2.Thereare,however,anumberof special typesofindependencesystemsforwhich it ispossibletogenerateall the maximalindependentsetsefficiently.In 3,ananalysisof a procedure due to Paull and Unger
[5]
reveals that there is a polynomial-time algorithm for this purpose, provided that a certain subproblem can be solved inpolynomial time.
Improvements
inrunningtimeand storage requirements suggested by Tsukiyama et al.[8]
are discussed as well. In 4, we investigate some of theseindependence systems. Typical of these specialcases istheproblem of generatingall the maximal feasible solutions to aknapsack problem.
In
5,we examinetherelationship between our approach and a technique for the enumeration of graphs and other combinatorial configurations, recentlyproposed by Read[6].
2. Complexity. Weshallshowthattheproblemofgeneratingallthe
K
maximalindependentsets of an arbitrary independence system isNP-hard, i.e., ifthereis an
algorithmfor theproblem whichrunsin timepolynomial in n and K,then there is a
polynomial-time algorithmforsolving the satisfiabilityproblem
[2].
*Receivedbythe editorsMay16,1978. This research waspartially supported bythe National Science FoundationunderGrant MC.S76-17605,andby NATO under SpecialResearchGrant 9.2.02 (SRG. 7).
"tComputerScience Division,UniversityofCalifornia,Berkeley,California94720.
MathematischCentrum,Amsterdam,The Netherlands.
ErasmusUniversity,Rotterdam, The Netherlands.
GENERATING ALL MAXIMAL INDEPENDENT SETS 559
Let F(X1,... ,XN) be a Boolean expression in conjunctive normal form. Let
E
{
T1,F,.
,
TN, F},
and for any/"{
1,,
N}
and anyJ
___
E,
definetrue if
T/e J,
F.
J, xj(J)false
ifF.
eJ,
T/
J,
undefined
otherwise. LetI if either(i) thereexists a j
{1,.
,
N}
such that both TjgI,
F.
I,
or(ii) each clause of
F
contains a letterX.
orX.
whose defined value is true, i.e.,F(x(i),
Xl(I))=
true.Itiseasilyseenthat(E,
)
is anindependence system.Moreover,F
is not satisfiable if and onlyif the onlymaximalindependentsetsareE-
{T., F.}
forj 1,...,N.Assume
there exists ageneral procedure for generating all themaximal indepen-dentsetsof anarbitrary independencesystem withrunningtimeb
(n, K),whereb
is apolynomial function of n and K. Apply this procedure to the independence system
definedabove and allow it to run for time
b
(2N,
N).ThenFis satisfiable if andonlyif either(i) F(Xl(I),"’,
Xlv(I))=
true for somegeneratedI,
or(ii) theprocedurefails to halt within theallotted time, establishingthatthereare more thanNmaximalindependentsets.
Forany givenJ
_
E,
the conjunctivenormalformCan
beevaluatedin timeproportionalto itslength. Appropriatemodificationofthe unit-time assumption for independence testing thus establishes that the procedure solves the satisfiability problem in
poly-nomial time. Sincethe latter problem isNP-complete,it can besolvedinpolynomial
time if andonlyif
[2]. Hence,
wehavethe following theorem.THEOREM1.
If
thereexists analgorithmfor
generatingallthemaximalindependentsets
of
an arbitrary independencesystem in timepolynomialin n andK,
then Aft.To obtain a reduction to, rather than from, the satisfiability problem, we now consider the problem of generating all maximal independent sets and all minimal
dependentsetsof anindependencesystem. LettherebeLsuch sets.Weshallshow that
if there is apolynomial-time algorithm forthe satisfiability problem, then there isan
algorithm for generatingallthesesets in timepolynomialin n andL. Each stepof the latteralgorithm yieldsa new set onthe list.
Suppose
then, that at a certain point setsIa,...,
i
have been generated. Let___
{1,...,
l}
indicate the generated sets which are maximal independent and{1,.
,
l}-
thosewhich are minimaldependent.Any
new setImustsatisfyI:
Ii
forall and
Ii
!forall.
Formthe Boolean expression(Ai.zV.,,rxl)
^
(Ai.V.,x.).
Thelengthof thisexpressionis O(nl)andbyourassumptionone candetermine if it is satisfiable in
6(nl)
time, for some polynomial function6.
If the expression is not satisfiable, then =L and the algorithm terminates. Otherwise, construct a truth assignment inpolynomial time, by successively fixing thevalue ofeach variable anddetermining if the reduced expression issatisfiable. Next define !
{/’IX.
true}
and test1 forindependence in unit time. If! isindependent, augment it until a maximalindependentsetresults; ifIisdependent,removeelementsuntil a minimaldependent setisfound.Eitherprocedurerequires
O(n)
time. SinceclearlyI#Ii
for 1,,
l,I
560 E. L. LAWLER, J. K. LENSTRA AND A. H. G. RINNOOY KAN
THEOREM 2.
/f
N,
thenthereexists analgorithm]:or
generatingallthemaximalindependentsetsand alltheminimaldependentsets
of
anarbitrary independencesystem in timepolynomialin nandL.3. Analgorithm.
3.1. AgeneralizedPauil-Ungerprocedure. WenowassumethatE
{1,
,
n}
and thatindependence testing requirestime c.Letjbe thefamilyof allindependent
sets that are maximal within{1,
,/’}.
Bydefinition,o
{}.
Weseek to construct from-1
inordertoobtainn,
thefamilyof allK independentsets that are maximal withinE.Suppose
that Ii-1.
If IU
{/}
,
then clearly IU
{/}
i.
If IU
{j}g,
then Ii.
Itfollows thatObservingthattheelements ofEcanbe numberedarbitrarily,we obtainthefollowing result.
THEOREM 3. ForanyJ
_
E,
the numberof
independentsetsmaximalwithinJdoesnotexceedK.
.Suppose
thatI’.
and/’el’.
Since I’-{j} is independent and included in {1,...,j-l}, there must be someIN._I
such that I’-{j}c_LMoreover, I’
is anindependentset that ismaximal withinI
LI
{/’}.
This observationsuggeststhefollowing proceduretoobtain.
fromi_1,which is ageneralizationof analgorithm duetoPaulland
Unger [5].
Step
1. For each I._a,
find all independent setsI’
that are maximal within{/}.
Step
2. Foreach suchI’,
testI’
formaximalitywithin{1,
,
j}.EachsetI’
that is maximal within{1,
,
f}
isamemberof.,
andwehaveseenthat eachmember of.
canbe found in thisway.However,agivenI’
maybe obtained from morethanone I-1.
In
orderto eliminateduplications, weneedone further step.Step
3. RejecteachI’
that passesthemaximalitytest if itappearsamong thesetsalready foundtobein
.
Suppose
that inStep
1, for eachI-1,
atmostK’
setsI’
are found in timec’;
by Theorem 3,wehaveK’
=<
K. ForeachI’,
the maximalitytestinStep2 requires
O(nc)
time, and the duplication test inStep
3 canbe accomplished withO(K)
pairwisesetcomparisons,eachofwhichrequiresO(n)
time.Itfollowsthat,forfixed j,
O(c’K)
time suffices forthe firststep,O(ncKK’)
timeforthe second step, andO(nK2K
’) time for the third step. Thus, the overall running time to obtainn
isO(nc’K
+
n2cKK’+ n:KK’).
Thisyieldsthefollowingtheorem.THEOREM 4. All themaximalindependentsets
of
an independencesystem canbe generatedin timepolynomialin n, candK,
if
it ispossibleto list inpolynomialtimeall independentsetsthatare maximal withinI(_J{/’},
for
arbitraryI_,
j 1,.,
n.In 4,weinvestigateseveral cases in whichthesubproblem referredtoinTheorem 4 (the "I
U
{j}problem")canbe solved inpolynomialtime.3.2.
Improvements
of Tsukiyama et al.A
techniquesuggested by Tsukiyamaet al.[8]
enables one to eliminate duplications more efficiently. It yields significant improvements in both running time and storage requirements of the Paull-Ungerprocedure.
Insteadofcomparinga set
I’
withallmembers of5.
found previously,one retainsI’
onlyif it is obtainedfrom the lexicographically smallestI
_
from which it canbeGENERATING ALL MAXIMAL INDEPENDENT SETS 561
Step 3’. Foreach
I’
obtained fromIo,_1
thatis maximalwithin{1,
,/’},
testfor each </’,
i’ I,
theset(I’-
{/’})
(I
f3{1,.
,
1})
t.J
{i}for independence. RejectI’
ifanyof these testsyieldsanaffirmative answer.If, indeed, any affirmative answer is obtained, then
I’-{}
is included in anindependentset that islexicographically smaller than
I,
and hencein alexicographically smallermaximalindependentsetfrom5.-1.
Foreach
I’,
the lexicographytestinStep
3’ requiresO(nc)
time,which isthesame as required by the maximalitytest inStep
2.Hence,
the overall runningtime of therevisedprocedure is
O(nc’K
+
n2cKK’).
Possibly of even greater interest for some applications is the fact that storage requirements can be greatly reduced by organizing the computation as a depth-first
searchof a tree.Nodesat
level/"
correspondtomembers of5i,withthetreerootedat,
theuniquememberof5o.
Since foreach 165._,
eitherI{/’}
5.
orI 5i,eachnode hasatleastoneandatmostK’
children.Wheneverinthe depth-first searchamember of5, isencountered,itisoutputted.The maximumnumberofsubproblemsthat must be maintained in stack to
allow
backtracking isO(nK’).
A further decrease in storage requirements can beobtained atthe expenseof an increase inrunningtime.4. Applications. Inthis section we investigatevariousindependence systemsfor which all maximalindependentsets canbe generatedinpolynomialtime.
4.1. Setpacking. Let Sbe a finite set with
[Sl
m andlet 5{SI,"
Sn}
be afamilyof
(not
necessarilydistinct) subsetsofS.AsubfamilyI_
5gis apackinginSifthesets inI arepairwise disjoint. Thepackingscorrespondto theindependentsets of an
independence systemwithE 5.Allmaximalpackingscanbegeneratedinpolynomial time, as shown below.
First considerthe "I kJ {j}problem". Let
A.
__
6consists of the setsS
forwhichSgfq
S.
#5.
GivenI-1,
theonlysetswhich canpossibly bemaximalwithinItA {S;}
areIitselfand
(I
A.)
LI
{Si}.
ThusK’
_-<2.Itfollowsthat,givenAi,theILI
{]}
problemcanbesolvedin
O(n)
time.Assuming the sets
S
arespecifiedby orderedlistsofindices,one canfindthesetsA1, ’,
A,
inO(mn
2)
time. Itfollows thatStep
1 requiresO(mn
2+
n2K)
time.The maximality test for
I’
is equivalent to verifying that I’fqAi# for all <j,Sd.gL Since each such test can be carried out inO(n
2)
time,Step
2 requiresO(n3K)
time.The lexicography test is easily seen to be equivalent to verifying that
[I-(Aj f3 {Si+I,
Sj-1})]
["Ai
# forall </’,Si
L
Thus,Step
3’ requiresO(n3K)
time aswell.Itfollows that theoverallrunningtimeof theprocedureis
O(mn
2+
n3K).
Since it ispossibletoimplement the searchtreeinO(n)
space,O(mn)
spaceis sufficientoverall.Suppose Y’
isinducedbyanundirectedm-edgen-vertexgraphGwithedgeset$.Si
denotes the set of edges incident to vertex/" andA.
denotes the set of verticesadjacenttovertex].Theneach packingI
_
is anindependentorstablesetof verticesofG,or, equivalently,acliqueof thecomplementary graphG. Itwasin this contextthat thePaull-Ungerprocedure andthe improvements of Tsukiyamaetal. wereoriginally
proposed.
For
the graph problem,itisnatural forthe setsAi
tobe givenasinputinthe formoforderedlists.Underthisassumption, andnotingthat
i=1
IA I-
2m,one canreducethe timeboundtoO(mnK)
andthe space boundtoO(m
+
n),asshownin[8].
4.2. Completek-partitesubgraphs. Let Gbean undirectedgraphwith vertex set V
{vl,...,
vn}
and edge set S withIS[
m. A complete k-partite subgraph of G is562 E. L. LAWLER, J. K. LENSTRA AND A. H. G. RINNOOY KAN
defined by a collection
{V1,’’’, Vk}
of pairwise disjoint subsets ofV
such that {vi,v.}e
$ for vieVg,
vie Vh, if and only if g h.Note
that an independent set ofvertices defines acomplete 1-partite subgraph and thatacomplete k’-partite subgraph
is alsoacomplete k-partite subgraph for k k’+1,.
,
n.The complete k-partite subgraphsofGcorrespondtotheindependentsetsof the
following independence system. Let
E
V
and let Ie if there exists a partitionP(I)
{V1,"
,
Vk}
ofI (i.e.,U=I
Vh
I andVg f’l Vh
for 1<-- g<
h _-<k) that defines a complete k-partite graphon LWe
will show how to generate all maximalcomplete k-partite subgraphsof Ginpolynomialtime.
Again consider the
"/t.J{/’}
problem". LetP(I)={VI,..., Vk,}
withVh
#(h
1,...,k’)and k’<-k.,First,suppose that{vi,
vi}
eS
forallv
eL
Ifk’<
k,thenthe single independentsetI’
that is maximal withinIU {vi}
is!LI
{vj}itself,withP(!
t_J{vi})
P(I)
t_J{vi}.
Ifk’ k,then there are k
+
1 setsI’,
for whichP(I’)
is obtained by deleting any one of the members ofP(I)
t_J{vj}.Suppose
now that{v,
v}e
S only for allv
eV’h
_
Vh
(h 1,’",k’), whereV=
forh=l,’’’,a,CV’hCVh
for h=a+l,...,b andV=Vh
for h=b +1,
,
k’, with 0=<a=<b<-k’ and b>0. In this case, b+l independent setsI’
that are maximal within I
t_J{vi}
are defined by P(I’)=P(I) and P(I’)={
V’I,"’,
V’h-I,(
Vh--V’h)
U
{Vi}, V’h/,’’’, V’b,
Vb/l,’’’,Vk,}
for h=l,...,b. In the special case that a=0, even more setsI’
may exist. If k’< k, then the single additional setI’
is definedbyP(I’)=
{
V’,...,
V’Vb/,’’
", Vk’,{Vi}}.
Ifk’ k,thenthere arek- b additionalset
I’,
forwhichP(I’)isobtainedby deleting anyoneof the sets Vb/l,’’’,Vk’
from{V’I,’",
V’,
Vb/,’’’, Vk,,{vi}}. (Note
that these sets are notmaximal in thecasethat a> 0.)
Since
K’= O(k)
and independence testing requiresO(m)
time, the overall runningtime ofthe procedureis
O(n2mkK).
4.3. Knapsack problems. Next consider the knapsack inequality
--1
ajxi<=
b,xi e
{0,
1}
(j 1,..,
n), where al=>a2=>"->an
>0. Thefeasible solutions to this inequality correspond in a natural way to the independent sets of an independence systemwithE
{1,
,
n}
andIe5ifix
ai<=
b.We
areinterestedingenerating allmaximal feasiblesolutions.
Consider the!
LI
{j}problem andassumethatILI
{j}g i.
Feasibilityisrestored by removing any element h from I t.J{j}. ThusK’
=<j, and the !U{j} problem can besolvedin
O(n)
time.For
a given!e5_,
definere(h)=
max{i[i <
h,i I};
letamax
00.A
setI’
(I-{h})U{j}
(h
el)passes the maximalitytestifand onlyifY’.gx,
ai-b a,(i>b, anditpasses the lexicographytestifand onlyif
1ag-
ah+
a,(h>
b.Moreover,
forallI’
arisingfromI
LI
{/’},
thesetests canbecarried out inO(n)
timealtogether.Itfollows that theoverall runningtime ofthe procedureisO(n2K).
The unbounded knapsack inequality, in whichthe
x.
are allowed to takeon anynonnegative integer value,isreducibletothe 0-1caseby introducing
2a.,
4ai,,
2kai
intotheproblemin addition toai,where kisthesmallest integer such that2k+lai
>
b.Then
E
containsO(n
logb)elements, and the algorithmis stillstrictly polynomial. 4.4. On-time sets of jobs.Suppose
there are njobstobeprocessed,one at atime, byasingle machine startingat time 0.Job/"
requiresanuninterruptedprocessing time ofpunitsand hasadeadline
dr.
LetE
{1,
,
n}
and letI
e ifall the jobsinIcanbe scheduledforcompletion bytheir deadlines.Itiswellknownthatsuchascheduleexists if and only if the jobs in I are all completed on time when sequenced in order ofGENERATING ALL MAXIMAL INDEPENDENT SETS 563 Again consider the I
U
{j}problem and assume that IU
{/’}g5j. In thiscase, we have,ixPi
+Pj>di.
Independence is restored by removing job j fromI
(.J{j} orby removingsomejobsfromIsuch thatjobj, which can beassumedtoremain in the lastposition,iscompletedontime. Itfollows thatsolving theI
LI
{j}problemisequivalentto finding all maximal subsets
H
_
I such thatiHPi <=
di-pi, which can beaccom-plished by applying the knapsackprocedure of 4.3. ByTheorem 3, the number of maximalsubsetsHdoes not exceedK-1.HencetheI(A{j}problemcanbe solved in
O(neK)
time.Since maximality and lexicography tests require
O(n)
time, it follows that the overall runningtimeoftheprocedureisO(n3K2).
4.5. Inequality systems. Theproblemsconsidered in 4.1, 4.3and4.4canallbe viewed a special instances of the general problem of finding all maximal feasible solutions to aninequalitysystem of theform
Ax
<=
b,xi{0,
1}(j 1,,
n),wherethe m n-matrixA (aij) and the m-vector b (bg) have nonnegative components.Forexample, givena et$
{1,
,
m}
andafamily 6e {$1,,
Sn}
of subsets of $, define aii-- 1 if $i,a0 0 otherwise.In
the case that bg 1 (i 1,...,m), the maximal feasible solutions correspond to the maximal packings inS;
they can be generated in polynomial time, as has been shown in 4.1. In the case thatbi-i-_la0-I
(i=l,...,m), the maximal feasible solutions correspond to thecomplements of the minimal coverings of S.
We
have not been able to devise apolynomial-time algorithm for this problem. Nor have we been able to obtain an
NP-hardnessresult similar to Theorem 1 for this case or even forageneral inequality system, although we conjecture that no polynomial-time algorithm exists unless Forthe scheduling problemdiscussed in 4.4,wehavem n, aii Pif >-- j, ai 0
otherwise,and bg dg (cf.
[4]).
Thesametechnique asabove can beappliedto aslightlywider class of inequality systems, where b is an m-vector with nondecreasing componentsandAis a nonnegativern n-matrixsuchthat
(i) aii
>
0implies aij,>0forall j’<j, and(ii) the strictly positiveentries in eachcolumnarenonincreasing.
Inthiscase, theI
U
{/’}
problemwithIU
{/’}
5i
canbesolvedby applying the knapsack procedure of 4.3tothe constraint ofsmallestindexh such that ahi>
O.Any
maximalsubset ofI
ID
{j}that satisfies constrainth willthen satisfytheremaining constraintsaswell.
Thereadermaybeableto constructotherexamplesin which a certainpropertyof Apermitsone to restrict attention to asingleconstraintwhenindependence hastobe restored. Ineachsuchcase, theknapsack procedurecanbe appliedtosolvetheIt_J{j}
probleminpolynomialtime.
4.6. Facetgeneration. Consider theconvexhullP of all 0-1 vectors x satisfying
the general inequality system
Ax
<-b, where A->_0. Balas and Zemel[1]
have established acorrespondence between thefacets
ofPandthe minimal covers ofA,
i.e.theminimal feasible solutions to
Ax
;
b. Such coversarein one-onecorrespondenceto the maximal feasible solutions toAx’
;
b’,
where b==1
ai-b-I
(i= 1,...,m),under the assumption that all dataareintegers.
Thus, in order to generate the facetsof
P,
it suffices togenerate the K maximal feasible solutions toAx’;
b’.Thisinequality systemcanbeconsidered asthedisjunc-tion
of
m knapsack inequalities--1
axi (i 1," ",m),theithsuch inequalityhaving
Ki
maximal feasible solutions.In
the casethatm 1, the procedure of 4.3can564 E. L. LAWLER, J. K. LENSTRA AND A. H. G. RINNOOY KAN
followingprocedure mayhave somepracticalvalue,eventhoughitis notpolynomialin K.
A
maximal feasible solution to the entiresystem hastobefeasibleand maximal withrespectto atleast oneof the separate inequalities.Theprocedureof 4.3 isnowapplied to each ofthese inequalitiesin turn.
However,
amaximal feasible solution toinequality isacceptedas amaximal feasible solution to Ax’;b’ onlyif it is (i) infeasible for eachofthe inequalities 1,..., i-1,and
(ii) infeasible or maximalfeasibleforeach of the inequalities
+
1,..., m.It is not hard to see that thisprocedure generates all minimal covers without
dupli-cation.
Forinequalityi,applicationoftheknapsackprocedurerequires
O(n2Ki)
time,and conditions (i)and (ii)canbecheckedinO(mn)
time foranycandidatesolution, or in O(mnKi) time altogether. Itfollows that the overall runningtime of theprocedure isO((rnn +n
2)
.Ki). Unfortunately, there exist inequality systems for whichKi
isexponentially relatedtoK. Forexample,inthe simplecasethatm n 1,aij 1,
b
(i 1,..
,
m, j 1,.,
n),wehaveKi
(i)
(i 1,.,
m),.
Ki
2 1,andK
n. Forsomespecialcases,truly polynomial-time algorithmscanstillbe obtained.Forexample,suppose
A
issuch thatthe entries ineachrow are monotonenonincreasing. IfILI
{j}’
,
then removal ofanyelement fromIU
{j}restoresfeasibility,sothatK’
<=
n.In
analogy to the above approach, one might view a general inequality systemAx
<=
bastheconjunction of m knapsack inequalities.Inthiscase,however,amaximal feasible solution tothe entiresystem can be feasible but nonmaximal with respecttoeachof theseparate inequalities.Itseemshardtomakeany significantprogressbeyond the special casesdiscussed in 4..5.
4.7. Matroid intersections.
A
matroidM (E,)
is anindependence system suchthatforallJ
___
E,
allindependentsets maximal withinJhavethe samecardinality[3].
Given rn matroids
Mi
(E,)
(i 1,,
m) withE{1,
,
n},
their intersection (E,)
is anindependence systemdefinedby f’l%
i.
Weareinterested in generat-ing allmaximal independentsets in(E, ), assuming that independence testinginM
requires
timeci
(i=l,...,m).Considerthe!
U
{j}problem. If!U
{j}.,
then addition of j must havedestroyed independencein someof themmatroids, say,inM1,,
Ml.
Each of these matroidsM,.contains a unique minimal dependent set or circuit Ci, and independence in
Mi
isrestored by removing anyoneelement from
C.
It follows that, in order to solve the
ILI
{j} problem, it is necessary to find all minimalsubsets ofLI
i--1Ci
that contain at least oneelement fromeachcircuit, i.e., all minimalcoverings of(C1,,
C).In
viewofour remark in 4.5,wesettlefor a bruteforceapproach:consideralln possiblesolutions. Thisyieldsanoverallrunningtime of
O(nm+2K
ci),whichis,atleast, polynomial forfixed m.Forcertain special cases, e.g. the generation of all spanningtrees
[7],
thespecialstructure ofthesystem can beexploited and significant improvements made.
5. An enumeration procedure of Read.
We
conclude by noting a relationship betweenourtechniques and thoseproposedby Read[6]
fortheenumeration ofgraphs, digraphs, andother combinatorialconfigurations.We
restate theessential features of Read’sprocedurein our terms, asfollows.The family
5.
is to be obtainedfromthefamily j-1 by applyingan augmentation operation to eachsetin3_1.
Thesesets areprocessedin a canonical linearorder"<"
GENERATING ALL MAXIMAL INDEPENDENT SETS 565
each
I’
6i,letf(I’)
denotethe first set in-1
whichproducesI’
whensubjectedtothe augmentation operation.Suppose
that thecanonicalorderis weaklymonotonic inthesense that for all
I’, I"
j,I’<I"
impliesf(I’)<=f(I").
Then it is simple to avoidduplications:whenapplyingtheaugmentation operation, retainthe next setproduced onlyif itfollows the member of5j that has been obtainedlastly.
Consider, forexample,how thisprocedureis applied by Readto generateallthe nonisomorphic digraphs onfive vertices. The nondiagonal elements of the adjacency
matrix are written as astringof20bits, which can beinterpretedas abinary integer. A canonical digraph is one which has the largest such integer of all digraphs in its
isomorphism class, and thisinteger is itscode. Let
5.-1
be the familyof all canonicaldigraphswith j- 1arcs;theircodes specify thecanonicallinearorder.Foreach!
._
1,theaugmentation operation produces digraphs
I’
with/"arcsby systematically changinga0 to a 1 in the 20-bitrepresentationof
L
Each such 1’istested for canonicity. EachI’
that passes the canonicity test is added to thelist
.
if and only if itscode is strictly greaterthanthatofthemostrecentlyobtainedmember ofi.
Itcanbe shown that theproperty ofweakmonotonicityis satisfied.Thus, allcanonicaldigraphswith j arcs are
generatedin thisway,withoutduplication.
We have been unable to devise a weakly monotonic ordering for the problems
considered in this paper. The lexicography test of Tsukiyama et al. is, in effect, an alternative toRead’s technique for eliminating duplications andamounts toan analysis of the inverse of the augmentation operation. That is, when
I’
is obtained from I,-/-1, I’
isretainedonlyiff(I’)
L
wheref(I’)
denotesthelexicographically smallestsetin
5.-1
whichproducesI’
whensubjectedto the augmentation operation.REFERENCES
[1 E. BALASANDE.ZEMEL,All thefacets ofzero-one programmingpolytopeswith positivecoefficients, ManagementSciencesResearchReport374, Carnegie-MellonUniversity,Pittsburgh, 1975.
[2] S. A. COOK, The complexity oftheorem-proving procedures, Proc. 3rd AnnualACM Symp.Theory Comput.,(1971),pp. 151-158.
[3] E.L.LAWLER,CombinatorialOptimization: NetworksandMatroids, Holt, Rinehart andWinston,New York,1976.
[4] E.L. LAWLERANDJ.M. MOORE, Afunctionalequationanditsapplicationtoresourceallocationand
sequencingproblems,ManagementSci., 16(1969),pp. 77-84.
[5] M.C. PAULLANDS.H. UNGER,Minimizingthe numberofstatesinincompletely specified sequential
switchingfunctions,IRE Trans.Electron.Comput.,EC-8(1959),356-367.
[6] R.C.READ,Everyone a winner,orhowtoavoidisomorphism searchwhen cataloguingcombinatorial
configurations,Ann.DiscreteMath, 2(1978),pp. 107-120.
[7] R.C.READANDR. E.TARJAN,Bounds onbacktrack algorithmsforlistingcycles, paths, andspanning trees,Networks, 5(1975),pp. 237-252.
[8] S. TSUKIYAMA, M. IDE, M. ARIYOSHIANDI.SHIRAWAKA,A newalgorithmforgenerating allthe