efficient parallel algorithms for combinatorial problems

82

Upload: oscar-garrido

Post on 30-Mar-2016

240 views

Category:

Documents


1 download

DESCRIPTION

Ph. D. Thesis

TRANSCRIPT

Page 1: Efficient Parallel Algorithms for Combinatorial Problems

E�cient Parallel Algorithms for

Combinatorial Problems

Oscar Garrido G�omez

Department of Computer Science

Lund University

Sweden

Page 2: Efficient Parallel Algorithms for Combinatorial Problems

CODEN�LUNFD���NFCS����������������

c�Oscar M� Garrido G�omez January ����

Department of Computer Science

Lund University

Box ���

S�� �� Lund

Sweden

Typeset in LATEX

Pictures where done using x�g and inserted as Postscript� �gures

�Postscript is a registered trademark of Adobe Systems Incorporated

Page 3: Efficient Parallel Algorithms for Combinatorial Problems

AbstractThis thesis is concerned with the design of e�cient parallel algorithms forsome optimization graph problems� A graph can be seen as a collectionof vertices �V �� and a collection of edges �E� joining all or some of thevertices� One is very often interested in �nding subsets� either fromthe set V of vertices or from the set E of edges� which possess someprede�ned property� A subset S of vertices or edges in a graph G is saidto be maximum with respect to a property if� among all the subsets ofG having this property� S is one having the largest cardinality� Set S issaid to bemaximal with respect to a property� if the set has the property�and it is not a proper subset of another set having this property�

A subset of vertices in a graph� is said to be independent if no twoof them are adjacent� The problems of �nding maximum and maximalindependent sets in a graph are well known� One of the more naturalgeneralizations of the notion of independent set is the notion of theso called k�dependent set� For any positive integer k� we call a set Qof vertices a k�dependent set� if each vertex in Q has no more than kneighbours in Q� Thus the notion of independent set is equivalent tothe notion of ��dependent set�

In this thesis we prove that the maximum k�dependent set problemis NP�complete for every �xed integer k even when restricted to planargraphs� We extend some well known approximation heuristics for themaximum independent set problem for planar graphs to include max�imum k�dependent sets� We also observe that these problems can besolved in linear time when restricted to graphs with constantly boundedtree�width�

While the problem of �nding a maximum k�dependent set in a graphis NP hard� �nding a maximal k�dependent set can be easily done in lin�ear time using a greedy algorithm� However� the problem of constructinge�cient parallel algorithms for �nding a maximal k�dependent set is nottrivial� We present the �rst NC algorithm� i�e�� algorithm running inpoly�logarithmic time with polynomial number of processors� for thisproblem�

A subset of the set of edges in a graph such that no two edges inthe set are adjacent is called a matching� in other words an independentset of edges is a matching� A useful generalization is the notion of f �

Page 4: Efficient Parallel Algorithms for Combinatorial Problems

matching� Let f be an integer valued function de�ned over the set ofvertices� such that for each vertex v� � � f�v� � deg�v�� An f �matchingis a subset of edges such that for each vertex v at most f�v� edges ofthe subset are adjacent to v� Taking f�v� � for all vertices v resultsin an ordinary� matching�The problem of �nding a maximum matching is sequentially solvable

in polynomial time� We don�t know whether it is possible to �nd an NCalgorithm for this problem� We show that the maximum f �matchingproblem is NC reducible to the maximum matching problem� Again� amaximal f �matching can be trivially constructed by a greedy sequentialalgorithm� Designing parallel algorithms for this problem requires morecomplicated methods� Here we present the �rst NC algorithm for thisproblem running in time O�log� n� with a linear number of processorsand a simple randomized NC algorithm� faster by a logarithmic factor�We also present faster algorithms for this problem for several restrictedgraph families�A hypergraph H � �V�E� is a natural generalization of a graph�

where an edge in E is an arbitrary subset of the set V � An independentset in H is a subset of V which doesn�t include any edge in E� Theparallel complexity status of �nding a maximal independent set in anarbitrary hypergraph is regarded as a major open problem in parallelcomplexity theory� We show that this problem admits NC algorithms ifthe input hypergraph is of so called poly�logarithmic arboricity�

Page 5: Efficient Parallel Algorithms for Combinatorial Problems

AcknowledgmentsThis thesis is the result of several years of hard work� and it wouldnever have been �nished without the cooperation of many people� I owethanks to each of them� but there are some I especially wish to mention�I am greatly indebted to my friend and advisor Prof� Andrzej Lingas

for his guidance and friendship� he has always been there when I neededhim� Furthermore I wish to thank the people of the Institute of Informat�ics of Warsaw University� especially Dr� Krzysztof Diks� Prof� WojciechRytter and Dr� Stefan Jarominek� Some of the results presented here arethe fruit of collaboration with them� I am also grateful to the members ofthe Algorithm Group at our department� it has been a pleasure to workwith them� Particularly I thank Dr� Christos Levcopoulos for carefullyreading the manuscript and providing helpful comments� Also thanksgo to Anders Dessmark for our interesting and fertile discussions� andto Dr� Bengt Nilsson and Victor Vargas for sharing pleasant momentsduring the last years�I am deeply grateful to my wife Norka for her constant encourage�

ment and support and to my children Bianca and Oscar Andr e whomake my life enjoyable� This work is therefore dedicated to them�Finally I would like to thank for the �nancial support granted by

Lund University and the Swedish Research Council for Engineering Sci�ences �TFR��

Page 6: Efficient Parallel Algorithms for Combinatorial Problems
Page 7: Efficient Parallel Algorithms for Combinatorial Problems

To my wife Norka� and my children

Bianca and Oscar Andr�e� with love

Page 8: Efficient Parallel Algorithms for Combinatorial Problems
Page 9: Efficient Parallel Algorithms for Combinatorial Problems

Contents

� Introduction �

� A Parallel model of computation � � � � � � � � � � � � � � �

�� Graph terminology � � � � � � � � � � � � � � � � � � � � � � �

�� Optimization graph problems � � � � � � � � � � � � � � � � �

��� Independent set problems � � � � � � � � � � � � � � �

���� Maximal independent sets in hypergraphs � � � � � �

���� Matching problems � � � � � � � � � � � � � � � � � � �

� k�dependent Sets ��

�� Maximum k�dependent set problem � � � � � � � � � � � � �

��� NP�completeness � � � � � � � � � � � � � � � � � � � �

���� Fast algorithms for trees � � � � � � � � � � � � � � � �

���� Approximation for planar graphs � � � � � � � � � � �

��� Maximum f �dependent set problem � � � � � � � � � � � � � �

��� Maximal k�dependent set problem � � � � � � � � � � � � � �

���� A NC algorithm for maximal k�dependent set � � � �

����� A maximal k�dependent set algorithm for boundeddegree graphs � � � � � � � � � � � � � � � � � � � � � ��

��� Maximal f �dependent set problem � � � � � � � � � � � � � ��

� f�matchings ��

�� Maximum f �matching problem � � � � � � � � � � � � � � � ��

��� The decision version of DSP is in NC � � � � � � � ��

��� Maximal f �matching for restricted graphs � � � � � � � � � �

���� Maximal f �matching in constant�degree graphs � � �

����� f �matching in sparse graphs � � � � � � � � � � � � � ��

��� f �matching in general graphs � � � � � � � � � � � � � � � � ��

Page 10: Efficient Parallel Algorithms for Combinatorial Problems

��� A randomized parallel algorithm for maximal f �matchings ��

� Hypergraphs ��

�� Introduction � � � � � � � � � � � � � � � � � � � � � � � � � � ����� MIS in hypergraphs � � � � � � � � � � � � � � � � � � � � � ����� MIS in sparse hypergraphs � � � � � � � � � � � � � � � � � � ��

���� Hypergraph arboricity � � � � � � � � � � � � � � � � ������� MIS in hypergraphs of bounded arboricity � � � � � ������� MIS in hypergraphs of bounded dimension and va�

lence � � � � � � � � � � � � � � � � � � � � � � � � � � �

� Conclusions ��

Page 11: Efficient Parallel Algorithms for Combinatorial Problems

Chapter �

Introduction

Nothing is more important than to see the sour�

ces of invention� which are� in my opinion� more

interesting than the inventions themselves�

G� W� Leibniz

Many branches of engineering and science rely on graphs for representinga wide variety of objects from electrical circuits� chemical compounds�crystals to genetic processes� sociological structures and economical sys�tems� In many areas of computer science� graphs are used to organizedata � to model algorithms as a powerful tool for representing compu�tational concepts� It is therefore important for these applications thate�cient algorithms to manipulate graphs are developed�

Since the early days of information processing� one has realized thatit is greatly advantageous to have components of a computer to do di�er�ent things at the same time� Today�s most powerful computers containseveral processing units sharing jobs submitted for processing� Duringthe last few years parallel computation has rapidly become a dominanttheme in all areas of computer science and its applications�

The problems whose parallel complexity is the subject of this thesisare natural generalizations of well known graph problems�

Page 12: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� Introduction

Shared Global Memory

Main Control Program

P� P� P� Pn�� Pn

Figure �� The PRAM model of computation�

��� A Parallel model of computation

To design and analyze parallel algorithms� we need to introduce thefollowing model of parallel computation�

De�nition ��� A Parallel Random Access Machine �PRAM� is anidealized model of parallel computation� and can be viewed as the par�allel analog of the sequential RAM model� A PRAM consists of severalindependent sequential processors� each with its own private memory�communicating together through a global memory� In one unit of time�each processor can read one global or local memory location� execute asingle RAM operation� and write into a global or local memory location�

In the PRAM model there is a possibility of read and write con�icts�in which two or more processors try to read or write in the same memorycell concurrently� The di�erences in the way of handling these con�ictslead to several variants of the model�

� EREW PRAM Exclusive Read ExclusiveWrite PRAMOnly one processor may access any single memory location at thesame time�

� CREW PRAM Concurrent Read Exclusive Write PRAMAny memory location can be simultaneously read by many proces�

Page 13: Efficient Parallel Algorithms for Combinatorial Problems

���� A Parallel model of computation �

sors� but can be written to by at most one processor at the sametime�

� CRCW PRAM Concurrent Read ConcurrentWrite PRAMAny time� many processors can access a given memory location�

The CRCW PRAM requires the application of some rule for writingcon�icts� several variations are possible� for example�

� Common CRCW PRAMAll processors writing at the same memory location must write thesame value�

� Arbitrary CRCW PRAM

Any of the processors may succeed in writing� and the algorithmshould work regardless of which one does�

� Priority CRCW PRAM

There is a linear order among the processors and the minimumnumbered processor succeeds in writing�

The above PRAM variants do not di�er much in computationalpower� For example� If an algorithm A on a Common CRCW PRAMtakes time T with p processors� it can be simulated on an EREW PRAMin time T � O�log p� using p processors �����

De�nition ��� Let a PRAM algorithm A solve a problem P of size nin time T �n� using p�n� processors� Then the work w�n� of the algorithmis de�ned by�

w�n� � p�n� � T �n��

Any PRAM algorithm that does w�n� work can be converted to asequential algorithm that runs in time O�w�n���

De�nition ��� An optimal parallel algorithm is an algorithm forwhich�

w�n� � O�TS�n��where TS�n� is the time expended by the fastest sequential algorithmfor the problem�

Page 14: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� Introduction

De�nition ��� A problem belongs to the class NC introduced in ��if it can be solved by a PRAM algorithm in poly�logarithmic time using apolynomial number of processors� That is� if T �n� and p�n� respectivelystand for the time and the number of processors used by the algorithmthen

T �n� � O�logk n�p�n� � O�n��

for some integer constants k and ��

De�nition ��� More re�ned notions of parallel complexity are ob�tained by de�ning the following family of important subclasses of NC�NCk is the subset of NC in which the parallel time is O�logk n�� Here weallow any degree in the polynomial bounding the number of processors�

De�nition ��� Analogously� the randomized NC class �RNC� is theclass of problems computable by a randomized PRAM algorithm in poly�logarithmic expected time using a polynomial number of processors�

Usually it is much easier to design RNC algorithms than NC algo�rithms� If we succeeded in showing a problem to be in NC� the next stepis to design an optimal NC�algorithm for the problem�There are many problems admitting polynomial�time sequential al�

gorithms which do not seem to admit fast parallel algorithms� e�g�� theso�called P�complete problems�

��� Graph terminology

We shall use in particular the following graph conventions and notations�By a graph we mean a simple graph� i�e�� a graph without self�loopsand multi�edges� Let G � �V�E� be a graph� We denote the numberof vertices of a graph by n �jV j � n�� and the number of edges bym� �jEj � m�� For any set S � V � we de�ne the neighbourhood of S inG as�

NG�S� � fw � V j there exists u � S such that �u�w� � Eg�In the same way� the set of neighbours of a node v in the graph G is theset NG�v� � NG�fvg��

Page 15: Efficient Parallel Algorithms for Combinatorial Problems

���� Optimization graph problems �

When it is clear in the context which graph we are referring to� we usethe notation N�S� and N�v�� instead of NG�S� and NG�v��The number of neighbours of a vertex v in a graph G is called the degreeof v in G and denoted as degG�v�� The maximum degree in a graph iscalled its valence� In a similar manner� for a given subgraph H of G�and for any vertex v of G� we de�ne the degree of v in H as the numberof neighbours of v which are vertices of the subgraph H� and denote itas degH�v�� Note that in the last de�nition the vertex v doesn�t need tobe in H�If S � V then ��S� will denote the subgraph induced by S� This sub�graph has vertex set S� and its edge set E��S� consists of these edges inE that are incident only to vertices in S�

The arboricity ��G� of a graph G is the minimum number of foreststhe edges of G can be partitioned into� For example� graphs of boundedgenus and partial k�trees have constant arboricity�

��� Optimization graph problems

One is often interested in �nding subsets� either from the set V of verticesor from the set E of edges� which possess some prede�ned property� Asubset S of vertices or edges in a graph G is said to be maximum withrespect to a property if� among all the subsets of G having this property�S is one having the largest cardinality� Set S is said to be maximal withrespect to a property� if the set has the property� and it is not a propersubset of another set having the property�

����� Independent set problems

A subset of vertices in a graph� is said to be independent if no two ofthem are adjacent� i�e� no two vertices are joined by an edge�

Maximum independent sets

