Complexity Problems in Switching Classes of Graphs
Total Page:16
File Type:pdf, Size:1020Kb
Complexity Problems in Switching Classes of Graphs Andrzej Ehrenfeucht Dept of Computer Science University of Colorado at Boulder Boulder Co USA Jurriaan Hage Dept of Computer Science Leiden University PO Box RA Leiden The Netherlands email jhagewileidenunivnl homepage httpwwwwileidenunivnljhage Tero Harju Dept of Mathematics University of Turku FIN Turku Finland email harjusaraccutu Grzegorz Rozenberg Dept of Computer Science Leiden University the Netherlands Dept of Computer Science University of Colorado at Boulder USA December Abstract For a graph G V E and a subset V the switching of G by is dened 0 as the graph G V E which is obtained from G by removing all edges b etween and its complement and adding as edges all nonedges b etween and The switching class G determined by G consists of all switchings G for subsets V In this pap er we compare the complexity of a number of problems for graphs with the complexity of these problems for switching classes It turns out that every imaginable situation can o ccur We show that every switching class except the class of all complete bipartite graphs contains a pancyclic graph This implies that deciding whether a switching class contains a hamiltonian graph can b e done in p olynomial time although this problem is NPcomplete for graphs Prop erties that are NPcomplete b oth for graphs and for switching classes are obtained by generalizing a result of Yannakakis on hereditary prop erties We also prove that the embedding problem and the colourability problem for switching classes are NPcomplete A graph is equally divided if it consists of two connected comp onents with the same number of vertices Deciding this prop erty can b e done in linear time for graphs while deciding whether a switching class contains an equally divided graph is NPcomplete Introduction For a nite undirected graph G V E and a subset V the switching of G by 0 is dened as the graph G V E which is obtained from G by removing all edges and adding as edges all nonedges b etween and b etween and its complement The switching class G determined by G consists of all switchings G for subsets V A switching class is an equivalence class of graphs under vertex switching see the survey pap ers by Seidel and Seidel and Taylor Generalizations of this approach can b e found in Gross and Tucker Ehrenfeucht and Rozenberg and Zaslavsky A prop erty P of graphs can b e transformed into an existential prop erty of switching classes as follows P G if and only there is a graph H G such that PH 9 First we consider hamiltonicity and pancyclicity of graphs We prove that hamilton 9 and pancyclic are in P On the other hand deciding whether a graph is hamiltonian is 9 NPcomplete In our results on hamiltonicity we follow the main lines of J Krato chvil J Nesetril and O Z yka as communicated to us by J Krato chvil We also give a short list of problems that are NPcomplete for graphs but easy for switching classes The second part of the pap er is devoted to a number of problems that are hard for switching classes We generalize to switching classes a result of Yannakakis on graphs which is then used to prove that the indep endence problem is NPcomplete for switching classes This problem can b e p olynomially reduced to the embedding problem given two graphs G and H do es there exist a graph in G in which H can b e embedded Hence the latter problem is also NPcomplete for switching classes It also turns out that deciding whether a switching class contains a colourable graph is NPcomplete A graph is said to b e equally divided if it consists of exactly two connected com p onents with the same number of vertices This problem is linear for graphs but equallydivided turns out to b e NPcomplete for switching classes 9 Preliminaries For a nite set V let jV j b e the cardinality of V We shall often identify a subset A V with its characteristic function A V Z where Z f g is the cyclic group 2 2 of order two We use the convention that for x V Ax if and only if x A For A A V we denote the complement of A with resp ect to V by The restriction of a function f V W to a subset A V is denoted by f j A We now turn to notation and terminology for graphs and switching classes The set E V fxy j x y V x y g denotes the set of all unordered pairs of distinct elements of V The graphs of this pap er will b e nite undirected and simple ie they contain no lo ops or multiple edges For a graph G V E we often write xy G instead of xy E We use E G and V G to denote the set of edges E and the set of vertices V resp ectively and jV j and jE j are called the order resp ectively size of G Analogously to sets a graph G V E will b e identied with the characteristic function G E V Z of its set of edges so that Gxy for xy E and Gxy 2 for xy E Later we shall use b oth notations G V E and G E V Z for 2 graphs A switching of a graph G by a selector V Z is the graph G such that for all 2 xy E V G xy x Gxy y Clearly this denition of switching is equivalent to the one given at the b eginning of the introduction We reserve lower case and for selectors subsets used in switching The set G fG j V g is called the switching class of G The graph G is called a generator of its switching class G For a graph G V E and X V let Gj denote the subgraph of G induced by X X Hence Gj E X Z X 2 G V E with E fxy j xy E g For a set G of graphs The complement of G is we let G fG j G G g Two vertices x y V are adjacent in G if xy E The degree of a vertex x V denoted by d x is the number of vertices adjacent to x The graph G is called even G odd if all vertices are of even o dd degree A vertex of degree zero is called isolated A set U V is a clique if every vertex in U is adjacent to every other vertex in U A sequence of vertices v v is a path in G if v is adjacent to v 1 i i+1 k for i k and all vertices are distinct If v v is a path then 1 k v v v is a cycle if k 1 1 k The complete connection of two vertexdisjoint graphs G V E and G 1 1 1 2 V E is G G G such that V G V G V G and E G E G 2 2 1 2 1 2 1 E G fxy j x V G y V G g 2 1 2 K V and K V E V b e the discrete graph and the complete graph Let V V on V resp ectively and let K denote the complete bipartite graph with the partition A A A g If the sets of vertices themselves are irrelevant we write K and K where fA n k m n jV j k jAj and m j A j For graphs G and H we dene G H by G H e Ge H e for e E V Clearly the graphs form an ab elian group under this op eration we use to denote this group The following lemma is immediate see also Ellingham Lemma K consists of the complete bipartite graphs on V and it is a subgroup of i V ii For all V and graphs G on V G G + iii For all V G G 2 In particular G G and G G for all Lemma G G Furthermore if jV j then G G For a graph G V E Pro of We show rst that for a graph G V E and V G G Indeed let x y V Then G xy x Gxy y x Gxy y G xy b ecause a b a b for a b Z 2 The additional claim clearly holds 2 General problem setting In this section we rst introduce some notions for transforming prop erties of graphs into prop erties of switching classes By way of introduction we review some known results in this area Recall from the introduction that for a prop erty P of graphs the existential lifting of P denoted P is dened by 9 P G if and only if there exists an H G such that PH 9 PG if PG do es not hold We write Clearly if P is in NP then so is P b ecause one can guess a selector and then 9 check whether PG holds in nondeterministic p olynomial time Lemma If deciding a prop erty P of graphs is in NP then deciding P is also in NP 2 9 Recall that a graph is eulerian if there exists a cycle that traverses each edge exactly once It was proved by Seidel that if the number of vertices of a graph G is o dd then the switching class G contains a unique graph with eulerian connected comp onents that is Theorem If G is a graph of o dd order then G contains a unique even graph G 2 For graphs of even order a switching class G can contain noneulerian graphs However we have Theorem Let G b e a graph of even order Then either G has no even and no o dd graphs or exactly half of its graphs are even while the other half are o dd Pro of Let G b e a graph Dene u v if d u d v mo d that is if the degrees of u G G G and v have the same parity This relation is an equivalence relation on V G Assume then that the order n of G is even If we consider singleton selectors only hence switching with resp ect to one vertex only then it is easy to see that and G coincide for all selectors In other words if G has even order then the relation G is an invariant of the switching class G G This means that if G contains an even graph then all graphs in G are either even or o dd Further if G is even and V G Z is a singleton selector then for each 2 v V G d v and d v have dierent parity From this the theorem follows 2 G G From the ab ove theorems it follows that euler can b e decided in time quadratic in 9 the order of the graph A general uniqueness result such as Theorem is not p ossible without restrictions on the vertex set Indeed if P is any graph prop erty which is preserved under isomorphisms then there exists a switching class that either has no graphs with prop erty P or it has at least two graphs with prop erty