The problem of determining whether a given graph contains an inde�pendent set of prescribed size is NP�complete ����� Even if we restrictour attention to cubic planar graphs the problem remains NP�complete����� This implies that there is no realistic hope to design polynomialtime algorithms to exactly solve the problem� As for many optimization

Page 16: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� Introduction

problems the task of �nding a good approximate solution for maximumindependent set is often as di�cult as that for �nding the optimumsolution ���� Therefore e�cient approximation algorithms have been de�signed for the problem restricted to special graph classes� These kindof algorithms are evaluated by the worse�case ratio� the smallest ratioof the size of the approximated solution over the size of the maximumsolution�

For planar graphs Lipton and Tarjan using their well known Pla�

nar separator theorem ����� designed a O�n log n� time approximationalgorithm with a worse�case ratio of �O� �p

log log n� asymptotically ap�

proaching as n� � ����� Another approach was used by Baker whofound a linear time approximation algorithm running in time O��kkn�for any positive integer k with the worse�case ratio of k

k�� ����

The maximum independent set problem can be expressed in linearextended monadic second order logic� Consequently it can be solved inlinear time if the input graph is of bounded tree�width and is providedwith its tree�decomposition ���

Maximal independent sets

While the problem of constructing a maximum cardinality independentset is NP�hard ����� the problem of constructing a maximal independentset �MIS for short� can be trivially solved in linear time �See Algorithm��� However� the problem of constructing an e�cient NC algorithmfor MIS is non�trivial� For a period of time it was believed that themaximal independent set problem was one of the problems for whichthere is no NC algorithm� Algorithm � clearly runs in linear time�The maximal independent set output I obtained by this algorithm iscalled the lexicographically �rst maximal independent set �LFMIS forshort�� Cook ��� showed that the LFMIS problem is NC�complete forP� Karp andWidgerson ���� were the �rst who proved that the problem isin NC�� They presented a parallel randomized algorithm with expectedrunning time O�log� n� using O�n�� processors on a EREW PRAM� and

a deterministic algorithm with running time O�log� n� using O� n�

log� n�

processors also on a EREW PRAM� Presently� the most e�cient de�terministic NC algorithm is due to Goldberg and Spencer ����� It runsin time O�log� n� and uses an EREW PRAM with a linear number of

Page 17: Efficient Parallel Algorithms for Combinatorial Problems

��� Optimization graph problems �

Algorithm Sequential�Maximal�Independent�Set�G�input � A graph G � �V�E�output � A maximal independent set I on G�method �

I � �for v � V do

if v �� N�I� then

I � I � fvg�endif

endfor

output I �end Sequential�Maximal�Independent�Set

Algorithm ���

processors� Luby has constructed a randomized parallel algorithm forMIS that runs in time O�log� n� and uses a EREW PRAM with O�nm��processors �����

Algorithm Parallel�Maximal�Independent�Set�G�input � A graph G � �V�E�output � A maximal independent set I on G�method �

I � �A� V

while A �� � do

C � FINDSET�A��I � I � C�A� A n �C �N�C��

endwhile

output I �end Parallel�Maximal�Independent�Set

Algorithm ���

Both Karp�s� and Goldberg�Spencer�s algorithms use the same toplevel description� �Algorithm ���� di�ering only in the procedure FIND�SET�It is easy to prove that an algorithm with the top structure of Al�

gorithm �� has a poly�logarithmic running time if every call to thefunction FINDSET produces an independent set C such thatjC �N�C�j � �� jAj

logs jAj� for some �xed s ��

Page 18: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� Introduction

Luby ���� derived �with the same top level description� a Monte Carloalgorithm which can be implemented on a EREW PRAM with O�nm��processors with running time O�log� n��Gazit and Miller used their planar separator algorithm to derive

an algorithm which for planar graphs constructs an independent set

of size within � O�q

�log log n� from the maximum and runs in time

O�log�n� � log log�n�� on a probabilistic PRAM with n��� processors forarbitrary small given ��

����� Maximal independent sets in hypergraphs

A hypergraph H � �V�E� is a natural generalization of a graph� Eachedge of E in H is a non�empty subset of V � For a vertex v in V� thedegree deg�v� of v in H is the number of edges in E it belongs to� Themaximum degree of a vertex in V is called the valence of H� and themaximum cardinality of an edge in E is called the dimension of H� Ahypergraph of dimension two is simply an undirected graph �if singletonsare neglected�� An independent set of H is a subset of V which doesn�tinclude any edge in E� A maximal independent set �MIS� for short� ofH is an independent set which is not a subset of any other independentset of H�

A MIS of a hypergraph can be trivially computed in polynomial timeby a greedy method� The parallel complexity status of �nding a MIS ofan arbitrary hypergraph is regarded as a major open problem in parallelcomplexity theory �See Section ��� for details��

����� Matching problems

A subset of the set of edges in a graph such that no two edges in theset are adjacent is called a matching� In other words� a matching is asubset of the set of edges of G in one�to�one correspondence with anindependent set in the edge graph induced by G� In the edge graph� thevertices correspond to the edges of G and two such vertices are adjacentif and only if the corresponding edges of G are incident in G�

Page 19: Efficient Parallel Algorithms for Combinatorial Problems

��� Optimization graph problems �

Maximum matchings

A maximum matching is a matching of maximum cardinality� that is� amatching M such that for any matching M �� jM j jM �j holds�

Contrary to the maximum independent set problem which is knownto be NP�complete� the maximum matching problem admits polyno�mial time solutions� The best known sequential algorithm for the latterproblem is due to Micali and Vazirani ���� and runs in time O�pn �m��Finding a maximum matching in a graph is a fundamental problem

in combinatorial optimization� It is a major open problem whether amaximum matching can be constructed by an NC algorithm� Achiev�ing simultaneously a poly�logarithmic�time and a polynomial number ofprocessors is possible for this problem if random bits are used� Random�ized NC algorithms have been given for constructing maximummatching��� ��� ��� ���� They also yield randomized NC algorithms for severalother problems not known to be in NC� e�g�� depth �rst search� max�imum network �ow with polynomially bounded edge capacities� maxi�mum weight matching with polynomially bounded edge weights ���� ����

Maximal matchings

A matching is maximal if it is not a proper subset of any other matching�While the best known sequential algorithm for constructing a maxi�

mum cardinality matching runs in timeO�pn�m�� the problem of �ndinga maximal matching �MM for short� admits trivial linear�time sequen�tial solutions� Also� the known NC algorithmic solutions to MIS can bespecialized to MM� However� as the edge graph may have a quadraticnumber of edges with respect to the size of the input graph� more e��cient NC algorithms for MM can be derived directly� Presently� the moste�cient deterministic algorithm for MM is due to Israeli and Shiloach����� It can be implemented in time O�log� n� on a CRCW PRAM witha linear number of processors� and consequently in time O�log� n� onan EREW PRAM with a linear number of processors ����� The RNCalgorithm for the same problem due to Itai and Israeli ���� works in timeO�log n� on an CRCW PRAM with O�n�m� processors�

Page 20: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� Introduction

Page 21: Efficient Parallel Algorithms for Combinatorial Problems

Chapter �

k�dependent Sets

I ain�t get nobody� that I can depend on�

No tengo a nadie���

Carlos Santana

Let k be a non�negative integer� A k�dependent set in a graph G isa subset of the set of vertices of G such that no vertex in the subset isadjacent to more than k vertices of the subset� This subset induces asubgraph of G of maximum degree bounded by k�

Note that a ��dependent set in G simply means an independent set ofvertices on G� Further� �dependent set is in general a set of independentvertices and edges whereas a ��dependent set is a set of independentpaths� possibly degenerated� such that no two non�consecutive verticeson any of these paths are adjacent� These paths are called permissible

����

��� Maximum k�dependent set problem

Maximum cardinality k�dependent sets� for k � �� have applicationsin information dissemination in hypercubes with large number of faultyprocessors� The cardinality of a largest ��dependent set in a networkis an upper bound on the length of maximum permissible path in thenetwork which in turn bounds the time of dissemination of informationin the network when the majority of the processors are faulty ����

Page 22: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� k�dependent Sets

We shall term the problem of �nding a maximum cardinality k�dependent set in a graph as the maximum k�dependent set problem� Thelatter is a natural generalization of the maximum independent set prob�lem resembling such problems as the NP�complete degree constrainedsubgraph problem and the f �matching problem solvable in polynomialtime �see ������ We shall also term the union of the maximum k�dependent set problems� as the maximum multi�dependent set problem�An instance of the above problem consists of a graph and a non�negativeinteger k� and the solution is a maximum k�dependent set for the graph�As the maximum independent set problem trivially reduces to the max�imum multi�dependent set problem� the latter is clearly NP�complete�

����� NP�completeness

The decision version of the maximum k�dependent set is as follows� Fora non�negative integer � and a graph G � �V�E�� decide whether thereis a k�dependent set of cardinality not less than � in G�

Theorem ��� For any non�negative integer k� the decision version ofthe maximum k�dependent set is NP�complete�

Proof The maximum k�dependent set problem is clearly in NP sincewe need only to guess a subset Q of V of size � and check in polynomialtime that for each vertex v � Q� deg��Q��v� � k�

To prove that the maximum k�dependent set problem is NP�com�plete� it su�ces to show that the maximum independent set problem ismany�one polynomial�time reducible to the maximum k�dependent setproblem� for any positive integer k�Let G be a graph on n vertices� Let H be the graph constructed in

the following way�Copy the original graph G� Now hang k pendants on all the originalvertices�By de�nition all pendant vertices form an independent set S� By theconstruction this independent set is maximal� We are going to showthat there exists a maximum k�dependent set S in H which contains allpendant vertices�Let S� be a maximum k�dependent set in H which does not contain allpendant vertices� Let w be a pendant vertex inH which is not in S�� thatmeans that the neighbour v of w is in S� and that v has k�neighbours in

Page 23: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximum k�dependent set problem �

H

G

Figure ��� Example of the reduction of the maximum independent set prob�lem to the maximum k�dependent set problem for k � �

S�� which implies that at least one not pendant neighbour u of v is inS�� We can now construct another k�dependent set S by deleting u andadding w and all pendant neighbours of u into S�� Clearly jSj jS�j�Repeating this procedure for all pendant vertices which are not in S� weobtain a maximum k�dependent set S in H which contains all pendantvertices�Note that jSj � the number of pendants plus the cardinality of a max�imum independent set of G� also the reverse inequality holds� since theunion of the set of pendants and a maximum independent set in G is k�dependent� Suppose now that we can construct a maximum k�dependentset in polynomial time� Then to construct a maximum independent setof G� we just construct the graph H� compute a maximum k�dependentset in H� construct the maximum k�dependent set which contains allpendant vertices� and clearly the non�pendant vertices of the maximumk�dependent set form a maximum independent set� Observe that thereduction used here preserves planarity� �

Page 24: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� k�dependent Sets

����� Fast algorithms for trees

The NP�completeness of the decision version of the maximum k�depen�dent set does not exclude the possibility of the existence of e�cient al�gorithms for constructing a maximum cardinality k�dependent set whenthe input graph ranges over a more restricted graph family� Below wegive a simple linear�time algorithm �Algorithm ��� for the maximummulti�dependent set problem in trees�The idea �Algorithm ��� is to root the input tree T � and process

the vertices v of the tree� whose all sons have been already processed�as follows� augment Q by v if Q remains k�dependent �note that inparticular all leaves become elements of Q�� Assume inductively thatthere is a maximum cardinality k�dependent set S in T that includesall vertices from the current Q and excludes all other vertices processedbefore the vertex v� If Algorithm �� inserts v into Q and S does notinclude v then the father of v is in S� Now by deleting the father of vfrom S and inserting v instead we obtain another maximum cardinalityk�dependent set S� which includes the current Q after inserting v intoQ� In this way the correctness of the algorithm follows�

Theorem ��� A maximum cardinality k�dependent set in a tree onn vertices is constructed by Algorithm ��� in time bounded by cn wherec is a positive constant independent of k� In other words� Algorithm ���solves the maximum multi�dependent set problem in linear time�

Proof The correctness of Algorithm �� follows from the argumenta�tion preceding its de�nition� Its linear time performance is a consequenceof the fact that each vertex v in T is inserted on L only once and itsprocessing when picked up from L takes a constant number of operationsindependent of k� �

Using Algorithm �� we can �nd tight lower bounds on the maximumcardinality of k�dependent sets� as it is stated in the following theorem�

Theorem ��� A maximum cardinality k�dependent set in any treewith n vertices contains at least dk��

k��ne vertices� and this bound is tightfor any integers k and n� k � and n �Proof In Algorithm �� for each vertex v not in Q the following holds�either v has at least k � sons in Q or v has some son v� such that

Page 25: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximum k�dependent set problem �

Algorithm Maximum�Cardinality�k�Dependent�Set�T �input � A non�negative integer k and a tree T �output � A maximum cardinality k�dependent set Q in T �method �

root TQ� �L� empty listfor all vertices v � T do

sons�in�Q�v�� �waiting�sons�v�� the number of sons of v in Tcandidate�v�� trueif v is a leaf then

insert v on Lendif

endfor

while L is not empty do

pop a vertex v from L

if v is the root of T then

if candidate�v� and �sons�in�Q�v� � k� then

insert v into Qendif

output Qexit

endif

f � father of v in Tif candidate�v� and �sons�in�Q�v� � k� then

insert v into Qsons�in�Q�f�� sons�in�Q�f� � �

endif

if candidate�v� and �sons�in�Q�v� � k� then

candidate�v� � falseendif

waiting�sons�f� � waiting�sons�f� ��if waiting�sons�v� � � then

insert f into Lendif

endwhile

end Maximum�Cardinality�k�Dependent�Set

Algorithm ���

Page 26: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� k�dependent Sets

v� is in Q and v� has exactly k sons in Q� Thus for each vertex notin Q there are at least k � distinct vertices in Q� so the lower boundfollows� To see� on the other hand� that for any integers k � and n there exists a tree such that any k�dependent set of the tree has at mostdk��k��ne vertices� consider b n

k��c copies of a star graph� each consistingof one vertex of degree k � and k � vertices of degree one� Let T besome tree obtained by connecting those copies through edges and addingsome additional vertices if necessary� so that the total number of verticesbecomes n� We observe that for each copy of the star at most k � ofits vertices can be in the same k�dependent set� Hence no k�dependentset of T has more than dk��

k��ne vertices� �

In order to obtain a work�optimal logarithmic time parallel implemen�tation of Algorithm �� in a PRAM model we can use the parallel ex�pression evaluation algorithm �see ��� ����� In this way we obtain thefollowing result�

Theorem ��� A maximum cardinality k�dependent set in a tree onn vertices can be constructed in time O�log n� using an EREW PRAMwith O� n

log n� processors�

For a �xed k� the maximum k�dependent problem can be relatively easilyencoded by a formula of the extended monadic second order logic whichby the general fact proved in ���� Section �� yields the following theorem�

Theorem ��� Given a non�negative integer k� the problem of �ndinga maximum k�dependent set in a graph of tree�width bounded by aconstant is solvable in linear time if the graph is given together with itstree decomposition�

The drawback of the above solution to the maximum k�dependentset problem for graphs of bounded tree width is a high constant of pro�portionality which is a monotone function of the bound on the tree widthand k plus the requirement of having a constant width tree decomposi�tion of the graph� Of course� in case of trees� we have the decomposi�tion for free� and consequently the above theorem also implies a lineartime�bound on the construction of a maximum k�dependent set for atree� However� the bound depends on k and therefore it is subsumed bythat given in Theorem ���� yielding solution to the maximum multi�dependent set problem�

Page 27: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximum k�dependent set problem �

����� Approximation for planar graphs

The decision version of the maximum independent set problem is knownto remain NP�complete when restricted to planar graphs ����� As thereduction given in the proof of Theorem ��� preserve planarity weconclude�

Theorem ��� The maximum k�dependent set problem remains NP�complete even when the input graph is planar�

Here we only observe that the known approximation heuristics forconstructing a maximum independent set for planar graphs �see ��� ����can be easily generalized to include maximum k�dependent set�

Theorem ��� Let k be a non�negative integer� and let G be a pla�nar graph on n vertices� A k�dependent set in G of size within �O� �p

�log log n�� from the maximum can be constructed in time O� n

log n��

Proof Adopt the approximation method for maximum independentset due to Lipton and Tarjan ���� that recursively splits the input graphinto pieces of size O�log log n� using a version of the planar separatortheorem� For each of the pieces apply an exhaustive search algorithm inorder to �nd a maximum k�dependent set within it� The union of theoptimal solutions for the pieces is the sought approximation� �

Theorem ��� Let k be a non�negative integer� let � be a positiveinteger� and let G be a planar graph on n vertices� A k�dependent setin G of size within �

��� from the maximum can be constructed in lineartime�

Proof Adopt the approximation method for maximum independentset due to Baker ��� that splits G into �� split graphs whose connectedcomponents are ��outerplanar graphs� For each of the split graphs �nda maximum cardinality k�dependent set� As an ��outerplanar graph is agraph of O��� tree width� the latter can be done in linear time by The�orem ����� Choose the largest of the above sets as the approximation��

We can also derive poly�logarithmic time implementations of the ap�proximation algorithms for maximum k�dependent set in planar graphs

Page 28: Efficient Parallel Algorithms for Combinatorial Problems

� Chapter �� k�dependent Sets

which use polynomial numbers of processors� For instance� to obtain aparallel analogue of Theorem ����� we could use the poly�logarithmictime algorithm for simple cycle separator in planar triangulated graphs���� due to Gazit and Miller �we would add dummy edges to triangulatethe input graph��The algorithm uses random bits and n��� processorsfor arbitrary small given �� This leads to the following proposition�

Theorem ��� Let k be a non�negative integer� and let G be a pla�nar graph on n vertices� A k�dependent set in G of size within �O�q

�log log n� from the maximum can be constructed in poly�logarithmic

time using a probabilistic PRAM with n��� processors for arbitrary smallgiven ��

��� Maximum f�dependent set problem

Let f�V � � Z� be a non�negative function de�ned on the vertex set Vof a graph G� A f �dependent set in G is a subset F of the vertices ofG such that no vertex v � F is adjacent to more than f�v� vertices inF � Clearly the notion of f �dependent set is a natural generalization ofof the notion of k�dependent set�

Theorem ��� The decision version of the maximum f �dependent setis NP�complete for planar graphs�

Proof Generalize the proof of Theorem ���� by constructing H in thefollowing way� for each v in G� hang f�v� pendants on the copy of thevertex v� �

��� Maximal k�dependent set problem

We can naturally generalize the notion of maximal independent setsto include maximal k�dependent sets� Again� the problem of �nding amaximal k�dependent set can be solved by a trivial greedy algorithm inlinear time� At this point it is natural to ask whether this generalizedproblem admits NC algorithms�In this chapter we give an a�rmative answer to the above question� We

Page 29: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximal k�dependent set problem �

present the �rst NC algorithm for constructing a maximal k�dependentset in a graph G on n vertices ���� The algorithm runs in time O�log� n�using an EREW PRAM with O�n�� processors� We also observe that ifG has bounded valence then it can be modi�ed to run in time O�log� n�on an EREW PRAM with a linear number of processors� The algorithmcan be also easily generalized to �nd a maximal f �dependent set in Gin time O��log� n� � �max

v�Vf�v���� using an EREW PRAM with O�n��

processors�

����� A NC algorithm for maximal k�dependent set

Our parallel algorithm for maximal k�dependent �k � �� set can be seenas an NC Turing�like reduction to the problem of constructing a maximal��dependent �independent� set �MIS�� Recall that the best known par�allel algorithm for MIS runs in time O�log��n�� using O�n�m� EREWprocessors ����� We shall analyze our algorithm also in terms of theEREW shared memory model� where simultaneous reads and writes intothe same memory locations are not permitted�

Algorithm MDS �G�input � A graph G � �V�E��output � A maximal k�dependent set Q for G�method �

Q� Maximal�Independent�Set�G��R� V nQ�B � fv � R j deg��Q��v� � kg�while B �� � do

H � the graph whose set of vertices is Bsuch that �v� w� is an edge of H i�v and w have a common neighbour in Qor �v� w� is also an edge in G�

M � Maximal�Independent�Set�H��Q� Q �M �S � fv � Q j deg��Q��v� � kg�R� R n �M �N��R��S���B � fv � R j deg��Q��v� � kg�

endwhile

output Q�end MDS

Algorithm ���

Page 30: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� k�dependent Sets

Lemma ��� Algorithm ��� is partially correct� i�e�� if it stops thenthe set Q to output is a maximal k�dependent set in G�

Proof It is su�cient to observe that the augmentation of Q by M iscorrect since M is in particular independent in G� no two vertices in Mshare a common neighbour in Q and no vertex in M is a neighbour of avertex in Q that has already k neighbours in Q� �

Lemma ��� The block under the while statement is iterated O�k��times�

Proof For a vertex v � G� let cap�v� � min�degG�v�� k� � jN��Q��v�jat a given stage of performance of Algorithm ���� Consider a vertexv � B at the beginning of the i�th iteration of the block� Next� letg�v� �

Xw�N��Q��v�

cap�w�� Note that g�v� is always bounded by k� from

above� Also� if v disappears from B in some of the next iterations thenit never can reappear in B� On the other hand� after each iteration� ifv remains in B then there exists a vertex w newly inserted into Q thateither shares a neighbour in Q with v or it is itself a neighbour of v inG� In the �rst case� g�v� decreases at least by � In the second case g�v�increases by cap�w�� i�e�� at most by k� However� the second case canoccur at most k times since cap�v� cannot be negative if v is to stay inB� Since cap�w� for each neighbour w of v in Q has to be positive inorder to keep v in B� we conclude that after the k� � k iterations v hasto disappear from B�Suppose that v is not a member of the original set B� It means thatv has no neighbour in the original set Q� Therefore� it could be addedto the original set Q preserving its independence property which wouldcontradict the maximality of the set� We obtain a contradiction� Thus�we can conclude that all vertices that appear in the sets B are membersof the original set B� Combining this conclusion with the shown factthat no member of B can survive more than the k� � k iterations weobtain the thesis of the lemma� �

Combining the two above lemmas� we obtain the correctness of Al�gorithm ����

Theorem ��� Algorithm ��� is correct�

Page 31: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximal k�dependent set problem �

G

G

G

B

B

R

R

Q

Q

Q � �

R � �

B � �

Figure ���� The idea of how to construct a maximal k�dependent set� B isthe set of vertices which we still do not know if are in the k�dependent set Qis a k�dependent set and R is the set of vertices we know to be outside ourk�dependent set Q�

Lemma ��� Suppose that a maximal independent set in a graph onn vertices can be found in time T �n� using an EREW PRAM with P �n�processors� Algorithm ��� can be implemented in time O�log n� T �n��using a PRAM with O�n� � P �n�� processors�

Proof A maximal independent set in G as well as a maximal indepen�dent set in the auxiliary graph H can be found in time T �n� using P �n�processors� By Lemma ������ we can replace the while statement by afor� loop with the number of iterations O�k��� in this way avoiding thetest for emptiness of B�

All other instructions except for the construction of the auxiliarygraph H can be easily implemented in time O�log n� using an EREWPRAM with O�n�� processors� For instance� �ltering B out of R can beimplemented using the sorting algorithm due to Cole ��� running in alogarithmic time on an EREW PRAMwith a linear number of processors

Page 32: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� k�dependent Sets

Q

B

R

Figure ���� Constructing the graph H �solid lines� whose set of vertices is Band the edges are the edges in G �bold lines� and the edges �u� v� if u and v

share a common neighbour in Q�

�O�n�� processors in our application��We can implement the set of operations in constant time by repre�

senting all the involved sets B� Q� R� S with n element vectors� eachof them with on the i�th position if and only if the i�th vertex in Gis currently in the set� The construction of the auxiliary graph H� inparticular �nding all pairs �v� w� such that v and w have a commonneighbour in Q� seems to be more costly� It immediately reduces to thefollowing problem�

Given a bipartite graph F � �V�� V�� E�� where the degree of eachvertex in V� is bounded by k� construct the graph F � � �V�� E

�� suchthat �v� w� is in E� if and only if v and w have a common neighbour inV�� Suppose that V� � f� �� � � � � sg� Construct a matrix of size s � ssuch that W �i� j�� � i � j � s� is set to the list of neighbours of i in F�i�e�� in V��� Note that such a list can have at most k elements� For thisreason� the matrix can be constructed in time O�log s� using an EREWPRAM with O�s�� processors�

Now the construction of the graph F � becomes easy� For each pairi� j where � i � j � s� we check whether the lists W �i� j� and W �j� i�have at least one element in common� If so we augment E� by �i� j��i�e�� we set to one the corresponding entry of the adjacency matrix ofF �� Note that comparing two such lists takes time O�k��

Page 33: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximal k�dependent set problem ��

We conclude that F � can be constructed in time O�log s� using anEREW PRAMwithO�s�� processors� Consequently� the auxiliary graphH can be constructed in time O�log n� using an EREW PRAM withO�n�� processors� As by Lemma ������ all instructions within the loopare executed only O�k�� times� we conclude that Algorithm ��� can beimplemented in time O�log n�T �n�� using O�n��P �n�� processors� �

Theorem ��� Let k be a non�negative integer� A maximal k�depen�dent set in a graph on n vertices can be computed in time O�log� n�using an EREW PRAM with O�n�� processors�

Proof As a maximal independent set in a graph on n vertices canbe computed in time O�log� n� using an EREW PRAM with O�n��processors we obtain the thesis by Lemma ������ �

Corollary ��� The problem of constructing a maximal k�dependentset is in NC�

����� A maximal k�dependent set algorithm for bounded

degree graphs

A maximal independent set in a graph of bounded valence on n verticescan be computed in time O�log� n� using an EREW PRAM with O�n�processors ����� We can use this fact to speed�up Algorithm ��� in thecase of graphs of bounded valence ����� Here we present a O�log� n�time algorithm for the maximal k�dependent set problem which usescolouring�Given a graph G � �V�E� with maximum degree � �� it is obvious

that for any number k � the maximum �and of course the maximal�k�dependent set in G is the set of vertices V itself� So in this section weassume that k � ��The fact that the Algorithm ��� computes a maximal k�dependent

set is obvious� The part of the algorithm which requires a detailedexplanation is the selection of sets Wi� We remark that no vertex u � Viwith more than k neighbours in Q or with a neighbour v � Q withexactly k neighbours in Q can belong to Wi�Let Ui � Vi be the set of vertices in Vi with at most k neighbours in

Q� such that no one of their neighbours in Q have their degree in ��Q�

Page 34: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� k�dependent Sets

Algorithm Maximal�k�dependent�set�G�input � A graph G � �V�E� with bounded degree ��output � A maximal k�dependent set Q�method �

Colour vertices of G using � � � colours�Let V�� V�� � � � � V��� be the partitionof V into colour classes�Q� V��for i� to �� � do

Wi � a subset of Vi such thatQ �Wi is a maximal k�dependentset in ��V� � � � � � Vi��

Q� Q �Wi�endfor

output Q�end Maximal�k�dependent�set

Algorithm ���

equal to k�Now we must select Wi � Ui in such a way that Q �Wi is a maximalk�dependent set in ��V� � � � ��Vi�� Q is already a maximal k�dependentset in ��V� � � � �� Vi���� so we must assure that Wi does not violate thek�dependency� For this purpose we create a graph Gi � �Ui� Ei� withthe edge set de�ned as�

�u� v� � Ei � u and v have a common neighbour in Q�

Adjacent vertices in Gi cannot be inserted simultaneously inWi� becauseit could violate the k�dependency of Q�Wi� Since Gi is a bounded degreegraph with maximum degree �i ��i � ���� we can rapidly colour Gi

with �i � colours� Call Ui��� Ui��� � � � � Ui��i�� the colour partition ofUi� Now we can insert into Wi the elements of Ui�j checking for everyelement that it does not violate the k�dependency� We can do it inparallel because each set Ui�j is independent� Hence by the above discusions we obtain�

Theorem ��� Let k be a non�negative integer� A maximal k�depen�dent set in a graph of bounded valence on n vertices can be computedin time O�log� n� using an EREW PRAM with O�n� processors�

Page 35: Efficient Parallel Algorithms for Combinatorial Problems

�� � Maximal f �dependent set problem ��

Proof We use the algorithm for colouring a bounded degree graphpresented by Goldberg and Plotkin in ����� It runs in time O�log� n�using an EREW PRAM with O�n� processors� All steps inside thefor�loop with exception of the colouring of Gi take constant time andthe colouring of Gi can be done in time O�log� jUij�� We know thatjUij � n� so one iteration of the for�loop takes less than O�log� n� time�The theorem follows from the fact that � is a constant� �

��� Maximal f�dependent set problem

A generalization of the maximal k�dependent set problem is the f �dependent set problem� Given a positive integer function f de�nedon the set of vertices� a f �dependent set is a subset F of V such thateach vertex v � F is adjacent to at most f�v� vertices in F � Algorithm��� can be easily generalized to construct a maximal f �dependent setin G provided an integer function f de�ned on the set of vertices of Gis given� It is enough to rede�ne B as the set of all vertices in V orR respectively such that f�v� minus the number of neighbours of v inQ is non�negative� By reasoning analogously as in the proof of Lemma����� we conclude that the while block is iterated O�max

v�V�f�v���� times�

Hence� we obtain the following generalization of Theorem ����� leavingthe proof details to the reader�

Theorem ��� Let G be a graph on n vertices and m edges� and letf be a positive integer function de�ned on the set of vertices of G� Amaximal f �dependent set in G can be computed in time O��log� n� ��maxv�V

f�v���� using an EREW PRAM with O�n�� processors�

Page 36: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� k�dependent Sets

Page 37: Efficient Parallel Algorithms for Combinatorial Problems

Chapter �

f�matchings

To match or not to match

What was the question�

Anon

Consider a graph G � �V�E�� and an integer function f de�ned onV� An f �matching in G is a subset of E such that for each vertex v atmost f�v� edges incident to v are in the subset� Note that a matching issimply a �matching� The maximal� maximum and perfect f �matchingproblems are very natural generalizations of the maximal� maximum andperfect matching problems respectively �see ��� ���� An f �matching inG is maximal if it cannot be extended to any larger f �matching in G�An f �matching in G is maximum if it has the largest cardinality amongall f �matchings in G� Finally� an f �matching in G is perfect if for eachvertex v there are exactly f�v� edges in the f �matching incident to v�

��� Maximum f�matching problem

The problem of constructing a maximum f �matching can be many�onereduced to the problem of constructing a maximum matching by gener�alizing Tutte�s reduction of the problem of �nding an f �factor �f �regularspanning subgraph� to the problem of �nding an �factor �perfect match�ing� in a graph ����� In e�ect� we obtain the following theorem�

��

Page 38: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Theorem ��� For a graph G � �V�E� on n vertices and a functionf � V � f� ���� kg� we can construct a graph G� such that any maximummatching of G� yields a maximum f �matching of G� Both the construc�tion of G� and the construction of the maximum f �matching of G onthe basis of a maximum matching of G� can be accomplished in timeO�log n� on an EREW PRAM with O� �n�m�k

log n � processors� where k � n�n and m are respectively the number of vertices and edges of the inputgraph�

Proof Construct the graph G� � �V �� E��� generalizing Tutte�s con�struction ����� as follows� Set V � to Vf � VE where� Vf � fvi j v � V � i � f�v�g �there are f�v� copies of v in

G��

�� VE � fve j �w � V s�t� �v� w� � e e � Eg �for each edge eincident to v the auxiliary vertex ve is in G

��

Next� set E� to Ef �EE where

� Ef � f�vi� ve� j vi � V ve � VEg �each copy of v is adjacent toeach auxiliary vertex induced by v and an adjacent edge e�

�� EE � f�ev � ew� j �v� w� � e e � Eg �two auxiliary vertices areadjacent if they are induced by the same edge�

Note that G� has O�nk� vertices and O�mk� edges� Consider a max�imum matchingM in G��We may assume without loss of generality thatfor each edge d in EE both its endpoints are incident to an edge inM �!��In other words� either d � �ve� we� is in M or for some unique i� j� theedges �vi� ve�� �we� wj� are inM� Otherwise� we can always insert d inMdeleting the single edge inM incident to an endpoint of d so the resultingmatching remains maximum� SetMf to fe j e � �v� w� �ev� ew� ��Mg�Consider a vertex v in G� For each edge e in Mf incident to v there ex�ists a unique i such that �vi� ve� is in M by the assumed property �!� ofM and the de�nition of Mf � As there are f�v� copies vi of v in G

� andM is a matching of G�� the set Mf is an f �matching of G� Also� by thede�nition of Mf and �!�� we have jM j � jMf j� jEj�Contrary� given an f �matching B in G� we can easily build a match�

ing B� of G� in two stages� In the �rst stage for each vertex v in G we

Page 39: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximum f �matching problem ��

vf�v�

v�

ev ew

w�

wf�w�

Figure ��� The subgraph of G� corresponding to an edge e � �v� w� of G�

number edges in B incident to v� and for such an i�th edge e� we insert�vi� ve� into B�� In the second stage for each edge e � �v� w� � E�B weinsert �ev � ew� in B�� It is easy to see that so constructed B� is a match�ing of G� with �jBj� �jEj � jBj� edges� i�e�� jB�j � jBj� jEj� It followsfrom the maximum cardinality property of M that jM j jBj � jEj�Thus Mf is a maximum f �matching by jM j � jMf j� jEjThe construction of the graph G� on the basis of G and f� and the

construction of the f �matchingMf on the basis of a maximummatchingM can be done within the time and processor bounds speci�ed in thetheorem� among others by applying an optimal logarithmic�time EREWPRAM algorithm for list ranking to adjacency lists ����� �

A maximum matching in a graph on n vertices� and m edges can beconstructed sequentially in time O�pnm� ����� In parallel� it can be con�structed in time O�log� n� using a randomized PRAM with O�nM�n�m�processors ����� or in time O�log� n� using a randomized PRAM withO�nM�n�� processors ��� �M�n� is the number of arithmetic operationsused by the best known sequential algorithm for multiplying two n� nmatrices" currently M�n� � O�n������� The above facts combined withTheorem ��� and the estimation of the size of G� yield the followingcorollary�

Page 40: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Corollary ��� A maximum f �matching in a graph on n vertices andm edges can be constructed sequentially in time O�n�m�� and in par�allel in time O�log� n� using a randomized PRAM with O�n�M�n��m�processors� or in time O�log� n� using O�n�M�n��� processors on a ran�domized PRAM�

����� The decision version of DSP is in NC

The so called degree sequence problem �DSP for short� can be seenas the restriction of the perfect f �matching problem to the completegraph case� Independently� it can be de�ned as follows� for a sequenced������ dn of natural numbers� construct if possible a simple graph on nnodes such that the degree of the i�th node is di� We shall call d������ dna degree sequence if such a graph exists� The degree sequence problemis considered as a fundamental problem in graph theory ��� ��� It admitsa trivial greedy polynomial�time algorithm which can be re�ned to alinear one �e�g�� see Section � in ����� Also� if maximum connectivityrequirements on the graph to construct are added it still can be solvedin nearly linear time ����The degree sequence problem has a solution if the integers di satisfy

the following elementary inequalities for k � � ��n due to Erd#os andGallai ��� ���

kXi�

di � k�k � � �nX

jk��

minfk� djg

In ���� Takao Asano has recently observed that the computationallysimpler inequalities corresponding to the case where the graph to con�struct is required k�connected� k � are NC testable� The presence ofmin makes the problem of testing in our non�necessarily connected casea bit more di�cult� Nevertheless we can report the following optimalresult�

Theorem ��� One can decide whether a sequence of integers d� d� � � � dn is a degree sequence in time O�log n� using O� n

log n� EREWPRAM processors�

Proof We may assume w�l�o�g� that the integers d�� ���� dn are in therange �� n��� Compute the pre�x sums PRj� and the post�x sums POj �

Page 41: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximal f �matching for restricted graphs �

j � � ���� n� for the sequence d�� ���� dn� Form a sequence a�� ���� an�� ofintegers such ai � i for i � � ���� n � � and merge it with the sequenced�� ���� dn in such a way that if dj � ak then dj precedes ak� Assign toeach dj element weight and to each ak element weight � and computethe weighted ranks Rk for each ak element� Now the inequalities due toErd#os and Gallai can be rephrased as follows�

PRk � k�k � � � maxf�Rk � k�k� �g � POmaxfRk���k��g

Thus� assuming the pre�x sums� post�x sums and weighted ranks arecomputed� the inequalities can be easily checked in logarithmic timeusing O� n

log n� EREW PRAM processors� The pre�x sums� post�x sumsand weighted ranks can be computed within the above resource boundsby using the known work�optimal EREW PRAM algorithms for pre�xsums� merging� and weighted list ranking respectively ��� ���� �

��� Maximal f�matching for restricted graphs

The computation of a maximal f �matching is generally more di�cultthan that of a maximal matching� Obviously� a maximal f �matchingcan be computed in linear time by a greedy sequential algorithm� Un�fortunately such an algorithm is not well parallelizable �see ������

In this section we present two parallel algorithms for maximal f �matching� The �rst one applies to graphs of bounded valence and it is asimple reduction to the problem of constructing a maximal matching ingraphs of bounded valence� It can be implemented in time O�log� n� onan EREW PRAM with a linear number of processors ���� The secondalgorithm constructs a maximal f �matching in graphs with arboricitybounded by a constant� It can be implemented in time O�log� n� on anEREW PRAM with O� n

log n� processors ����

����� Maximal f�matching in constant�degree graphs

A maximal matching in a graph of bounded valence can be computedby reduction to the problem of �nding a maximal independent set inthe corresponding edge graph �which is also of bounded valence� in time

Page 42: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Algorithm Maximal�f�Matching�G� f�input � A bounded valence graph G � �V�E�

its matching function f �output � A maximal f �matching M of G�method �

M � �� G� � �V�� E��� G � �V�E��f� � f � i� ��while Ei �� � do

U � fv � Vi j fi�v� � �g�F � f�u� v� j u� v � Ug �Ei�Max� Maximal���Matching��U� F ���M �M �Max�i� i� ���Vi� Ei�� �U� F nMax��for each u � U in parallel do

if u is incident to an edge in Max then

fi�u�� fi���u�� �else

fi�u�� fi���u��endfor

endwhile

output M �end Maximal�f�Matching

Algorithm ���

O�log� n� on an EREW PRAM with O�n� processors ����� In the Al�gorithm �� we use this fact to achieve the same asymptotic resource�bounds for maximal f �matching in the bounded valence case�

Theorem ��� Let G be a graph of bounded valence on n vertices� Amaximal f �matching in G can be found in time O�log� n� on an EREWPRAM with O�n� processors�

Proof All steps of the while loop except the computation of the max�imal matching Max take constant time on an EREW PRAM with nprocessors� The computation of Max can be done in time O�log� n� us�ing an EREW PRAM with O�n� processors ����� Observe that if �u� v�is an edge in the graph Gi � �Vi� Ei� before the i�th iteration of thewhile loop then either at least one of vertices u� v does not appear in

Page 43: Efficient Parallel Algorithms for Combinatorial Problems

���� Maximal f �matching for restricted graphs ��

the graph Gi�� � �Vi��� Ei��� or the sum of the degrees of u and v is atleast smaller than the sum of their degrees in Gi� We conclude thatthe number of the iterations of the while statement is at most � timesthe valence of the input graph G� �

����� f�matching in sparse graphs

The following fact due to Osiakwan and Akl ���� yields a O log�n��timeoptimal EREW PRAM algorithm for maximal f �matching in forests�

Fact ��� Let T � �V�E� be a tree with non�negative integer vertexcapacities given by the function f de�ned on V � A maximum cardinalityf �matching of T can be found in time O�log n� using O� n

log n� EREWPRAM processors�

We can use the method for �nding a maximal f �matching in a forestimplied by Fact ���� to �nd maximal f �matchings in graphs of constantarboricity� Recall that a graph G is said to be of arboricity c if and onlyif it can be decomposed into c disjoint spanning forests�

Theorem ��� Let G � �V�E� be a constant arboricity graph withnon�negative integer vertex capacities given by the function f de�nedon V � A maximal f �matching of G can be found in time O�log� n� usingan EREW PRAM with O� n

log n� processors�

Proof The reduction to the corresponding problem for a forest isas follows� First� in parallel� for each vertex v in V � we choose theedge e�v� which connects v with its neighbour of highest number� Next�we extract from G the subgraph F spanned by the edges e�v�� Byusing the standard logarithmic�time methods for �nding the maximumand grouping elements into logarithmic�size blocks assigned to singleprocessors �see ����� these two steps can be done in time O�log n� usingan EREW PRAM with O� n

log n� processors� It is not di�cult to seethat F is a spanning forest for G� Now� we use the method impliedby Fact ���� to �nd a maximal f �matching M in F � M is our initialf �matching in G which we shall augment in subsequent iterations toobtain a maximal f �matching of G� Note that none of the edges in Foutside M could be used to augment M � Therefore� we can remove all

Page 44: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

the edges of F from G� appropriately decrease the capacities of verticesin G by the number of incident edges in M � and iterate our method onthe resulting subgraph of G� etc� During the consecutive iterations weaugment M with the produced maximal f �matchings of the consecutiveforests� By induction on the number of iterations we deduce that thecurrent f �matching M cannot be augmented by any edge deleted fromG in this or the previous iterations� As the number of edges in a graph ofarboricity bounded by c is bounded from above by c times the number ofits non�isolated vertices and� on the other hand� the number of edges in aspanning forest of a graph is at least half the number of the non�isolatedvertices of the graph� we conclude the following� after a logarithmicnumber of iterations G is reduced to a set of isolated vertices� Thus� the�nal f �matching M is maximal� By Fact ����� each of the iterationstakes time O�log n� on a EREW PRAM with O� n

log n� processors whichimplies the thesis� �

Corollary ��� A maximal f �matching in a graph of bounded genus�in particular planar graphs� can be found in time O�log� n� using anEREW PRAM with O� n

log n� processors�

��� f�matching in general graphs

In this section we present the �rst deterministic NC parallel algorithmfor constructing a maximal f �matching in the general case�The algorithm due to Israeli and Shiloach constructs a maximal

matching in a graph on n vertices and m edges in time O�log� n� onan CRCW PRAM with O�n � m� processors ����� Our algorithm isan advanced generalization of the Israeli and Shiloach�s algorithm toinclude maximal f �matching achieving the same asymptotic resource�bounds� The generalized algorithm consists of several procedures� Inorder to present them we need the following notation�For each vertex v � V we de�ne its weight w�G� v� f� with respect to fas follows�

w�G� v� f� � mins�N

fs j �sf�v� degG�v�g�Let W �G� f� � max

v�Vw�G� v� f� � The number W �G� f� will be called the

weight of the graph G with respect to f �see Fig �����

Page 45: Efficient Parallel Algorithms for Combinatorial Problems

���� f �matching in general graphs ��

� ���

� ��� � ���

� ���

� ���

� ���

� ��� � ���

� ���

� ���

� ���

Figure ���� An example of a graph G with capacities f�v� and vertex weightsw�G� v� f�� The weights are in italic The weight of the graph is ��

Observe that if W �G� f� � � then all edges of the graph belong to amaximal f �matching�A vertex v is said to be an active one in G with respect to a matchingfunction f if and only if �W �G�f���f�v� � degG�v� � �W �G�f�f�v�� Anactive vertex v is called safe if degG�v� � �

W �G�f���f�v�� The procedurereduce� reduces G �removing some of its edges� to a graph G� such thatW �G�� f� �W �G� f�� �

Lemma ��� If W �G� f� then W �G�� f� �W �G� f�� �

Proof First of all let us observe that if w�G� v� f� �W �G� f�� � forsome v � V � then also w�G�� v� f� �W �G� f�� �Consider now a vertex v for which w�G� v� f� �W �G� f�� Then�W �G�f���f�v� � degG�v� � �W �G�f�f�v� and v is a non�safe vertex�Hence degG��v� � d�� degG�v�e � �W �G�f���f�v�� It implies W �G�� f� �W �G� f�� � �

Page 46: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Procedure REDUCE�G� f�G��input � a simple graph G � �V�E��

a matching function f � V �N such thatW �G� f� � ���� We assume that degG�v�� w�G� v� f�� �v � V � ���� and W �G� f� are computed� ��

output � a subgraph G� � �V�E�� of the graph G such thatW �G�� f� �W �G� f�� ��

method �

Construct an auxiliary graph H induced by all those edges ofG for which at least one end�point is an active vertex�called later real edges�

Compute connected components of HLabel edges of each connected component � if all its active

vertices are safe� Call such components safeLet H � be a subgraph of H containing only non�safe

componentsfor every vertex of odd degree in H �

add an edge to an introduced vertex uFind an Eulerian circuit in each connected component C of H �Label the edges of each component C of H � with and � in

the following way���� if C contains the introduced vertex u then

starting at u trace the Eulerian cycle andlabel the edges and � alternatelyif the number of real edges labeled is largerthan the number of real edges labeled � thenexchange �s for ��s and ��s for �s

��� if C does not contain u then

nd in C a vertex x which is a neighbourof a non�safe vertex y

Starting from the edge �x� y� trace the cycleand label the edges � and alternately��x� y� is labeled ��

if the length of the cycle is odd then

exchange the label of �x� y� for G� � the graph obtained by the removal of

all real edges labeled with from G output G�

end REDUCE

Procedure Reduce

Page 47: Efficient Parallel Algorithms for Combinatorial Problems

���� f �matching in general graphs ��

Lemma ��� Let W �G� f� �� If v is an active vertex in G then vremains active in G��

Proof It su�ces to show that if v is an active vertex in G then�W �G�f���f�v� � degG��v� � �W �G�f���f�v�� Let us consider three cases�

� v belongs to a connected component of H in which all active ver�tices are safe� Then

degG��v� � degG�v� � �W �G�f���f�v��

�� v is in the same connected component of H � as the introducedvertex u� The procedure reduce reduces the input graph in sucha way that

b�degG�v�c � degG��v� � d

�degG�v�e�

Hence�W �G�f���f�v� � degG��v� � �W �G�f���f�v��

�� v is in a connected component of H � not containing u� If v �� y�see description of the procedure� then

degG��v� �degG�v�

��

If v � y then v is a non�safe vertex� Hence

degG�v� �W �G�f���f�v� � ��

If the Eulerian circuit in the connected component contained v has oddlength then

degG��v� �degG�v�

�� �W �G�f���f�v�

otherwise

degG��v� �degG�v�

�Hence always

�W �G�f���f�v� � degG��v� � �W �G�f���f�v�� �

We de�ne a procedure f�matching which computes some �large�f �matching M for a given input graph G�

Page 48: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Procedure f�MATCHING�G� f�M�input � a graph G � �V�E��

a matching function f � V N

output � a large f �matching for G�method �

i� ��G� � G�repeat

for all vertices v � V in parallel do

compute degGi�v��

compute w�Gi� v� f��endfor

compute W �Gi� f��j � i�if W �Gi� f� � then

REDUCE�Gi� f� Gi����i� i� ��

endif

until j � i�M � the set of edges of the graph Gi�

end f�MATCHING

Procedure f�matching

Lemma ��� The set of edges M computed by the proceduref�matching is an f �matching in the input graph G�

Proof Let imax be the maximal value of the variable i� The weightof the graph Gimax with respect to the function f is �� Then for eachvertex v � V�degGimax

�v� � f�v�� This implies that M is an f �matchingin G� �

Let M be an f �matching in a graph G� The procedure modify�deletes the edges of M from the graph producing a graph K and nextcomputes a matching function h such that any maximal h�matching ofK extended with the edges of the set M is a maximal f �matching in G�

Lemma ��� Let H be a maximal h�matching in K then H �M is amaximal f �matching in G�

Proof It is su�cient to observe that�

Page 49: Efficient Parallel Algorithms for Combinatorial Problems

���� f �matching in general graphs ��

Procedure MODIFY �G� f�M�K� h�input � a graph G � �V�E�

its matching function f an f �matching M in G�

output � a subgraph K � �V�E�� of G a matching function h for K such that anymaximal h�matching H extended with the edgesof M is a maximal f �matching of the graph G�

method �

M � � f�u� v� � E j �u� v� �M or u is incident to f�u�edges in M or v is incident to f�v� edges in Mg�

E� � E nM ��K � �V�E���for v � V in parallel do

if degK�v� � � then

h�v�� ��else

h�v�� f�v�� jf�v� u� j �v� u� �Mgj�endif

endfor

output K�h�end MODIFY

Procedure Modify

� E� consists of all possible edges which can extend the f �matchingM� and

� for each non�isolated vertex v in H its new matching value h�v� isequal to the old matching value f�v� decreased by the number ofedges belonging to the f �matching M �

Now we are ready to write the entire algorithm for �nding maximalf �matchings in graphs�

Consider a graph G and its matching function f � Let A be a subsetof the set of vertices of the graph� By cost�G�A� f� we will denote a costof the set A with respect to the function f de�ned as follows�

cost�G�A� f� �X

u is non�isolatedin A

f�u��

Page 50: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Algorithm Maximal�f�Matching�G� f�input � a graph G � �V�E�

a matching function f � V N �output � a maximal f �matching MaxM in the graph G�method �

i� ��G� � �V�� E��� G � �V�E��f� � f �MaxM� ��while jEij � � do

f �MATCHING�Gi� fi�Mi��MaxM� MaxM �Mi�MODIFY�Gi� fi�Mi� Gi��� fi����i� i� ��

endwhile

end Maximal�f�Matching

Algorithm ���

If A is empty or contains only isolated vertices� we assume that�cost�G�A� f� � ��

Lemma ��� Let G be a graph� f its matching function and C a vertexcover of the graph G� Next� let M be the f �matching which is the resultof the call f�matching�f�G�M�� Finally� let K� h be the graph andits matching function� respectively� obtained as the result of the callmodify�G� f�M�K� h�� Then there exists a vertex cover A in the graphK such that cost�K�A� h� � �

cost�G�C� f��

Proof Let us consider the application of the procedure f�matchingto the graph G� Let imax be the maximum value of the variable i� Ifimax � � then all edges of the graph belong to M � In this case it su�cesto take as the set A simply the empty set� Let us assume now thatimax � �� Let B denote a set of all active vertices in the graph Gimax���Each edge e � E has either both endpoints in V n B or at least oneof its endpoints belongs to B� If both endpoints belong to V n B thennaturally e is an edge in the graph Gimax and hence it is in M � Thisand the fact that each active vertex in Gj� for each j � imax��� remainsactive in Gimax�� �Lemma ����� imply that B is a vertex cover of the

Page 51: Efficient Parallel Algorithms for Combinatorial Problems

���� f �matching in general graphs �

graph K� Let us observe that

cost�G�B� f� �Xu�B

f�u� �Xu�B

degGimax���u��

Let � denote the number of edges in Gimax�� with exactly one end�pointin B and k the number of edges with both end�points in B� Thencost�G�B� f� � ���k� The procedure reduce reduces the graphGimax��

in such a way that the f �matching M contains at least ���� � k� edges

incident with vertices in B� Each connected component of H in whichall active vertices are safe gives all its edges to M � The connectedcomponent in H � containing the introduced vertex u gives at least halfof its real edges to M � If a connected component C of H � does notcontain u and has e edges then it gives b e�c e

� edges to M �e � �because C contains a safe active vertex�� Since �

���� k� �����k�� we

have the following�

cost�K�B� h� � cost�G�B� f�� ����� k�

� cost�G�B� f�� ���� �k�

� cost�G�B� f�� �cost�G�B� f�

� � cost�G�B� f��

Let us consider now two cases�

Case � � cost�G�B� f� � cost�G�C� f�� If we take as the set Athe set B thencost�K�A� h� � �

cost�G�C� f��Case � � cost�G�B� f� � cost�G�C� f�� Let us observe that M

contains at least �cost�G�B� f� edges�

If we take C as the set A the following holds�

cost �K�A� h� � cost �G�C� f�� �cost�G�B� f�

� cost �G�C� f�� � cost �G�C� f�

� � cost �G�C� f�� �

Theorem ��� Let G � �V�E� be an n�vertex graph with m edgesand let f be its matching function� A maximal f �matching in G canbe computed in time O�log� n� using a CRCW PRAM with O�n �m�processors or in time O�log� n� using an EREW PRAM with O�n�m�processors�

Page 52: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Proof We can compute a maximal f �matching using the algorithmmaximal�f�matching� It follows directly from Lemmata ����� and����� that if the algorithm stops then MaxM is a maximal f �matchingin G� We show how to implement e�ciently the algorithm maximal�

f�matching� We assume that the input graph G is represented byadjacency lists� The complexity of the procedure reduce depends onthe complexity of computing connected components and Eulerian cycles�This can be done in time O�log n� on an O�n � m��processor CRCWPRAM or in time O�log� n� on an EREW PRAM �cf� ��� ����� Eachiteration of the repeat loop in the procedure f �matching consists ofsome computations on the adjacency lists and of the call of the procedurereduce� Hence it takes time O�log n� or O�log� n� depending on themodel of computations� It follows from Lemma ���� that the numberof iterations of the repeat loop can not be larger than dlog�n � �e�Hence the procedure f �matching runs in time O�log� n� or O�log� n�using only O�n �m� processors� The procedure modify consists onlyof simple computations on the adjacency lists� It takes O�log n� time�Let us observe that the cost of each vertex cover in the input graphG is bounded by n� from above� Taking into account Lemma ����� weinfer that the number of iterations of the while loop of the algorithmis O�log n�� Hence the algorithm stops and runs in time O�log� n� orO�log� n�� depending on the model of computation� and uses only theprocessors associated with the vertices and the edges of the graph� �

The above theorem yields immediately the following corollary�

Corollary ��� The problem of computing a maximal f �matching isin NC�

��� A randomized parallel algorithm for maxi�

mal f�matchings

In this section we present a RNC�algorithm for maximal f �matchings inthe general case�

For many problems the main advantage of randomization is gain�ing simplicity� This happens in the computation of maximal matchings

Page 53: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings ��

in graphs� We show that a known and quite simple randomized algo�rithm for maximal matchings has a natural extension to the so calledf �matchings�The whole structure of our randomized algorithm is very simple� it

�nds a partial f �matching F � deletes the edges of F � updates capacitiesand then removes edges incident to vertices with actual capacity equalto zero� This continues until the graph is empty�The main operation is to �nd a large partial f �matching F � This

is done by a kind of handshaking strategy where a number of edges aremarked by their incident vertices and some of the marked edges areselected by the neighbours of the vertices which marked them� The setof selected vertices called F is almost always an f �matching�

Note that the set F of edges added in one iteration of the repeat�block of Algorithm ��� is a partial f �matching� If f�v� �� then� justbefore the cleanup stage� the number of edges of F incident to v is atmost df�v�� e � bf�v�� c � f�v�� Next� if f�v� � then at most � edges ofF are incident to v after $bound�indegrees�� In the latter case� if exactly� edges are incident to v at least one of them will be removed in therepair stage�The analysis of the algorithm is based on a simple combinatorial

property of undirected graphs� Let G be an undirected graph� Associatewith each vertex v of G a number ��v�� The vertex v is good if and onlyif at least �

� of its neighbours w satisfy ��v� � ��w�� The edge is calledgood if and only if at least one of its endpoints is good� Vertices whichare not good are called bad vertices and edges which are not good arecalled bad edges�

Lemma ��� At least half of the edges of G are good�

Proof Let us direct all edges in the graph� If �v� w� is an undirectededge such that ��v� � ��w� we put the direction from v to w� otherwisewe �x any �unique� direction for �v� w�� By the de�nition� all bad edgesend in bad vertices and each bad vertex has indegree not greater than�� times its outdegree� so we have�

m �Xv�V

outdeg�v�

X

v is badv�V

outdeg�v�

Page 54: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Algorithm MaxMatch�G� f�input � A graph G � �V�E� and its matching function f �output � A maximal f �matching M of G�method �

M � �repeat

choose�edges�

for each vertex v in parallel do

Assign processors p�v�i i � �� �� � � � � d ��f�v�e

to vfor i� � � � � d �

�f�v�e in parallel do

p�v�i marks a random edge incident to vendfor

endfor

bound�indegrees�

for each vertex v in parallel do

S�v�� the set of edges incident on v andmarked by its neighbours

if f�v� � � then

v selects minfjS�v�j� �g edges in S�v�else if f�v� � � then

v selects minfjS�v�j� b ��f�v�cg edges in S�v�

endif

F � the set of selected edgesendfor

repair�

for each vertex v in parallel do

if f�v� � � and �v has two incident edgesin F � then

Randomly delete one of them from F endfor

f F is now an f �matching gM �M � F E � E n F

cleanup�

for each vertex v in parallel do

if deg��F ��v� � f�v� then

remove all edges incident to v from Ef�v�� minfdeg��E��v�� f�v�� deg��F ��v�g

endfor

until G has no edgesoutput M

end MaxMatch

Algorithm ���

Page 55: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings ��

capacities after the

�rst iteration of the

algorithm MaxMatch

is removed the

capacities are

updated and edges

incident to zero

capacity vertices are

removed� The removed

edges are dashed�

consisting of edges

in bold�

c� The graph G and its

The set F� of edges

The next value of F

is the set F�

The �nal f�matching

is the union of F�

and F��

edges�

b� The edges selected

in the step

�bound�indegrees�

the dashed edge is

removed in the step

set of nondashed

�cleanup�� F� is the

� �

��

��

��

��

��

F�

F�

a� The edges marked in

step �choose�edges�

the edge is directed

out of the vertex which

has marked it� Good

vertices are drawn here

in white�

Figure ���� An example of the �rst iteration of the algorithm MaxMatch�

Page 56: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

� �X

v is badv�V

indeg�v�

� � number of bad edges��

The crucial point in our algorithm is to reduce capacities for a bigproportion of the so called good edges by a constant fraction in eachiteration� This guarantees the logarithmic number of iterations since atleast half of the edges of the graph are always good�

Here we take ��v� � f�v�deg�v� � The lemma below says that a good

vertex is likely to have its capacity reduced by a constant factor�

Lemma ��� Consider a single execution of the repeat�block� Theprobability that a good vertex v of positive degree in G and positivecapacity has its capacity reduced by at least f�v�

�� is greater than somepositive constant�

Proof Let X� Y and Z denote the number of edges of F incident tov after the choose�edges stage� the bound�indegrees stage and the repairstage� respectively� We need to show Pr�Z f�v�

�� � � c � � for some

constant c� The �rst step will be to show that Pr�X f�v��� � � c� � �

for some constant c��

Let v be a good vertex and let d � d�v�� Fix dd�e neighboursv�� � � � � vk of v such that

f�v�d

� f�vi�deg�vi�

for i � � � � � � k� Let Mi denote

the event that vi marks the edge �vi� v� in the choose�edges stage�

We have Pr�Mi� � � �� �deg�vi�

�df�vi�

�e� For � � x� y � we have

�� x�y � e�xy � � xy� � Thus we get Pr�Mi� �

df�vi�

�e

�deg�vi� f�v�

�d �

We conclude that Pr�X f�v��� � Pr�Q f�v�

�� � where Q has bino�

mial distribution B�dd�e� f�v��d ��

In ��� the following variant of Cherno�s bound has been derived� LetX��X�� � � � �Xk be independent �� variables� and let M be the expectedvalue of S � X� �X� � � � ��Xk� Then

Pr�S � �� ��M� ��exp���

� � �����

�M� � � � �

Page 57: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings ��

In our case we have M f�v��� � By substituting � �

��� and observing

that �exp���

� � �����

�� ����

we see that with Pr�X f�v��� � � c� � � for a constant c�� Now note that

Pr�Y f�v��� � � Pr�X f�v�

�� � and hence Pr�Y f�v��� � � c� � � for a

constant c��Next we observe that Pr�Z f�v�

�� � Pr�Z f�v��� � Y f�v�

�� � c�Pr�Z f�v�

�� jY f�v��� �� Thus it su�ces to show that

Pr�Z f�v�

��jY f�v�

�� � c� � � �����

for some constant c�� To see this� note that each edge �vi� v� sur�vives the repair stage independently with probability at least �

� � Thus

Pr�Z f�v��� jY f�v�

�� � Pr�Q f�v��� � where Q has binomial distri�

bution B�df�v��� e� �� �� Now the relation ����� is established in the samemanner as above using the Cherno� bound� This completes the claimof the lemma� �

Lemma ��� The expected number of iterations of the block underthe repeat instruction in Algorithm ��� is O�log� n��Proof Let e denote the number of edges of the current graph G inAlgorithm ���� To prove the lemma it is enough to show that there existsa constant d such that after ddlog ne iterations of the block in Algorithm���� the expected number of edges in G is no greater than �

�e� The proofof this fact� where d is speci�ed later� is as follows�Suppose that after ddlog ne iterations the expected number of edges

in G is at least ��e� Consider any of the above iterations� An edge in

the current G in the iteration is said to be very good if it is good andthe capacity of at least one of its good endpoints is decreased at least by��� �rd� By Lemma ���� at least

e� edges are good in this iteration of the

repeat�block� By Lemma ����� a positive fraction of these� say be edges�are very good� Therefore during the ddlog ne iterations� the expectednumber of occurrences of very good edges is at least beddlog ne�

On the other hand� there exists a constant c such that a vertex v canoccur as a good vertex� which has a positive capacity and looses at least

Page 58: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

3

2

4

3 1

14

4

11

1

Figure ���� The edges of a �nal f �matching are in bold� Accidentally theinitially bad edges are here in the matching but it is not a general rule�

��� �rd of its capacity� in at most cdlog ne iterations� It follows that anedge can occur in at most �cdlog ne � iterations as a very good edge�being deleted from G in the last iteration� Set d to be � � c

b� Then� the

expected total number of occurrences of very good edges in the ddlog neiterations is greater than e��cdlog ne � �� a contradiction� �

The notation time EO�g�� means that the expected time complex�ity is O�g��Theorem ��� We can compute a maximal f �matching in timeEO�log� n� on an EREW PRAM with O�n�m� processors�

Proof By Lemma ����� it is su�cient to note that a simple iterationof the block under the repeat instruction takes time EO�log n� on anEREW PRAM with O�n�m� processors�

To implement the choose�edges stage and the next stages� we assigndeg�v� processors to each vertex v� Next� we let each of the �rst d��f�v�eprocessors to choose a random number in the range ��deg�v��� Such aprocessor generates a logarithmic number of random bits in each step

Page 59: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings ��

and checks whether the �rst blog deg�v�c� of them represent a numberin the range ��deg�v��� If not� the processor repeats the operation� For asu�ciently large constant c� after c log n iterations all involved processorshave generated a random number in the proper range almost certainly�i�e�� with probability not less than � n�k where k � � Next� for eachvertex v in parallel� the random numbers generated by the processorsassigned to v are sorted in logarithmic time using the deg�v� processors�in the EREW PRAM model� ���� Further� a single processor is assignedto each element of the sorted list for v� Such a processor checks whetherthe key of its element is strictly greater than that of the preceding one�If so� it uses the pointer to the occurrence of the corresponding edge onthe incidence list of one of its endpoint to mark the occurrence�

To perform the processor assignments in this and later stages� werespectively use parallel list ranking or pre�x sums in the EREW PRAMmodel����� For example� to assign the deg�v� processors to each vertexv� we �rstly compute the degrees deg�v� by parallel list ranking on theincidence lists and then the intervals of the indices of the processors tobe assigned to v by parallel pre�x sums� Next� each v distributes itsidentity to the processors with indices in its interval in logarithmic timeusing these processors in the EREW PRAM model� We conclude thatthe choose�edges stage takes time EO�log n� and O�n�m� processors�

To implement the bound�indegrees stage� we use the cross links be�tween the two occurrences of the same edge on the incidence lists of itsendpoints� �If they are not given in the input� we can obtain them bylinking the incidence lists and then sorting the elements on the commonlist so the neighboring elements on the sorted list can exchange theiroriginal addresses� It takes logarithmic time and O�n �m� processorsin the EREW PRAM model ����� For each v in parallel� we assign thedeg�v� processors of v to the consecutive edges on the incidence listsof v� Each of the processors specially marks the other occurrence of itsedge by using the aforementioned links whenever its edge is marked�This yields the representation of the sets S�v�� Now� by using the rankson the incidence lists computed in the previous stage� each processor as�signed to a specially marked edge on an incidence list can decide whetherthe edge should be selected� If so� it preserves the marking of the edge�Otherwise it removes all its markings� Finally� all processors assignedto marked edge occurrences� mark the complementary occurrences by

Page 60: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

using the cross links� In this way� we obtain a representation of the setF in logarithmic time� using O�n�m� processors in the EREW PRAMmodel�

In the repair stage� for each vertex v in parallel� we can count thenumber of edges in F incident to v by optimal parallel weighted listranking of the incidence list of v� It takes logarithmic time in the EREWPRAM model ����� In case there are exactly two edges in F on theincidence list of v and f�v� � � a random bit is distributed among theelements of the incidence list of v� If the bit is � the �rst element of Fon the list is unmarked� otherwise the second one� To remove the edgesin F on the original incidence lists� i�e�� to update E� we can apply thestraightforward procedure for sublist computation given on p� � in �����It can be easily implemented in logarithmic time using a linear numberof processors in the EREW PRAM model �by keeping the informationof whether the current next element is marked at each list element��

In the cleanup stage� we may assume that deg��F ��v� are known fromthe previous stage� The removal of all edges incident to a vertex v isstraightforward� The occurrences of these edges on the incidence listsof the other endpoints of the edges are obtained by marking them usingthe cross�links and then list shrinkage which removes marked elements��

It seems di�cult to derive a substantially sub�log� n�time implemen�tation of the Algorithm ��� in the EREW PRAM model� In the imple�mentation of a single iteration of the block� both the random choice of��f�v� edges among deg�v� edges incident to v and the updating of f�v�can take logarithmic in deg�v� and f�v� time respectively� independentof the number of processors assigned to v� Using the power of CRCWwe could randomly choose about� f�v� edges by partitioning the set ofedges into f disjoint groups of roughly the same size and then randomlychoose one element from each group using the constant time randomselection from ����� However it is not clear whether the updates of ver�tex capacities could also be done faster using the power of concurrentwrites� To achieve a log n speed�up in the CRCW PRAM model we needto modify Algorithm ��� preserving its main structure� The modi�cationis three�fold�

� In the choose�edges phase� the marking of edges is done by active

Page 61: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings �

entries of capacity tables� More precisely� with each vertex v weinitially associate a linear table T �v� with f�v� active entries� Now�during the choose�edges phase each active entry marks an edgeincident to v with probability �

� provided that the edge is not F �marked �see ��� Note that some edges can be marked by manyentries of T �v��

�� In the bound�degrees phase� the selecting of edges is done by themarked edges themselves� More precisely� each edge� say �v� w�randomly picks up one of its endpoints� say v� and an entry inT �v�� If the entry is active then exactly one of the marked edgesthat picked it becomes preliminary selected with probability �

� andthe entry becomes preliminary passive if the edge is really prelim�inary selected� Next� each of the preliminary selected edges �v� w�similarly repeats the operation for the other endpoint w� That is�it randomly picks up an entry in T �w�� If the entry in T �w� is ac�tive then exactly one of the preliminary selected edges that pickedit becomes selected and the entry as well as the entry in the tablecorresponding to the other endpoint of the edge become passive�All the entries in the tables T �� that are not passive become active�

�� The edges in F � i�e�� the selected edges that remained after theclean�up phase� become F �marked� Their deletion from G andinsertion into F as well as the deletion of all edges incident to asaturated vertex from G are done only in iterations whose numbersare equal to mod dlog ne� Also� the contraction of the tables T �v�consisting in removing all passive entries is done only in the abovephases�

Lemma ��� The modi�ed algorithm is partially correct� i�e�� if itstops then it produces a maximal f �matching of the input graph�

Proof The partial correctness follows from the correctness of Algo�rithm ���� and the two following facts�

i An edge accounted to the partial f �matching F � i�e�� in particularan F �marked edge� can never be attempted to be F �marked again�see ��

Page 62: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

ii The total number of edges in F and the number of F �markededges incident to a vertex v never exceeds f�v� since the numberof active entries in T �v� is in fact equal to the current f�v�� i�e��to the original f�v� minus the number of edges incident to v in For F �marked �see ���

Lemma ��� The modi�ed algorithm can be implemented in timeEO�log� n� on a CRCW PRAM with O�n�m� processors�

Proof To simplify the exposition let us assume �rst that the updatephase described in modi�cation � is done in every iteration and underthis assumption prove that the so partially modi�ed algorithm runs inEO�log� n� iterations� To see this observe that for a given vertex the ex�pected number of incident marked good edges� and then consequently ofincident selected good edges and incident selected good edges survivingthe clean�up phase is at least a constant fraction of the correspondingnumbers for the corresponding iteration in Algorithm ���� This ob�servation is non�trivial� as the selected vertices are picked among thepreliminary selected vertices� The crucial point here is that a markededge that won a competition for an active entry becomes preliminaryselected with probability �

� � In this way we leave about half of the ac�tive entries free for the second round of selection� Now it is enough todecrease the lower bound on the decrease of capacity of a good vertex toits fraction in the de�nition of very good edges in the proof of Lemma������ to be able to show analogously that the number of edges in thegraph halves after O�log n� iterations� We conclude that the so partiallymodi�ed algorithm needs O�log� n� iterations of the block to terminate�Now let us consider the fully modi�ed algorithm� with the updates onlyin every dlog ne�th iteration and argue that still O�log� n� iterations areneeded to terminate� The main problem here is that during the dlog neiterations a large part of edges incident to a vertex v can become F �marked and%or a large part of the table T �v� can become passive� Theformer can substantially decrease the chances of an active entry to marka non F �marked edge in the edge�choose phase compared with the situ�ation where the marked edges are deleted� The latter can substantiallydecrease the chances of marked incident edges for �nding an active en�try in T �v� in the bound�degrees phases compared with the situation

Page 63: Efficient Parallel Algorithms for Combinatorial Problems

�� � A randomized parallel algorithm for maximal f �matchings ��

where T �v� is shrinked to contain only active entries� However� the sit�uation where at least �

�f�v� edges incident to v are F �marked� or equiv�alently when T �v� contains at least half of passive entries� is also goodas it means that the capacity of v has been already reduced by at leasthalf� On the other hand� if no more than �

�f�v� edges are F �marked�or equivalently if no more than half of the entries in T �v� are passive�the mentioned chances of active entries or marked edges incident to vrespectively drop only by half� Therefore� the expected number of iter�ations increases only by a constant factor�It remains to estimate the parallel complexity of a single iteration ofthe block in the modi�ed algorithm� Using the constant time randomselection from ����� all the random choices in the choose�edge� bound�indegrees and clean�up phases can be done in constant time on a CRCWPRAM with O�n �m� processors� Also the choices of one among sev�eral edges competing for the same entry in a table T �� can be done inconstant time on an arbitrary CRCW PRAM� We conclude that a singleiteration whose number is not modulo dlog ne takes constant time onan arbitrary CRCW PRAM with O�n�m� processors� The whole up�dating occurring in the remaining iterations can be easily done in timeO�log n� on an arbitrary CRCW PRAM� For instance� to shrink thetables T �� we can use list ranking� As the number of iterations wherethe updating occurs is O�log n� we conclude that the whole modi�edalgorithm runs in time O�log� n� on an arbitrary CRCW PRAM withO�n�m� processors� �

Theorem ��� Let G a graph with a positive integer capacity functionf de�ned on its vertices� A maximal f �matching can be found in timeEO�log� n� on an arbitrary CRCW PRAM with O�n�m� processors�

Page 64: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter �� f �matchings

Page 65: Efficient Parallel Algorithms for Combinatorial Problems

Chapter �

Hypergraphs

Since most concepts of science are relatively sim�

ple once you understand them� any ambitious

scientist must� in self�preservation� prevent his

colleagues from discovering that his ideas are

simple too�

Nicolas Vanserg�

��� Introduction

A hypergraph is a natural generalization of a graph�Let V � fv�� v�� � � � � vng be a �nite set� and let E � fE�� E�� � � � � Emgbe a family of non�empty subsets of V such that�

���i�m

Ei � V

The coupleH � �V�E� is called a hypergraph� The elements v�� v�� � � � � vnare called the vertices and the sets E�� E�� � � � � Em are called the edges�For a node v � V the degree deg�v� of v in H is the number of edgesin E it belongs to� The maximum degree of a node in V is called thevalence of H� and the maximum cardinality of an edge in E is calledthe dimension of H� If the edges of the hypergraph are all distinct�the hypergraph is said to be simple� A simple hypergraph of dimensiontwo is simply an undirected graph �if singletons are neglected�� In thischapter� all hypergraphs are simple�

��

Page 66: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Hypergraphs

E�

E�

E�

E�

E�

Figure ��� Example of a hypergraph � �V �E�� E�� E�� E�� E��

A hypergraph is shown in Fig ��� An edge Ei with jEij � �� isdrawn as a curve encircling all the vertices in Ei� An edge with jEij � �is drawn as a curve connecting its two vertices�An independent set of H is a subset of V which doesn�t include any

edge in E� A maximal independent set �MIS� for short� of H is anindependent set which is not a subset of any other independent set ofH�For a hypergraph H � �V�E�� let GH denote the corresponding

bipartite graph �V � E�E�� where �v� e� � E� i� v � e� It is easy to seethat�

Theorem ��� A subset W of V is independent in H i� W � E isf �dependent in GH where for v � V� f�v� � deg�v� and for e � E�f�e� � jej � �

Thus� the problem of �nding a maximal independent set in a hyper�graph is a special case of the problem of �nding a maximal f �dependentset in a graph �See Section �����

��� MIS in hypergraphs

A MIS of a hypergraph can be trivially computed in polynomial timeby a greedy method� The parallel complexity status of �nding a MIS

Page 67: Efficient Parallel Algorithms for Combinatorial Problems

� MIS in sparse hypergraphs ��

of an arbitrary hypergraph is regarded as a major open problem in par�allel complexity theory ����� When no restrictions on dimension areassumed the only non�trivial upper bound follows from a parallel ran�domized search method due to Karp� Upfal and Wigderson ����� Theirmethod yields O�pjV j log�jV j� jEj�� expected�time bound on �nding aMIS of a hypergraph in the EREW PRAM model H � �V�E� �see ������For hypergraphs of constant dimension� Kelsen has recently proved aparallel randomized algorithm due to Beame and Luby to run in poly�logarithmic time using a linear number of processors ����� Thus� the sorestricted problem is in RNC� By derandomizing the aforementioned al�gorithm Kelsen has also shown that a MIS for a hypergraph of constantdimension can be found in time n�� for any given � � �� For hypergraphsof dimension �� i�e�� for graphs� several NC algorithms for MIS are known���� ��� ���� The �rst of them is due to Karp and Wigderson ����� thesimplest is due to Luby ����� and the most e�cient is due to Goldbergand Spencer ����� The latter algorithm has been recently generalized toinclude hypergraphs of dimension � independently by Dahlhaus� Karpin�ski and Kelsen ���� In this way� the membership of the MIS problem forhypergraphs of dimension � in NC has been established� It seems thatthe dimension � is a limit for the method due to Goldberg and Spencer���� Also� Kelsen ���� admits that a new approach has to be found inorder to derive e�cient parallel algorithms for MIS in hypergraphs ofnon�constant dimension�

��� MIS in sparse hypergraphs

In this section we consider hypergraphs of arbitrary dimension that arehereditary sparse� To formalize the sparsity property we extend theknown concept of graph arboricity to include hypergraphs� Recall thatthe arboricity ��G� of a graph G is the minimum number of forests theedges of G can be partitioned into� For example� graphs of boundedgenus and partial k�trees have constant arboricity� Analogously� we de��ne the arboricity ��H� of a hypergraph H as the minimum number ofacyclic hypergraphs the edges of H can be divided into�

We show that a maximal independent set in a hypergraph H on nnodes can be found in time O���H�� log� n� on a CREW PRAM with

O�n��H����H�logn ��� processors� or in time O���H� log� n� on a CREW

Page 68: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Hypergraphs

PRAM with O�n��H��� processors� Thus� if H is of poly�logarithmicarboricity� i�e�� ��H� � O�logk n� for some integer constant k� then amaximal independent set in H can be found in poly�logarithmic timeusing a polynomial number of processors�Also� if H is of constant arboricity� i�e�� ��H� � O��� then a max�

imal independent set in H can be constructed in time O�log� n� on aCREW PRAM with O�n� processors�

����� Hypergraph arboricity

A hypergraph is acyclic if it doesn�t contain any chain of edges suchthat any two consecutive edges and the �rst and the last edge in thechain respectively overlap ���� The following characterization of acyclichypergraphs will be useful �Proposition � p� ��� in �����

Lemma ��� A hypergraph H � �V�E� with n nodes and p connectedcomponents is acyclic i�

Xe�E

�jej � � � n� p�

For simplicity� we shall denote the set of restrictions of edges in a setE to a node subset U� i�e�� fe � U j e � Eg� by E � U � Also� we shallsay that a hypergraph F � �U�D� is a sub�hypergraph of a hypergraphH � �V�E� if U � V� and D � E �U� It follows easily that for any sub�hypergraph F of a hypergraph H� the inequality ��F � � ��H� holds�Hence� we obtain the following theorem by Lemma �����

Theorem ��� For any sub�hypergraph F � �U�D� of a hypergraphH the inequality

Pe�D�jej � � � ��H�� jU j holds� In particular� the

number of non�singleton edges of F is smaller than ��H�� jU j�

Thus� the notion of hypergraph or graph arboricity corresponds tothe notion of hereditary or inherent sparsity�By the size of a hypergraph we shall mean the sum of cardinalities

of its edges and the number of its vertices�

Corollary ��� For any hypergraph H on n vertices� the size of H issmaller than �n���H� � ��

Page 69: Efficient Parallel Algorithms for Combinatorial Problems

� MIS in sparse hypergraphs ��

����� MIS in hypergraphs of bounded arboricity

Our parallel algorithm for �nding a maximal independent set in a hyper�graph of bounded arboricity can be seen as an NC Turing�like reductionof the original problem to the corresponding problem for a hypergraphwith bounded dimension and bounded valence� Its subroutine for �ndinga maximum independent set in a hypergraph �V�E� with dimension andvalence bounded by b is denoted by MISB�V�E� b� �Algorithm �����

Algorithm MISA�H�input � A hypergraph H � �V�E� on n nodes where ��H� � d�output � A maximal independent set M in H �method �

if jV j � � then output � and stop�D � ��for each e satisfying jej � �d insert a node in e into D�insert each node occuring in � �d edges in E into D�C � V nD�E� � fe � E j e �D � �g�M � MISB�C�E�� �d��F � fe � E nE� j e � �C nM� � �g�output M �MISA�D�F �D��

end MISA

Algorithm ���

Lemma ��� Algorithm ���MISA is partially correct� i�e�� if it stopsthen the set Q to output is a maximal independent set in H�

Proof Since C doesn�t contain nodes of degree � �d andE� is free fromedges of size � �d� the subroutine MISB�C�E�� �d� correctly returns aMIS M in the hypergraph �C�E��� By the maximality of M � for anynode v in CnM � there is an edge e � E� such that v � e and enM � fvg�Hence� no node in CnM can occur in any independent set in H includingM � Therefore� it remains only to extend M by a maximal subset of D�Since C �D � �� the edges in E� as well as the edges in E n E� with anon�empty intersection with C nM never can be completely �lled withnodes in D �M � Therefore� we can disregard them constructing such aD�extension� Hence� it is both su�cient and necessary to extend M bya maximal subset of D so that the edges consisting solely of nodes inM and D won�t be completely �lled� i�e�� by a MIS in the hypergraph

Page 70: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Hypergraphs

�D�F �D�� The hypergraph �D�F �D� has arboricity � d� Hence� wemay assume inductively that MISA�D�F �D� correctly outputs a MISin �D�F �D� since jDj � jV j holds by the following lemma� �

Lemma ��� Let n � jV j� where H � �V�E� is the input hypergraphin MISA� The inequality jDj � �

�n holds� Hence� the recursion depth ofthe algorithm MISA is O�log n��

Proof Consider the input hypergraph H � �V�E� where n � jV j�Since ��H� � d� the number m of edges in E where jej � �d satis�es�dm � dn by Theorem ����� Also� the number l of nodes in H of degree� �d satis�es �dl � Pe�E�jej � � � jEj which yields �dl � �dn � n byTheorem ����� We conclude that jDj � �

�n� �

Lemma ��� Suppose that a maximal independent set in a hyper�graph on n nodes with dimension and valence bounded by k can befound in time Th�n� k� using a PRAM with Ph�n� k� processors� Algo�rithm MISA can be implemented in time O�log n �Th�n� �d� � log�nd���on an CRCW PRAM with O� nd

log�nd� � � Ph�n� �d� processors�

Proof By Theorem ����� the total size of H� i�e�� the sum of cardi�nalities of its edges is O�nd��To implement the set operations quickly using a linear number of

processors� we represent the node sets di�erent from edges with n ele�ment vectors� each of them with on the i�th position if and only if thei�th node in H is currently in the set� Analogously� we represent the setsof edges with O�nd� element vectors� On the contrary� an edge of H isencoded in a table listing the numbers of the contained nodes�The edge tables as well as the edge dimensions and the node degrees

can be easily determined in logarithmic time within the processor boundsgiven in the lemma by parallel list ranking and parallel merge sort ���� ���By the standard simulation of a CRCW PRAM on an EREW PRAM

����� we can insert for each e satisfying jej � �d a node in e into D� andto compute E� and F � both in time O�log�nd�� on an EREW PRAMwith O�nd� processors�Hence� all the instructions di�erent from the calls ofMISB andMISA

can be implemented in timeO�log�nd�� on an EREW PRAMwithO�nd�processors�

Page 71: Efficient Parallel Algorithms for Combinatorial Problems

� MIS in sparse hypergraphs �

A maximal independent set in the hypergraph �C�E�� can be foundin time Th�n� �d� using Ph�n� �d� CREW PRAM processors�

We conclude that all instructions but for the recursive call of MISAtotally take time Th�n� �d� � O�log�nd�� on a CREW PRAM withO�nd� � Ph�n� �d� processors� This combined with Lemma ����� andjDj � n yields the thesis� �

����� MIS in hypergraphs of bounded dimension and va�

lence

In this section� we present a parallel algorithm for �nding a maximal in�dependent set in a hypergraph of bounded dimension and valence whichis a specialization of the parallel method for maximal f �dependent setin a graph for bounded f from section ���� Due to the specializationmore precise bounds are derived�

Algorithm MISB�V�E� b�input � A hypergraph H � �V�E� with dimension and valence

bounded by b�output � A maximal independent set K in H �method �

K � � �B � V n

Se�Ejej�� e�

while B �� � do

G� the graph whose set of nodes is Bsuch that �v� w� is an edge of G i�v and w belong to the same edge in E�

L� a maximal independent set in G�K � K � L�S � fe � E j j�e �K�j � jej � �g�B � B n �L �

Se�S e��

endwhile

output K�end MISB

Algorithm ���

Lemma ��� The block under the while statement is iterated O�b��times�

Page 72: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Hypergraphs

Proof Each iteration after which a node v remains in B results ininserting at least one node in at least one of the at most b edges con�taining v into K� Therefore� after � b�b� �� � iterations at least oneof the edges will be included into S and consequently v will disappearfrom B for good� �

Lemma ��� Algorithm MISB is correct�

Proof The augmentation of K by L is correct since no node in L iscontained in an edge e having already jej � nodes in K� and L is alsoan independent set in H� This combined with Lemma ����� yields thetotal correctness �

Lemma ��� Suppose that a maximal independent set in a graph onn nodes with valence bounded by k can be found in time Tg�n� k� ona CREW PRAM with Pg�n� k� processors� Algorithm MISB can beimplemented in time O�b� log�nb� � b�Tg�n� b

��� on a CREW PRAMwith O�nb� � b

log�nb� �� � Pg�n� b�� processors�

Proof By Lemma ������ we can replace the while statement by a for�loop with the number of iterations O�b�� to avoid the test for emptinessof B� Also� the set instructions can be implemented in constant time�using O�nb� CREW PRAM processors� analogously as in the proof ofLemma ������To construct the auxiliary graph G� we proceed as follows� For each

node v of H� we form the list E�v� of the at most b edges containing v�Using the input representation of H as a sequence of node lists repre�senting the edges of H� it can be done by sorting in O�log�nb�� time onan EREW PRAM with O�nb� processors ���� Further� using parallel listranking� we assign O�b�� processors to consecutive groups of O�log�nb��elements on such a list E�v� to list out all nodes adjacent to v in G intime O�log�nb���The valence of G is � b�� Hence� a maximal independent set in G can

be found in time Tg�n� b�� on a CREW PRAM with Pg�n� b

�� processorsby our assumptions� �

Goldberg and Spencer have proved that a maximal independent setin a graph on n nodes andm edges can be computed in time O�log� n� on

Page 73: Efficient Parallel Algorithms for Combinatorial Problems

� MIS in sparse hypergraphs ��

a EREW PRAM with O�n�mlog n � processors ����� Further� Goldberg andPlotkin have shown that if the input graph has valence bounded by kthen its maximal independent set can be constructed in time O�k� log n�on an EREW PRAM with O�n�m�� processors ����� Combining thesefacts with Lemmata ������ ������ ������ ������ we obtain our main result�

Theorem ��� A maximal independent set in a hypergraph H on nnodes can be found�

�� in time O���H�� log� n� on a CREW PRAM with

O�n��H�� � ��H�log n �� processors�

�� in time O���H� log� n� on a CREW PRAM with O�n��H���processors�

Corollary ��� Amaximal independent set in a hypergraphH ofO��arboricity can be found in time O�log� n� on a CREW PRAM with O�n�processors�

Page 74: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Hypergraphs

Page 75: Efficient Parallel Algorithms for Combinatorial Problems

Chapter �

Conclusions

All human knowledge begins with intuitions� pro�

ceeds to concepts� and ends in ideas

Immanuel Kant

We have studied the parallel complexity of a family of fundamentalcombinatorial problems which have a numerous applications in di�erentareas�

Maximum k�dependent set

The computation of a maximum k�dependent set has been shown to beprobably unfeasible problem� Recent results show that even for bipartitegraphs and k the problem remains NP�complete ���� So furtherresearch should be centered on �nding algorithms for restricted graphfamilies� or studying the approximability of the problem�

For a non�negative k and a graph G� let Dk�G� denote the maxi�mum cardinality of a k�dependent set in G� Clearly� we have D��G� �D��G� � D��G� � � �� For a non�negative integer b� a b�matching in agraph G is a subset of the set of edges of G such that for each vertex atmost b edges incident to the vertex are in the subset" in other words� anf �matching where f�v� � b for all vertices v� Let Mb�G� stand for themaximum cardinality of a b�matching in G� It would be interesting to�nd non�trivial relations between Dk�G��s and Mb�G��s for b�s relatedto k� For instance it is known that M��G� � D��G�� and for bipartite

��

Page 76: Efficient Parallel Algorithms for Combinatorial Problems

�� Chapter � Conclusions

graphs M��G� � D��G��

Maximal f�dependent sets and MIS on hypergraphs

For non�dense graphs our NC algorithm for computing maximal k�de�pendent sets is far from being optimal in the sense of the time�processorproduct� It seems that more processor�e�cient NC algorithms for max�imal k�dependent set can be derived in the special cases of k � � � andfor planar graphs �see ������ However� the ultimate goal here would beto derive an NC algorithm for maximal k�dependent set in the generalcase such that the time�processor product would be within a logarithmicfactor from the size of the input graph� We would like to design fasterparallel algorithms for di�erent graph families� The generalization of ouralgorithm for maximal k�dependent set to include maximal f �dependentset �see Theorem ����� runs in poly�logarithmic time only if the maxi�mum value of f is poly�logarithmic in the input size� Thus� the problemof whether one can construct a maximal f �dependent set in the generalcase of f using an NC algorithm is also open� Surprisingly we havefound the latter problem to be essentially equivalent to the problem ofwhether a maximal independent set of a hypergraph can be constructedby an NC algorithm �when hyper�edge size is constantly bounded a ran�domized NC solution is known�� For the hypergraph problem we haveprovided an NC solution in the bounded arboricity case�

Maximal f�matching

Our parallel algorithms for maximal f �matching are not optimal� Thedeterministic algorithm has the same complexity bounds as the bestknown maximal �matching algorithm� due to Israeli and Shiloachs �����The work of our randomized algorithm is a logarithmic factor from thebest known randomized parallel algorithm for maximal �matching �Is�raeli and Itai ������ We have presented a interesting method of achievinga logarithmic speed�up in the CRCW model for our EREW algorithm�We believe that it is possible to improve the bounds of our algorithms

and that it is possible to develop optimal parallel algorithms for thisproblem� The case of co�graphs is also interesting as there are knownoptimal parallel algorithms for maximum �matchings in these graphs�

Page 77: Efficient Parallel Algorithms for Combinatorial Problems

Bibliography

�� S� Arnborg� J� Lagergren and D� Seese� Problems Easy for

Tree Decomposable Graphs� In Proc� Inter� Colloq� on Automata�Languages and Programming� Tampere ���� Lecture Notes inComputer Science ��� Springer Verlag� pp������ �

��� T� Asano� Graphical Degree Sequence Problems with Connectivity

Requirements� Proc� ISAAC���� Hong Kong� Springer� LNCS ����pp� ������

��� B� Awerbuch� A� Israeli and Y� Shiloach� Finding Euler

circuits in logarithmic parallel time� Proc� �th Ann� ACM Symp�on Theory of Computing ������ pp���������

��� B� S� Baker� Approximation algorithms for NP�complete problems

on planar graphs� In Proc� ��th Ann� Symp� on Found� of Comp�Sci������ pp� ��������

��� C� Berge� Graphs and Hypergraphs� �North�Holland MathematicalLibrary� ����

��� P� Berman and T� Fujito On Approximation Properties of the

Independent Set Problem for Degree � Graphs In Proc� �th Int�Workshop on Algorithms and Data�structures� WADS���� LectureNotes in Computer Science ���� Springer Verlag� pp� ��������

��� S� Carlsson� Y� Igarashi� K� Kanai� A� Lingas� K� Miura

and Ola Petersson� Information Disseminating Schemes for

Fault Tolerance in Hypercubes� IEICE Trans� Fundamentals�Vol�E���A� No � February ���� pp� ��������

��

Page 78: Efficient Parallel Algorithms for Combinatorial Problems

�� Bibliography

��� E� Cohen� Approximate max �ow on small depth networks� Proc���rd FOCS� ���� pp� ���&����

��� R� Cole� Parallel merge sort� SIAM J� Comput�� vol �� No� ������ pp �������

��� R� Cole and U� Vishkin� Optimal parallel algorithms for ex�

pression tree evaluation and list ranking� In VLSI Algorithms andarchitectures� �rd Aegean Workshop on Computing� AWOC �� pp�����

�� S� Cook� The Classi�cation of Problems which have Fast Parallel

Algorithms� Proceedings of the ��� International FCT�Conference�Borgholm� Sweden� Lecture Notes in Computer Science ����� ������

��� S� Cook� The taxonomy of problems with fast parallel algorithms�In Information and Control� Vol ��� Nos� ��� ���� Academic Press�New York�

��� E� Dahlhaus and M� Karpinski� A Fast Parallel Algorithm

for Computing All Maximal Cliques in a Graph and the Related

Problems� In the Proceeding of the st Scandinavian Workshop onAlgorithm Theory� SWAT ��� Lecture Notes in Computer Science��� Springer Verlag� pp� ������

��� E� Dahlhaus� M� Karpinski and P� Kelsen� An E�cient

Parallel Algorithm for Computing a Maximal Independent Set in

a Hypergraph of Dimension �� to appear in Information ProcessingLetters�

��� A� Dessmark� K� Jansen and A� Lingas� The maximum k�dependent and f �dependent set problem Proceedings of the �thAnnual International Symposium on Algorithms and ComputationISAC���� Lecture Notes in Computer Science ���� Springer Verlag�pp ������

��� K� Diks� O� Garrido and A� Lingas� Parallel algorithms for

�nding maximal k�dependent sets and maximal f �matchings� Inter�national Journal of Foundations of Computer Science� Vol �� No ��pp� ������

Page 79: Efficient Parallel Algorithms for Combinatorial Problems

Bibliography ��

��� H� Djidjev� O� Garrido� C� Levcopoulos and A� Lingas� Onthe maximum q�dependent set problem� International Conference forYoung Computer Scientists � ICYCS�� pp��������

��� P� Erd�os and T� Gallai� Graphs with prescribed degrees� InMat� Lapok � ���� pp���������

��� Z� Galil and V� Pan� Improved processor bounds for combinato�

rial problems in RNC� Combinatorica� �� ���� pp� �������

���� M� R� Garey� D� S� Johnson� Computers and Intractability �W�H� Freeman and Company� San Francisco� �����

��� O� Garrido� S� Jarominek� A�Lingas and W� Rytter� A

Simple Randomized Parallel Algorithm for Maximal f �Matchings�In the Proc of the st� Latin American Theoretical InformaticsLATIN����Lecture Notes in Computer Science ���� Springer Ver�lag� pp������� To appear in Information Processing Letters�

���� O� Garrido� The Complexity of the q�dependent set problem� The�sis for the degree of Masters of Science� Dept� Computer Science�Lund University�

���� O� Garrido� On the Realization of Degree Sequences in Parallel�Internal Report� LU�CS�TR������ Dept� Computer Science� LundUniversity�

���� O� Garrido� P� Kelsen and A� Lingas� A simple NC�algorithm

for a maximal independent set in a hypergraph of poly�log arboricity

To appear in Information Processing Letters�

���� O� Garrido and A� Lingas� An NC�algorithm for a maximal

independent set in a hypergraph of poly�log arboricity In Proc� XVInternational Conference of the C�C�S�S�� ����

���� H� Gazit and G� L� Miller A parallel Algorithm for Finding a

Separator in Planar Graphs� In Proc� ��th Symp� on Foundationsof Computer Science� ����

���� A� Gibbons and W� Rytter� E�cient Parallel Algorithms �Cam�bridge University Press� Cambridge� �����

Page 80: Efficient Parallel Algorithms for Combinatorial Problems

�� Bibliography

���� M� Goldberg and T� Spencer� A New Parallel Algorithm for

the Maximal Independent Set Problem� In Proc� ��th Symp� onFoundations of Computer Science� ����

���� M� Goldberg and T� Spencer� Constructing a Maximal Inde�

pendent Set in Parallel SIAM� J� Disc� Math� Vol �� No � ������pp���������

���� A� V� Goldberg and S� A� Plotkin� Parallel �� � �� Color�ing of Constant�degree Graphs� Information Processing Letters ������� pp� �������

��� T� Hagerup and C� R�ub� A guided tour of Cherno� bounds�

Information Processing Letters �� ����%��� ��������

���� S�L� Hakimi� On the realizability of a set of integers as degrees of

the vertices of a linear graph� J� SIAM �� ���� pp� ��������

���� A� Israeli and A� Itai� A fast and simple randomized parallel

algorithm for maximal matching� Information Processing Letters�� ����� ������

���� A� Israeli and Y� Shiloach� An improved parallel algorithm for

maximal matching� Information Processing Letters �� ����� pp�������

���� H�J� Karloff� A Las Vegas RNC algorithm for maximum match�

ing� Combinatorica ����� pp� ������� ����

���� R� M� Karp and V� Ramachandran� A Survey of Parallel Al�

gorithms for Shared�Memory Machines� Handbook of TheoreticalComputer Science� Volume A� Algorithms and Complexity� J� vanLeeuwen� Editor� Elsevier Science Publisher� B�V� ���� ISBN �������� �

���� R� M� Karp� E� Upfal and A� Wigderson� Constructing a

perfect matching is in random NC� Combinatorica �� ��� pp� ������

���� R� M� Karp� E� Upfal and A� Wigderson� The complexity of

parallel search� JCSS vol� ��� ���� pp� ��������

Page 81: Efficient Parallel Algorithms for Combinatorial Problems

Bibliography �

���� R� M� Karp and A� Wigderson� A Fast Parallel Algorithm for

the Maximal Independent Set Problem� In Proceedings of the �thAnnual ACM Symposium on Theory of Computing� ����

���� P� Kelsen� On the Parallel Complexity of Computing a Maximal

Independent Set in a Hypergraph� Proc� of the ��th Annual ACMSymposium on Theory of Computing� ����

��� R�E� Ladner and M�J� Fischer� Parallel Pre�x Computations�In J� ACM� ��� ���� pp��������

���� C� Levcopoulos� A� Lingas� O� Petersson and W� Rytter�Optimal parallel algorithms for testing isomorphism of trees and

outerplanar graphs� Proceedings to �th FST�TCS� Bengalore�India� Lecture Notes in Computer Science ���� ���� pp� �������

���� R� J� Lipton and R� E� Tarjan Applications of planar separator

theorem� In SIAM J� Comput� �� � ����� pp� �������

���� L� Lovasz and M� D� Plummer� Matching Theory� Annals of

Discrete Mathematics ����� North�Holland Mathematics Studies�� Elsevier Science Publishers B� V� ISBN ���� �����

���� M� Luby A simple parallel algorithm for the maximal independent

set problem� In SIAM J�Comput� �� � ����� pp� ��������

���� A� Maheshwari� Personal communication�

���� E� W� Mayr and A� S� Subramanian The complexity of cir�

cuit value and network stability� In Proc� Structure in ComplexityTheory ��th Ann� IEEE Conf������� pp� �����

���� S� Micali and V�V� Vazirani An O�pV �E� algorithm for �nding

maximum matching in general graphs� In the Proc� �th� Ann� IEEESymp� Foundations of Computer Science� Syracuse ���� pp� ����

���� K� Mulmuley� U�V� Vazirani� and V�V� Vazirani� Matching

is as easy as matrix inversion� Combinatorica ���� pp� �����

���� C� N� K� Osiakwan and S� G� Akl� Optimal parallel algorithmsfor b�matchings in trees� Proceedings to Optimal Algorithms Inter�national Symposium Lecture notes in Computer Science �� �������������

Page 82: Efficient Parallel Algorithms for Combinatorial Problems

�� Bibliography

��� N� J� Pippenger� On simultaneous resource bounds� In the Proc���th� Annual Symp� on Foundation of Computer Science� ���� pp������

���� Y� Shiloach and U� Vishkin� An O�log n� parallel connectivityalgorithm� J� Algorithms � ������ pp� ������

���� W�T� Tutte A Short Proof of the Factor Theorem for Finite

Graphs� Canad� J� Math� �� ���� pp� ��������