Finding Dominating Induced Matchings in P 9 -Free Graphs in Polynomial Time
aa r X i v : . [ c s . D M ] A p r Finding Dominating Induced Matchings in P -Free Graphs inPolynomial Time Andreas Brandst¨adt ∗ Raffaele Mosca † April 2, 2020
Abstract
Let G = ( V, E ) be a finite undirected graph. An edge subset E ′ ⊆ E is a dominatinginduced matching ( d.i.m. ) in G if every edge in E is intersected by exactly one edgeof E ′ . The Dominating Induced Matching ( DIM ) problem asks for the existence of ad.i.m. in G . The DIM problem is NP -complete even for very restricted graph classessuch as planar bipartite graphs with maximum degree 3 but was solved in linear timefor P -free graphs and in polynomial time for P -free graphs. In this paper, we solveit in polynomial time for P -free graphs. Keywords : dominating induced matching; P -free graphs; polynomial time algorithm. Let G = ( V, E ) be a finite simple undirected graph, i.e., an undirected graph without loopsand multiple edges. Given an edge e ∈ E , we say that e dominates itself and every edgesharing a vertex with e . An edge subset M ⊆ E is an induced matching if the pairwisedistance between its members is at least 2 (i.e., the distance property ), that is, M isisomorphic to kP for k = | M | . A subset M ⊆ E is a dominating induced matching ( d.i.m. for short) of G if M is an induced matching in G such that every edge in E is dominatedby exactly one edge in M . Clearly, not every graph G has a d.i.m.; the DominatingInduced Matching (DIM) problem asks for the existence of a d.i.m. in G .The DIM problem is also called Efficient Edge Domination (EED) in variouspapers: Recall that a vertex v ∈ V dominates itself and its neighbors. A vertex subset D ⊆ V is an efficient dominating set ( e.d.s. for short) of G if every vertex of G is dominatedby exactly one vertex in D . The notion of efficient domination was introduced by Biggs[2] under the name perfect code . The Efficient Domination (ED) problem asks for theexistence of an e.d.s. in a given graph G (note that not every graph has an e.d.s.) A set M of edges in a graph G is an efficient edge dominating set ( e.e.d.s. for short) of G if andonly if it is an e.d.s. in its line graph L ( G ). The Efficient Edge Domination (EED)problem asks for the existence of an e.e.d.s. in a given graph G . Thus, the EED problem ∗ Institut f¨ur Informatik, Universit¨at Rostock, A.-Einstein-Str. 22, D-18051 Rostock, Germany, a [email protected] † Dipartimento di Economia, Universit´a degli Studi “G. D’Annunzio” Pescara 65121, Italy. r [email protected] G corresponds to the ED problem for its line graph L ( G ). Note that not everygraph has an e.e.d.s.In [10], it was shown that the DIM problem is NP -complete; see also [3, 9, 13, 14].However, for various graph classes, DIM is solvable in polynomial time. For mentioningsome examples, we need the following notions:Let P k denote the chordless path P with k vertices, say a , . . . , a k , and k − a i a i +1 , 1 ≤ i ≤ k −
1; we also denote it as P = ( a , . . . , a k ).For indices i, j, k ≥
0, let S i,j,k denote the graph H with vertices u, x , . . . , x i , y , . . . , y j , z , . . . , z k such that the subgraph induced by u, x , . . . , x i forms a P i +1 ( u, x , . . . , x i ), thesubgraph induced by u, y , . . . , y j forms a P j +1 ( u, y , . . . , y j ), and the subgraph inducedby u, z , . . . , z k forms a P k +1 ( u, z , . . . , z k ), and there are no other edges in S i,j,k ; u iscalled the center of H . Thus, claw is S , , , and P k is isomorphic to S k − , , .For a set F of graphs, a graph G is called F -free if no induced subgraph of G iscontained in F . If |F | = 1, say F = { H } , then instead of { H } -free, G is called H -free.The following results are known: Theorem 1.
DIM is solvable in polynomial time for ( i ) S , , -free graphs [ ] , ( ii ) S , , -free graphs [ ] , ( iii ) S , , -free graphs [ ] , ( iv ) S , , -free graphs [ ] , ( v ) S , , -free graphs [ ] , ( vi ) S , , -free graphs [ ] , ( vii ) P -free graphs [ ] (in this case even in linear time), ( viii ) P -free graphs [ ] . In [11], it is conjectured that for every fixed i, j, k , DIM is solvable in polynomialtime for S i,j,k -free graphs (actually, an even stronger conjecture is mentioned in [11]); thisincludes P k -free graphs for k ≥
9. In this paper we show that DIM can be solved inpolynomial time for P -free graphs (generalizing the corresponding results for P -free andfor P -free graphs). Let G be a finite undirected graph without loops and multiple edges. Let V ( G ) or V denote its vertex set and E ( G ) or E its edge set (say G = ( V, E )); let n = | V | and m = | E | . For v ∈ V , let N ( v ) := { u ∈ V : uv ∈ E } denote the open neighborhood of v , and let N [ v ] := N ( v ) ∪ { v } denote the closed neighborhood of v . If xy ∈ E , we alsosay that x and y see each other , and if xy E , we say that x and y miss each other . A2ertex set S is independent in G if for every pair of vertices x, y ∈ S , xy E . A vertexset Q is a clique in G if for every pair of vertices x, y ∈ Q , x = y , xy ∈ E . For uv ∈ E let N ( uv ) := N ( u ) ∪ N ( v ) \ { u, v } and N [ uv ] := N [ u ] ∪ N [ v ].For U ⊆ V , let G [ U ] denote the subgraph of G induced by vertex set U . Clearly xy ∈ E is an edge in G [ U ] exactly when x ∈ U and y ∈ U ; thus, G [ U ] can simply bedenoted by U (if understandable).For A ⊆ V and B ⊆ V , A ∩ B = ∅ , we say that A (cid:13) B ( A and B miss each other ) ifthere is no edge between A and B , and A and B see each other if there is at least oneedge between A and B . If a vertex u / ∈ B has a neighbor v ∈ B then u contacts B . Ifevery vertex in A sees every vertex in B , we denote it by A (cid:13) B . For A = { a } , we simplydenote A (cid:13) B by a (cid:13) B , and correspondingly A (cid:13) B by a (cid:13) B . If for A ′ ⊆ A , A ′ (cid:13) ( A \ A ′ ),we say that A ′ is isolated in G [ A ]. For graphs H , H with disjoint vertex sets, H + H denotes the disjoint union of H , H , and for k ≥ kH denotes the disjoint union of k copies of H . For example, 2 P is the disjoint union of two edges.As already mentioned, a chordless path P k , k ≥
2, has k vertices, say v , . . . , v k , and k − v i v i +1 , 1 ≤ i ≤ k −
1; the length of P k is k −
1. We also denote it as P = ( v , . . . , v k ).A chordless cycle C k , k ≥
3, has k vertices, say v , . . . , v k , and k edges v i v i +1 , 1 ≤ i ≤ k −
1, and v k v ; the length of C k is k .Let K i , i ≥
1, denote the clique with i vertices. Let K − e or diamond be the graphwith four vertices, say v , v , v , u , such that ( v , v , v ) forms a P and u (cid:13){ v , v , v } ; its mid-edge is the edge uv .A butterfly has five vertices, say, v , v , v , v , u , such that v , v , v , v induce a 2 P with edges v v and v v (the peripheral edges of the butterfly), and u (cid:13){ v , v , v , v } .We often consider an edge e = uv to be a set of two vertices; then it makes sense tosay, for example, u ∈ e and e ∩ e ′ = ∅ , for an edge e ′ . For two vertices x, y ∈ V , let dist G ( x, y ) denote the distance between x and y in G , i.e., the length of a shortest pathbetween x and y in G . The distance between a vertex z and an edge xy is the lengthof a shortest path between z and x, y , i.e., dist G ( z, xy ) = min { dist G ( z, v ) : v ∈ { x, y }} .The distance between two edges e, e ′ ∈ E is the length of a shortest path between e and e ′ , i.e., dist G ( e, e ′ ) = min { dist G ( u, v ) : u ∈ e, v ∈ e ′ } . In particular, this means that dist G ( e, e ′ ) = 0 if and only if e ∩ e ′ = ∅ .Clearly, G has a d.i.m. if and only if every connected component of G has a d.i.m.; fromnow on, we consider that G is connected, and connected components of induced subgraphsof G are mentioned as components .Note that if G = ( V, E ) has a d.i.m. M , and V ( M ) denotes the vertex set of M then V \ V ( M ) is an independent set, say I , i.e., V has the partition V = V ( M ) ∪ I. (1)From now on, all vertices in I are colored white and all vertices in V ( M ) are coloredblack. According to [11], we also use the following notions: A partial black-white coloringof V is feasible if the set of white vertices is an independent set in G and every black vertexhas at most one black neighbor. A complete black-white coloring of V is feasible if the setof white vertices is an independent set in G and every black vertex has exactly one blackneighbor. Clearly, M is a d.i.m. of G if and only if the black vertices V ( M ) and the whitevertices V \ V ( M ) form a complete feasible coloring of V .3 .2 Reduction steps, forbidden subgraphs, forced edges, and excludededges Various papers on this topic introduced and applied some forcing rules for reducing thegraph G to a subgraph G ′ such that G has a d.i.m. if and only if G ′ has a d.i.m., basedon the condition that for a d.i.m. M , V has the partition V = V ( M ) ∪ I such that allvertices in V ( M ) are black and all vertices in I are white (recall (1)).A vertex v ∈ V is forced to be black if for every d.i.m. M of G , v ∈ V ( M ). Analogously,a vertex v ∈ V is forced to be white if for every d.i.m. M of G , v / ∈ V ( M ).Clearly, if uv ∈ E and if u, v are forced to be black, then uv is contained in every(possible) d.i.m. of G .An edge e ∈ E is a forced edge of G if for every d.i.m. M of G , e ∈ M . Analogously,an edge e ∈ E is an excluded edge of G if for every d.i.m. M of G , e M .For the correctness of the reduction steps, we have to argue that G has a d.i.m. if andonly if the reduced graph G ′ has one (provided that no contradiction arises in the vertexcoloring, i.e., it is feasible).Then let us introduce two reduction steps which will be applied later. Vertex Reduction.
Let u ∈ V ( G ). If u is forced to be white, then( i ) color black all neighbors of u , and( ii ) remove u from G .Let G ′ be the reduced subgraph. Clearly, Vertex Reduction is correct, i.e., G has ad.i.m. if and only if G ′ has a d.i.m. Edge Reduction.
Let uv ∈ E ( G ). If u and v are forced to be black, then( i ) color white all neighbors of u and of v (other than u and v ), and( ii ) remove u and v (and the edges containing u or v ) from G .Again, clearly, Edge Reduction is correct, i.e., G has a d.i.m. if and only if the reducedsubgraph G ′ has a d.i.m.The subsequent notions and observations lead to some possible reductions (some ofthem are mentioned e.g. in [3, 4, 5]). Observation 1 ([3, 4, 5]) . Let M be a d.i.m. of G . ( i ) M contains at least one edge of every odd cycle C k +1 in G , k ≥ , and exactly oneedge of every odd cycle C , C , C in G . ( ii ) No edge of any C can be in M . ( iii ) For each C either exactly two or none of its edges are in M . roof. See e.g. Observation 2 in [4].In what follows, we will also refer to Observation 1 ( i ) (with respect to C ) as to the triangle-property , and to Observation 1 ( ii ) as to the C -property .Since by Observation 1 ( i ), every triangle contains exactly one M -edge, and the pair-wise distance of M -edges is at least 2, we have: Corollary 1. If G has a d.i.m. then G is K -free. Assumption 1.
From now on, by Corollary 1, we assume that the input graph is K -free(else it has no d.i.m.).Clearly, it can be checked (directly) in polynomial time whether the input graph is K -free.By Observation 1 ( i ) with respect to C and the distance property, we have the fol-lowing: Observation 2.
The mid-edge of any diamond in G and the two peripheral edges of anyinduced butterfly are forced edges of G . Assumption 2.
From now on, by Observation 2, we assume that the input graph is(diamond,butterfly)-free.In particular, we can apply the Edge Reduction to each mid-edge of any induced dia-mond and to each peripheral edge of any induced butterfly; that can be done in polynomialtime.Here is an example for excluded edges: By Observation 1 ( i ), there is exactly one M -edge in the C ( v , v , v ). Since G is K - and diamond-free, every vertex v / ∈ { v , v , v } which contacts the C ( v , v , v ) has exactly one neighbor in ( v , v , v ).A paw has four vertices, say v , v , v , v such that v , v , v induce a C and v contactsexactly one vertex in v , v , v , say v v ∈ E . Thus, the edge v v ∈ E is excluded. M -edge xy in a P Based on [5], we first describe some general structure properties for the distance levels ofan edge in a d.i.m. M of G . Since G is ( K ,diamond,butterfly)-free, we have: Observation 3.
For every vertex v of G , N ( v ) is the disjoint union of isolated verticesand at most one edge. Moreover, for every edge uv ∈ E , there is at most one commonneighbor of u and v . Since it is trivial to check whether G has a d.i.m. M with exactly one edge, from nowon we can assume that | M | ≥ dist G ( a, b ) between two vertices a, b in graph G is the numberof edges in a shortest path in G between a and b . Theorem 2 ([1]) . Every connected P t -free graph G = ( V, E ) admits a vertex v ∈ V suchthat dist G ( v, w ) ≤ (cid:4) t/ (cid:5) for every w ∈ V .
5e call such a vertex v a central vertex; more exactly, a central vertex in G has shortestdistance to every other vertex in G . Theorem 2 implies that every connected P -free graph G admits a central vertex v ∈ V such that dist G ( v, w ) ≤ w ∈ V . For a centralvertex v and a neighbor u of v , i.e., uv ∈ E , let N i ( uv ) := { z ∈ V : dist G ( z, uv ) = i } denote the distance levels of uv , i ≥
1. Then by Theorem 2, for every edge uv ∈ E , wehave N k ( uv ) = ∅ for every k ≥ . (2) Observation 4.
For every central vertex v in G , every edge uv ∈ E is part of a P of G . Proof.
Let v be a central vertex in G , and suppose to the contrary that not every edge uv ∈ E is part of a P of G , say ( u, v, w ) induce a C in G such that uv is not part of a P , i.e., N [ u ] = N [ v ] = { u, v, w } . Clearly, in this case, w has more neighbors than v in G since G itself is no C , i.e., w has a neighbor x with xu / ∈ E and xv / ∈ E (else thereis a diamond or K ). Moreover, w is not part of a triangle with x and y (else there is abutterfly in G ). Then for every vertex y / ∈ { u, v, w } , dist G ( w, y ) < dist G ( v, y ), which is acontradiction.Thus, Observation 4 is shown.Now assume that v is a central vertex in G such that every edge uv ∈ E is part of a P of G . Then one could check for any edge uv ∈ E (with central vertex v ), whether thereis a d.i.m. M of G with uv ∈ M , and one could conclude: Either G has a d.i.m. M with v ∈ V ( M ), or G has no d.i.m. M with v ∈ V ( M ); in particular, in the latter case, if noneof the edges uv is in a d.i.m. then v is white and one can apply the Vertex Reduction to v and in particular remove v .Now assume that x is a central vertex (as in Observation 4), and let xy ∈ M be an M -edge for which there is a vertex r such that { r, x, y } induce a P with edge rx ∈ E .By the assumption that xy ∈ M , we have that x and y are black, and it could lead to afeasible xy -coloring (if no contradiction arises).Let N ( xy ) := { x, y } and for i ≥
1, let N i ( xy ) := { z ∈ V : dist G ( z, xy ) = i } denote the distance levels of xy . Recall (2) which also shows that N ( xy ) = ∅ . We considera partition of V into N i = N i ( xy ), 0 ≤ i ≤
4, with respect to the edge xy (under theassumption that xy ∈ M ). Observation 5. If v ∈ N i for i ≥ then v is an endpoint of an induced P , say withvertices v, v , v , v , v , v such that v , v , v , v , v ∈ { x, y } ∪ N ∪ . . . ∪ N i − and withedges vv ∈ E , v v ∈ E , v v ∈ E , v v ∈ E , v v ∈ E . Analogously, if v ∈ N then v isan endpoint of a corresponding induced P . Proof. If i ≥ P . Thus, assume that v ∈ N . Then v ∈ N and v ∈ N . Recall that y, x, r induce a P . If v r ∈ E then v, v , v , r, x, y induce a6 . Thus assume that v r / ∈ E . Let v ∈ N be a neighbor of v . Now, if v x ∈ E then v, v , v , v , x, r induce a P , and if v x / ∈ E but v y ∈ E then v, v , v , v , y, x induce a P .Analogously, if v ∈ N then v is an endpoint of an induced P (which could be part of the P above). Thus, Observation 5 is shown.Recall that by (1), V = V ( M ) ∪ I is a partition of V where V ( M ) is the set of blackvertices and I is the set of white vertices which is independent.Since we assume that xy ∈ M (and is an edge in a P ), clearly, N ⊆ I and thus: N is an independent set of white vertices. (3)Moreover, no edge between N and N is in M . Since N ⊆ I and all neighbors ofvertices in I are in V ( M ), we have: G [ N ] is the disjoint union of edges and isolated vertices. (4)Let M denote the set of edges uv ∈ E with u, v ∈ N and let S = { u , . . . , u k } denotethe set of isolated vertices in N ; N = V ( M ) ∪ S is a partition of N . Obviously: M ⊆ M and S ⊆ V ( M ) . (5)If for xy ∈ E , an edge e ∈ E is contained in every d.i.m. M of G with xy ∈ M , we saythat e is an xy -forced M -edge, and analogously, if an edge e ∈ E is contained in no d.i.m. M of G with xy ∈ M , we say that e is xy -excluded . The Edge Reduction for forced edgescan also be applied for xy -forced edges (then, in the unsuccessful case, G has no d.i.m.containing xy ), and correspondingly for xy -forced white vertices (resulting from the blackcolor of x and y ), the Vertex Reduction can be applied.Obviously, by (5), we have:Every edge in M is an xy -forced M -edge . (6)Thus, from now on, after applying the Edge Reduction for M -edges, we can assumethat V ( M ) = ∅ , i.e., N = S = { u , . . . , u k } . For every i ∈ { , . . . , k } , let u ′ i ∈ N denote the M -mate of u i (i.e., u i u ′ i ∈ M ). Let M = { u i u ′ i : 1 ≤ i ≤ k } denote the set of M -edges with one endpoint in S (and the other endpoint in N ). Obviously, by (5) andthe distance condition for a d.i.m. M , the following holds:No edge with both ends in N and no edge between N and N is in M. (7)As a consequence of (7) and the fact that every triangle contains exactly one M -edge(recall Observation 1 ( i )), we have:For every C abc with a ∈ N , and b, c ∈ N , bc ∈ M is an xy -forced M -edge . (8)This means that for the edge bc , the Edge Reduction can be applied, and from nowon, we can assume that there is no such triangle abc with a ∈ N and b, c ∈ N , i.e., forevery edge uv ∈ E in N : N ( u ) ∩ N ( v ) ∩ N = ∅ . (9)According to (5) and the assumption that V ( M ) = ∅ (recall N = { u , . . . , u k } ), let:7 one := { t ∈ N : | N ( t ) ∩ N | = 1 } , T i := T one ∩ N ( u i ), 1 ≤ i ≤ k , and S := N \ T one .By definition, T i is the set of private neighbors of u i ∈ N in N (note that u ′ i ∈ T i ), T ∪ . . . ∪ T k is a partition of T one , and T one ∪ S is a partition of N . Lemma 1 ([5]) . The following statements hold: ( i ) For all i ∈ { , . . . , k } , T i ∩ V ( M ) = { u ′ i } . ( ii ) For all i ∈ { , . . . , k } , T i is the disjoint union of vertices and at most one edge. ( iii ) G [ N ] is bipartite. ( iv ) S ⊆ I , i.e., S is an independent subset of white vertices. ( v ) If a vertex t i ∈ T i sees two vertices in T j , i = j , i, j ∈ { , . . . , k } , then u i t i ∈ M isan xy -forced M -edge. Proof. ( i ): Holds by definition of T i and by the distance condition of a d.i.m. M .( ii ): Holds by Observation 3.( iii ): Follows by Observation 1 ( i ) since every odd cycle in G must contain at least one M -edge, and by (7).( iv ): If v ∈ S := N \ T one , i.e., v sees at least two M -vertices then clearly, v ∈ I , andthus, S ⊆ I is an independent subset (recall that I is an independent set).( v ): Suppose that t ∈ T sees a and b in T . If ab ∈ E then u , a, b, t would induce adiamond in G . Thus, ab / ∈ E and now, u , a, b, t induce a C in G ; by Observation 1 ( ii ),no edge in the C is in M , and by (7), the only possible M -edge for dominating t a, t b is u t , i.e., t = u ′ .By Lemma 1 ( iv ) and the Vertex Reduction for the white vertices of S , we can assume:(A1) S = ∅ , i.e., N = T ∪ . . . ∪ T k .By Lemma 1 ( v ), we can assume:(A2) For i, j ∈ { , . . . , k } , i = j , every vertex t i ∈ T i has at most one neighbor in T j .In particular, if for some i ∈ { , . . . , k } , T i = ∅ , then there is no d.i.m. M of G with xy ∈ M , and if | T i | = 1, say T i = { t i } , then u i t i is an xy -forced M -edge. Thus, we canassume:(A3) For every i ∈ { , . . . , k } , | T i | ≥ t ∈ T i , 1 ≤ i ≤ k , is an out-vertex of T i if it is adjacent tosome vertex of T j with j = i , or it is adjacent to some vertex of N , and t is an in-vertex of T i otherwise.For finding a d.i.m. M with xy ∈ M , one can remove all but one in-vertices; thatcan be done in polynomial time. In particular, if there is an edge between two in-vertices t t ∈ E , t , t ∈ T i , then either t or t is black, and thus, T i is completely colored. Thus,let us assume: 8A4) For every i ∈ { , . . . , k } , T i has at most one in-vertex. Lemma 2.
Assume that G has a d.i.m. M with xy ∈ M . Then: ( i ) For every i = j , there are at most two edges between T i and T j . ( ii ) If there are two edges between T i and T j , say t i t j ∈ E and t ′ i t ′ j ∈ E for t i , t ′ i ∈ T i and t j , t ′ j ∈ T j , t i = t ′ i , t j = t ′ j , then every vertex in ( T i ∪ T j ) \ { t i , t j , t ′ i , t ′ j } is white. Proof. ( i ): Suppose to the contrary that there are three edges between T and T , say t t ∈ E , t ′ t ′ ∈ E , and t ′′ t ′′ ∈ E for t i , t ′ i , t ′′ i ∈ T i , i = 1 ,
2. By (A2), t i , t ′ i , t ′′ i are distinct.Then t is black if and only if t is white, t ′ is black if and only if t ′ is white, and t ′′ isblack if and only if t ′′ is white. Without loss of generality, assume that t is black, and t is white. Then t ′ is white, and t ′ is black, but now, t ′′ and t ′′ are white, which is acontradiction.( ii ): Let t t ∈ E , t ′ t ′ ∈ E , be two such edges between T and T . By (A2), t = t ′ , and t = t ′ . Then again, t or t ′ is black as well as t or t ′ is black, and thus, every othervertex in T or T is white.Thus Lemma 2 is shown.By Lemma 2 ( i ), we can assume:(A5) For i, j ∈ { , . . . , k } , i = j , there are at most two edges between T i and T j .Recall that | T i | ≥
2. If there is an edge in T i , say ab ∈ E with a, b ∈ T i and there is athird vertex c ∈ T i then either a or b is black, and thus, by Lemma 1 ( i ), c is forced to bewhite, and by the Vertex Reduction and by Lemma 2 ( ii ), we can assume:(A6) If there is an edge in T i then | T i | = 2. Analogously, if there are two edges between T i and T j then | T i | = 2 and | T j | = 2.Then let us introduce the following forcing rules (which are correct). Since no edge in N is in M (recall (7)), we have:(R1) All N -neighbors of a black vertex in N must be colored white, and all N -neighborsof a white vertex in N must be colored black.Moreover, we have:(R2) Every T i , i ∈ { , . . . , k } , should contain exactly one vertex which is black. Thus, if t ∈ T i is black then all the remaining vertices in T i \ { t } must be colored white.(R3) If all but one vertices of T i , 1 ≤ i ≤ k , are white and the final vertex t ∈ T i is notyet colored, then t must be colored black.Since no edge between N and N is in M (recall (7)), we have:(R4) For every edge st ∈ E with t ∈ N and s ∈ N , s is white if and only if t is blackand vice versa. 9ubsequently, for checking if G has a d.i.m. M with xy ∈ M , we consider the cases N = ∅ and N = ∅ .Then let us introduce the following recursive algorithm which formalizes the approachwe will adopt to check if G has a d.i.m. Algorithm DIM( G )Input. A connected P - and ( K ,diamond,butterfly)-free graph G = ( V, E ). Output.
A d.i.m. of G or the proof that G has no d.i.m.(A) Compute a central vertex, say x , of G such that dist G ( x, u ) ≤ u ∈ V andevery edge xy ∈ E is part of a P of G .(B) For each edge xy ∈ E of G [contained in a P of G ] do:(B.1) compute the distance levels N i with respect to xy and apply the reduction stepsas shown above: if no contradiction arose and if assumptions (A1)-(A6) hold,then go to Step (B.2), else take another edge with x ;(B.2) check if G has a d.i.m. M with xy ∈ M ; if yes , then return it, and STOP.(C) Apply the Vertex Reduction to x [and in particular remove x ]; let G ′ denote theresulting graph, where the neighbors of x in G are colored by black; if G ′ is discon-nected, then execute Algorithm DIM( H ) for each connected component H of G ′ ;otherwise, go to Step (B), with G := G ′ .(D) Return “ G has no d.i.m.” and STOP.Then, by the above, Algorithm DIM( G ) is correct and can be executed in polynomialtime as soon as Step (B.2) can be so.Then in what follows let us try to show that Step (B.2) can be solved in polynomialtime, with the agreement that G is ( K ,diamond,butterfly)-free and enjoys assumptions(A1)-(A6): in particular recall (2) that N k = ∅ for k ≥ N = ∅ and N = ∅ . Let A xy := { x, y } ∪ N ∪ N ∪ N , andrecall N = V \ A xy . N = ∅ In this section, we show that for the case N = ∅ , one can check in polynomial timewhether G has a d.i.m. M with xy ∈ M ; we consider the feasible xy -colorings for G [ A xy ].Recall that for every edge uv ∈ M , u and v are black, for I = V ( G ) \ V ( M ), every vertexin I is white, N = S = { u , . . . , u k } and all u i , 1 ≤ i ≤ k , are black, T i = N ( u i ) ∩ N ,and recall assumptions (A1)-(A6) and rules (R1)-(R4). In particular, by (A1), S = ∅ ,i.e., N = T ∪ . . . ∪ T k .Clearly, in the case N = ∅ , all the components of G [ S ∪ N ] can be independentlycolored. Every component with at most three S -vertices has a polynomial number offeasible xy -colorings. Thus, we can focus on components K with at least four S -vertices.A P ( u, v ) in G [ N ] is isolated in G [ N ] if it is not part of a P in G [ N ].10 laim 1. If every P in component K in G [ S ∪ N ] is isolated then K has at most three S -vertices. Proof.
Suppose to the contrary that K has at least four S -vertices, say u , u , u , u , andwithout loss of generality, assume that T contacts T and T , say t ′ t ∈ E and t ′ t ∈ E for t ′ ∈ T , t , t ′ ∈ T , and t ∈ T . By the isolated edges, ( u , t ′ , t , u , t ′ , t , u ) inducea P . Case 1. T contacts T or T .Without loss of generality, assume that T contacts T , i.e., there is a t ∈ T whichcontacts a vertex in T . Clearly, t t / ∈ E since t ′ t ∈ E is isolated. Then t ′ t / ∈ E fora second vertex t ′ ∈ T , and clearly, t ′ and t do not contact the edges t ′ t and t ′ t butthen ( u , t ′ , t , u , t ′ , t , u , t ′ , t ) induce a P , which is a contradiction. Case 2. T contacts T but does not contact T and T .Let t ∈ T contact T . Clearly, by the isolated edges, t does not contact t , t ′ ∈ T .Thus assume that t ′′ t ∈ E for a third vertex t ′′ ∈ T . By (A3), there is a second vertex t ′ ∈ T and a second vertex t ′ ∈ T , and clearly, t t ′ / ∈ E , t t ′ / ∈ E and t ′ does not contact T and t ′ does not contact t ′ , t ′′ ∈ T . But then ( t ′ , u , t , t ′′ , u , t ′ , t , u , t ′ ) induce a P ,which is a contradiction.Thus, Claim 1 is shown.From now on, we can assume that there is at least one P with contact between T i and T i +1 in K . Claim 2.
For any P ’s ( a, b, c ) and ( d, e, f ) in G [ N ] such that d, e, f are not in the T i ’sof a, b, c , there is an edge between { a, b, c } and { d, e, f } . Proof.
Suppose to the contrary that there is no such edge between the P ’s ( a, b, c ) and( d, e, f ) in G [ N ]. From Lemma 1 ( ii ), a, b, c are in at least two T i ’s; assume that a ∈ T .Then, by Lemma 1 ( v ) and since ab ∈ E , bc ∈ E , we have c / ∈ T ; let c ∈ T , i.e., u c / ∈ E .Then either b / ∈ T or b / ∈ T ; without loss of generality, let b / ∈ T . Analogously, since d, e, f are not in T ∪ T , assume that d ∈ T and e, f / ∈ T .Let P be any induced path in G between u and u through N ∪ { x, y } . Then thesubgraph of G induced by ( c, b, a, u ), P , and ( u , d, e, f ) contains an induced P , whichis a contradiction. Thus, Claim 2 is shown.For a P P = ( a, b, c, d, e ) in G [ N ] with a ∈ T i and b, c, d, e / ∈ T i , vertex a is a special P -endpoint of P in G [ N ]. Claim 3.
There is no P ( a, b, c, d, e ) in G [ N ] with special P -endpoint a . Proof.
Suppose to the contrary that ( a, b, c, d, e ) is a P in G [ N ] with special P -endpoint a ∈ T i and b, c, d, e / ∈ T i . But then by Observation 5, vertex a is the midpoint of a P ,which is a contradiction. Thus, Claim 3 is shown. Claim 4. If C = ( t i , u i , t ′ i , t j , t h , t ℓ ) is a C in G [ S ∪ N ] with exactly one vertex u i ∈ S and t i , t ′ i ∈ T i , t j ∈ T j , t h ∈ T h , t ℓ ∈ T ℓ (possibly j = h or h = ℓ ) then t j and t ℓ are xy -forced to be black, i.e., u j t j and u ℓ t ℓ are xy -forced M -edges, and thus, T j and T ℓ arecompletely colored. roof. By (7), no edge in N is in M . By Observation 1 ( iii ), either exactly two or noneof the edges in C are in M . Since C has exactly one vertex u i ∈ S , u i t i and u i t ′ i are theonly edges of C which are not in N , and clearly, either u i t i / ∈ M or u i t ′ i / ∈ M . Thus, byObservation 1 ( iii ), no edge in C is in M , i.e., t i and t ′ i are white, and t j as well as t ℓ are xy -forced to be black. Thus, Claim 4 is shown.After the Edge Reduction step, we can assume that there is no such C in G [ S ∪ N ],i.e., every C in G [ S ∪ N ] has either two vertices of S or none of it. Claim 5. If C is a C in G [ S ∪ N ] then C has exactly two vertices in S , say C =( t i , u i , t ′ i , t j , u j , t ′ j , t h ) , and then t h is xy -forced to be black, i.e., u h t h is an xy -forced M -edge. Proof.
Let C be a C in G [ S ∪ N ]. Recall that by Lemma 1 ( iii ), there is no C in G [ N ]. Thus, | V ( C ) ∩ S | ≥
1, and clearly, by (A1), no vertex in V ( C ) ∩ N contacts twovertices in V ( C ) ∩ S , i.e., | V ( C ) ∩ S | ≤ S -vertex in a C in G [ N ], say C = ( t , u , t ′ , t , t ′ , t ′′ , t ′′′ )with t , t ′ ∈ T then t , t ′ , t ′′ , t ′′′ / ∈ T , but now, ( t ′ , t , t ′ , t ′′ , t ′′′ ) induce a P with special P -endpoint t ′ ∈ T such that t , t ′ , t ′′ , t ′′′ / ∈ T , which is a contradiction to Claim 3.Now assume that C = ( t , u , t ′ , t , u , t ′ , t ) is a C in G [ S ∪ N ]. Suppose to thecontrary that t is white. Then t and t ′ are black which implies that t ′ and t are white,which is a contradiction since t ′ t ∈ E . Thus, t is xy -forced to be black, i.e., u t is an xy -forced M -edge, and Claim 5 is shown.After the Edge Reduction step, we can assume that there is no C in G [ S ∪ N ]. Claim 6.
If there is a C C in G [ S ∪ N ] then | V ( C ) ∩ S | = 3 , say V ( C ) ∩ S = { u , u , u } , and for the component K in G [ S ∪ N ] containing C , we have K = G [ { u , u , u } ∪ T ∪ T ∪ T ] . Proof.
Let C be a C in G [ S ∪ N ]. Recall that by Lemma 1 ( iii ), there is no C in G [ N ], i.e., | V ( C ) ∩ S | ≥
1, and clearly, | V ( C ) ∩ S | ≤ C contains only one S -vertex then, as in the proof of Claim 5, it leads to a P in N with corresponding special P -endpoint, which is a contradiction to Claim 3. Thus, | V ( C ) ∩ S | ≥ | V ( C ) ∩ S | = 2. If C = ( t , u , t ′ , t , u , t ′ , t , t , t ) (possibly t , t ∈ T or t , t ∈ T ) then this leads to a P ( t ′ , t , t , t , t ) with special P -endpoint t , which is a contradiction to Claim 3. If C = ( t , u , t ′ , t , t , u , t ′ , t , t ) then t is xy -forced to be black: Suppose to the contrary that t is white. Then t ′ and t areblack, which implies that t and t ′ are white, but now, t and t are black, which is acontradiction since there is no M -edge in N . Thus, u t is an xy -forced M -edge, andafter the Edge Reduction, | V ( C ) ∩ S | = 2 is impossible.Thus, | V ( C ) ∩ N | = 3; let C = ( t , u , t ′ , t , u , t ′ , t , u , t ′ ) be a C with three such S -vertices u , u , u . Suppose to the contrary that there is a vertex t ∈ T which contacts C , say t ′ t ∈ E . Clearly, by Lemma 1 ( v ), t t / ∈ E . Since ( u , t ′ , t , u , t ′ , t , u , t ′ , t ) donot induce a P , we have t t ′ ∈ E or t t ∈ E or t t ′ ∈ E .If t t ′ ∈ E then ( t , t ′ , t , t ′ , t ) would induce a P in N with special P -endpoint t ,which is impossible by Claim 3. Similarly, if t t ′ ∈ E then ( t , t ′ , t , t ′ , t ) would inducea P in N with special P -endpoint t , which is a contradiction to Claim 3.12hus, t t ∈ E which leads to a C ( t , u , t ′ , t , u , t ′ , t ). But then, by Claim 5, t is xy -forced to be black, i.e., u t is an xy -forced M -edge, and after the Edge Reduction,there is no such C . Thus, Claim 6 is shown. Corollary 2.
Every component in G [ S ∪ N ] with at least four S -vertices is C -free. Lemma 3.
In the case N = ∅ , for every component K in G [ S ∪ N ] , a complete coloringof K (if there is no contradiction) can be done in polynomial time. Proof.
For finding a complete feasible xy -coloring of component K (or a contradiction),we first use Vertex Reduction and Edge Reduction as in the previous results.Let V ( K ) ∩ N = T ∪ . . . ∪ T h (recall that h ≥ xy -coloring of K can be done in polynomial time). Clearly, for every i , 1 ≤ i ≤ h , we have | T i | ≥ T i in K would have only one out-vertex t i ∈ T i , then the procedure starts byfixing a coloring of T ; for every i , 1 ≤ i ≤ h , there are only two possible colorings of T i since by (A4), every T i has at most one in-vertex. If the already colored out-vertex t i ∈ T i with contact to t i +1 ∈ T i +1 is white then t i +1 is black, the in-vertex of T i +1 is white, and T i +1 is completely colored. Analogously, if t i is black then t i +1 is white, the in-vertex of T i +1 is black, and T i +1 is completely colored.Thus, we can assume that there is a T i with at least two out-vertices (such that at leastone of them is white). In this case, the procedure starts by fixing a coloring of T withat least two out-vertices (this can be repeated for all | T | colorings of T ) and applies theforcing rules, and then the next step of the procedure is using a white out-vertex t ∈ T ,say with contact to T , such that the neighbor t ∈ T of t is black. If t contacts only T then t does not play any role for the procedure. If t contacts some T j , j = 1 ,
2, theproblem is how T j can be completely colored.Now we can assume that every black out-vertex (which was already colored by a whiteneighbor in the previous step) contacts at least two T i ’s, say, t ∈ T was colored blackby a white vertex t ′ ∈ T with t ′ t ∈ E (i.e., T was already colored), and t t ∈ E for t ∈ T but T is not yet completely colored. Then t is white, and if t t ′ ∈ E for another t ′ ∈ T then t ′ is black and T is completely colored. Thus assume that t t ′ / ∈ E for any t ′ ∈ T . If t is the only out-vertex in T then the in-vertex is black (recall that by (A4),every T i has at most one in-vertex) and T is completely colored. Thus assume that t ′ isan out-vertex, say t ′ t ∈ E for t ∈ T . We first show: Claim 7.
If there is any contact between the P ( t ′ , t , t ) and the P ( t ′ , t ) then T iscompletely colored.Proof. Clearly, t t ′ / ∈ E , t t / ∈ E , and t t ′ / ∈ E . If t ′ t ′ ∈ E then t ′ is black and T iscompletely colored. Thus assume that t ′ t ′ / ∈ E . If t t ∈ E then t is white and thus, t ′ is black and T is completely colored. Thus assume that t t / ∈ E .Finally, if t ′ t ∈ E then ( t ′ , t , t , u , t ′ , t ) induce a C , which is impossible by Claim 4and the Edge Reduction.Thus, T is completely colored.Now we assume: ( t ′ , t , t ) (cid:13) ( t ′ , t ) . u , t ′ , t , t , u , t ′ , t , u ) induce a P in G . Clearly, | T | ≥ | T | ≥ t ∈ T be a second vertex in T and t ′ ∈ T be a second vertex in T . Claim 8. If t t ′ / ∈ E then T is completely colored.Proof. If t t ′ / ∈ E then clearly, t ′ t ′ / ∈ E . Since ( u , t ′ , t , t , u , t ′ , t , u , t ′ ) do not inducea P in G , we have t ′ t ′ ∈ E or t t ′ ∈ E or t t ′ ∈ E . If t t ′ ∈ E then | T | = 2 (recall(A6)) and T is completely colored. Thus assume that t t ′ / ∈ E . Now, if t t ′ ∈ E then ( t , t , u , t ′ , t , u , t ′ ) induce a C , which is impossible by Claim 5 and the EdgeReduction. Thus, t t ′ / ∈ E which implies that t ′ t ′ ∈ E . But now, since t ′ is white, t ′ isblack, t is white, t ′ is black, and T is completely colored.From now on, we assume: t t ′ ∈ E. Case 1. t t ′ ∈ E .Then t is black. By Claim 2, ( t , t ′ , t ) and ( t ′ , t , t ′ ) do not induce a 2 P . Recall that( t , t ′ ) and ( t ′ , t ) induce a 2 P . Thus, t should contact ( t ′ , t , t ′ ) or t ′ should contact( t , t ′ , t ).If t ′ t ′ ∈ E then t ′ is black, t is white, t ′ is black, and T is completely colored. Thusassume t ′ t ′ / ∈ E . Analogously, if t t ∈ E then t is white, and t ′ is black, and T iscompletely colored. Thus assume t t / ∈ E .If t t ∈ E then clearly, t t ′ / ∈ E , and if t t / ∈ E but t t ′ ∈ E then ( t , t ′ , t , t , u , t ′ )induce a C which is impossible by Claim 4 and the Edge Reduction. Thus, assume that t t ′ / ∈ E .If t t ′ ∈ E then ( t , t , u , t ′ , t , t ′ ) induce a C which is impossible by Claim 4 andthe Edge Reduction. Thus, assume that t t ′ / ∈ E .Now, t t ′ ∈ E is the only possible edge between ( t , t ′ , t ) and ( t ′ , t , t ′ ) but now,( t , t ′ , t , t ′ , t ) induce a P with special endpoint t , which is impossible by Claim 3.Thus, in Case 1, T is completely colored. Case 2. t t ′ / ∈ E .Recall that t ′ and t are white and ( t ′ , t , t ) (cid:13) ( t ′ , t ). Clearly, t t / ∈ E , and since( t , u , t ′ , t , t , u , t ′ , t , u ) do not induce a P in G , we have t t ∈ E or t t ′ ∈ E or t t ∈ E .If t t ′ ∈ E then clearly, t t / ∈ E . But then ( t , u , t ′ , t , t , u , t ′ ) induce a C , whichis impossible by Claim 5 and the Edge Reduction. Thus, assume t t ′ / ∈ E and either t t ∈ E or t t ∈ E . Case 2.1 t t / ∈ E .Then t t ∈ E . First assume that t is white, which implies that t is black, and thereis a black vertex t ′′ ∈ T . Clearly, t ′′ t / ∈ E , t ′′ t ′ / ∈ E , t ′′ t / ∈ E , and since t is black,we have t ′′ t / ∈ E . Since ( t ′′ , u , t ′ , t , t , u , t ′ , t , u ) do not induce a P in G , we have t ′′ t ∈ E or t ′′ t ′ ∈ E .If t ′′ t ′ ∈ E then t ′′ t / ∈ E , but now ( t ′′ , u , t ′ , t , t , u , t ′ ) induce a C , which isimpossible by Claim 5 and the Edge Reduction. Thus, assume t ′′ t ′ / ∈ E which implies t ′′ t ∈ E . But now ( t ′′ , u , t , t , t ′ , u , t ) induce a C , which is impossible by Claim 5 andthe Edge Reduction. 14hus t is black which implies that t is white, t ′ is black, T is completely colored,and Case 2.1 is done. Case 2.2 t t ∈ E .Since t is white, t is black. Clearly, since t t ∈ E , we have t t ′ / ∈ E . If t t ∈ E then t is white and thus, t ′ is black and T is completely colored. Thus, assume that t t / ∈ E .If | T | ≥ t ′′ ∈ T be a second white vertex in T . Then t ′′ t / ∈ E , and Case 2.1applies for t ′′ ∈ T . Thus we have | T | = 2 . Next assume that the black out-vertex t has a second white neighbor, say t ∈ T with t t ∈ E . Since ( t , t , t , t , t ′ ) do not induce a P with special endpoint t (recallClaim 3), we have t t ∈ E . Recall that t ′ t ′ / ∈ E (else T is completely colored) and t t ′ / ∈ E (else ( t , t , u , t ′ , t , t ′ ) induce a C which is impossible by Claim 4 and theEdge Reduction).Since ( t ′ , t , t ) and ( t ′ , t , t ′ ) do not induce a 2 P (recall Claim 2), we have t t ′ ∈ E or t t ∈ E or t t ′ ∈ E . If t t ′ ∈ E or t t ′ ∈ E then t ′ is black and T is completelycolored. Thus assume that t t ∈ E . But now, ( t , t , t , u , t ′ , t ) induce a C which isimpossible by Claim 4 and the Edge Reduction. Thus, t has only one white neighbor,namely t .Next we show: Claim 9. t ′ is no out-vertex.Proof. Suppose to the contrary that t ′ t ∈ E for some t ∈ T . Recall that t does notcontact t ′ , t , t . Since t ′ is white (else T is completely colored), t ′ does not contact t ′ , t , and recall that t ′ t / ∈ E (else ( t , t , u , t ′ , t , t ′ ) induce a C , which is impossibleby Claim 4 and the Edge Reduction).Recall that ( t ′ , t , t ) and ( t , t ′ , t ) do not induce a 2 P . Thus, since t and t ′ donot contact ( t ′ , t , t ), only t could contact ( t ′ , t , t ). Since t and t are black, we have t t / ∈ E . If t t ∈ E then clearly, t t ′ / ∈ E but then ( t , u , t ′ , t , t ′ , t ) induce a C , whichis impossible by Claim 4 and the Edge Reduction. Thus, t t / ∈ E . Now, if t t ′ ∈ E then( t , t , t , t ′ , t ) induce a P with special endpoint t , which is a contradiction by Claim 3.Thus t t ′ / ∈ E , t t / ∈ E , and t t / ∈ E . But then ( t ′ , t , t ) and ( t , t ′ , t ) induce a2 P , which is a contradiction by Claim 2. Thus, Claim 9 is shown.This implies that t is the only out-vertex in T .Next we show: Claim 10.
The black vertex t contacts only one T i (namely T ) which is not yet completelycolored.Proof. Suppose to the contrary that t contacts a second T i (apart from T ) which isnot yet completely colored. Then T i = T since by the above T = { t , t ′ } and t isnonadjacent to t , t ′ . Then say T i = T , i.e., t contacts T with t t ∈ E . Note that t does not contact T (else T is completely colored) and does not contact T (else, byClaim 9, t t ∈ E and then vertices t , t , u , t ′ , t , t would induce a C according to15laim 4). Since T is not yet completely colored, T is not contacted by t ′ and t , andfurthermore (similarly to the above with respect to T ) there is an out-vertex of T say t ′ ∈ T (nonadjacent to t ). Note that t ′ does not contact T (else, say t ′ t ′′ ∈ E with t ′′ ∈ T , vertices t , t , u , t ′′ , t ′ , u , t induce a C in G [ S ∪ N ]) and does not contact T (else, by Claim 9, t ′ t ∈ E and then vertices u , t ′ , t , t , u , t ′ , t , t ′ , u induce a P ).Then vertices t ′ , u , t , t , t , u , t ′ , t , t ′ induce a P , which is a contradiction.Thus, Claim 10 is shown.Finally we show: Claim 11.
There is only one black vertex which contacts a T i which is not yet completelycolored.Proof. Suppose to the contrary that there are two such black vertices, say t which contacts T and t which contacts T such that T , T are not yet completely colored. By Claim 10, t does not contact T and t does not contact T . If t ′ = t ′ then clearly, the P ’s ( t ′ , t , t )and ( t ′ , t , t ) do not induce a 2 P but t t / ∈ E and t t / ∈ E . Thus, t ′ t ∈ E or t ′ t ∈ E ,say without loss of generality, t ′ t ∈ E but now, ( t , t , t ′ , t , t ) induce a P with specialendpoint t , which is a contradiction to Claim 3. Analogously, if t ′ = t ′ , it leads to thesame contradiction. Thus, Claim 11 is shown.In general, if t does not completely color T then we can add a possible coloring of T which leads to a complete coloring of every neighbor T i of T . Since G is P -free, Case 2.2appears only once in component K .Thus, Lemma 3 is shown. N = ∅ Recall A xy := { x, y } ∪ N ∪ N ∪ N and N = ∅ . In the case N = ∅ , we show that onecan check in polynomial time whether G has a d.i.m. M with xy ∈ M . Clearly, again inthe case N = ∅ , all the components of G [ S ∪ N ∪ N ] can be independently colored.Recall Observation 5; if t ∈ N then t is an endpoint of a corresponding induced P in { x, y } ∪ N ∪ S ∪ N . If there is a P ( t, a, b, c, d ) with endpoint t and four vertices a, b, c, d ∈ N (such that only one of them, say a contacts t ) then t is the midpoint of a P in G , which is a contradiction. Analogously, if there is a P ( t, a, b, c, t ′ ) with t, t ′ ∈ N such that t and t ′ are in distinct T i ’s then t is the midpoint of a P in G , which is acontradiction. This argument is used in some of the next proofs. Proposition 1.
If the colors of all vertices in G [ A xy ] are fixed then the colors of allvertices in N are forced. Proof.
Let v ∈ N and let w ∈ N be a neighbor of v . Since by (7), every edge between N and N is xy -excluded, we have: If w is white then v is black, and if w is black then v is white.Let K be a nontrivial component of G [ S ∪ N ∪ N ]. Clearly, K can have severalcomponents in G [ S ∪ N ] which are connected by some N -vertices. K can be feasiblycolored (if there is no contradiction) by starting with a component in G [ S ∪ N ] or witha component in G [ N ] which is part of K . 16ecall (8) and (9) for the fact that after the Edge Reduction, there is no trianglebetween N and N with exactly one vertex in N , and for every edge uv in G [ N ], u and v have no common neighbor in N . Moreover, for N -vertices which are isolated in N ,we have:If v ∈ N with N ( v ) ∩ N = ∅ then v is white . (10)Thus, after the Vertex Reduction, we can assume that every vertex in N has a neighborin N , i.e., every component in G [ N ] has at least one edge.Similarly, we have: Claim 12. If v, w ∈ N with vw ∈ E is an N -isolated edge in G [ N ] then vw is an xy -forced M -edge, i.e., v and w are black. Proof.
Let v, w ∈ N with vw ∈ E such that v and w do not have any other neighbors in N . Clearly, since vw ∈ E , at least one of v and w is black, say v is black. If w is whitethen v needs a black M -mate in N since by (7), there is no M -edge between N and N .But since vw is N -isolated, there is no such M -mate of v , i.e., w is black. Thus, Claim 12is shown.Thus, after the Edge Reduction, there is no such N -isolated edge in N .By the way, there are possible contradictions: For instance, if for an N -isolated edge vw , v or w contacts a black vertex in N then there is no d.i.m. with xy ∈ M . Analogously,if vt ∈ E for t ∈ N and wt ′ ∈ E for t ′ ∈ N and tt ′ ∈ E (i.e., ( t, v, w, t ′ ) induce a C ) thenthere is no d.i.m. with xy ∈ M . Claim 13. If t ∈ T i , t ′ ∈ T j (possibly i = j ), and a, b, c ∈ N induce a C C = ( t, a, b, t ′ , c ) in G [ N ∪ N ] then ab is an xy -forced M -edge. Proof.
Let C = ( t, a, b, t ′ , c ) be a C in G [ N ∪ N ]. Then the edges ta, tc, t ′ b, t ′ c are edgesbetween N and N . By Observation 1 ( i ), every C has exactly one M -edge, and by (7),no edge between N and N is in M . Thus, ab is an xy -forced M -edge, and Claim 13 isshown.In general, for any C in G [ N ∪ N ] with exactly one edge in G [ N ], this edge is xy -forced as an M -edge. After the Edge Reduction step, we can assume that there is nosuch C in G [ N ∪ N ] with exactly one edge in G [ N ]. Corollary 3. If ab ∈ E for a, b ∈ N and at ∈ E , bt ′ ∈ E for t, t ′ ∈ N , t = t ′ , such that ( t, a, b, t ′ ) induce a P in G then there is no common neighbor c ∈ N of t and t ′ . Proof.
Suppose to the contrary that there is such a common neighbor c ∈ N with tc ∈ E and t ′ c ∈ E . Then ac / ∈ E and bc / ∈ E since there are no triangles ( t, a, c ), ( t ′ , b, c ). Butthen C = ( t, a, b, t ′ , c ) induce a C , which is a contradiction by Claim 13 and the EdgeReduction. Thus, Corollary 3 is shown. Claim 14. If t ∈ T i and a, b, c ∈ N induce a C C = ( t, a, b, c ) then t is black and u i t isan xy -forced M -edge. roof. Let C = ( t, a, b, c ) be a C with exactly one N -vertex t . Suppose to the contrarythat t is white. Then by Observation 1 ( ii ), a and c are black, b is white, and by (7),there are M -mates a ′ ∈ N of a and c ′ ∈ N of c , i.e., aa ′ ∈ M and cc ′ ∈ M . Since G is butterfly-free, b is nonadjacent to at least one vertex of { a ′ , c ′ } , say b is nonadjacentto c ′ without loss of generality by symmetry. By (8) and the Edge Reduction, tc ′ / ∈ E ;let t ′ ∈ N be a neighbor of c ′ , i.e., t ′ c ′ ∈ E . Then t ′ is white (since cc ′ ∈ M ), i.e., t ′ b / ∈ E ; furthermore, by (7), t ′ c / ∈ E . Then, since ( t ′ , c ′ , c, b, a ) do not induce a P (else byObservation 5, t ′ is the midpoint of a P in G ), we have t ′ a ∈ E but now, C = ( t, a, t ′ , c ′ , c )is a C with exactly one edge in N , namely cc ′ . By Claim 13 and the Edge Reduction,we have that there is no such C , i.e., t is black and u i t is an xy -forced M -edge. Thus,Claim 14 is shown.After the Edge Reduction step, we can assume that there is no such C in G [ N ∪ N ]. Corollary 4. ( i ) If ( a, b, c, d ) induce a P in G [ N ] with N -neighbor t of a then ( t, a, b, c, d ) induce a C in G [ N ∪ N ] . ( ii ) If ( a, b, c ) induce a P in G [ N ] with N -neighbor t of a and t ′ of c (clearly, t = t ′ )then either tt ′ ∈ E , i.e., ( t, a, b, c, t ′ ) induce a C in G [ N ∪ N ] , or t, t ′ ∈ T i . Claim 15.
There is no P ( a, b, c ) in G [ N ] with white end-vertices a and c . Proof.
Suppose to the contrary that there is such a P ( a, b, c ) in G [ N ] with white end-vertices a and c , and thus black vertex b . Let t a ∈ T i be an N -neighbor of a , and let t c be an N -neighbor of c . By Claim 14 and the Edge Reduction, t a c / ∈ E and t c a / ∈ E , i.e., t a = t c . Clearly, t a and t c are black, and thus, t c / ∈ T i (and there is no T j with t a , t c ∈ T j ).Moreover, t a t c / ∈ E since both of them are black (recall that by (7), there is no M -edgein N ). But then ( t a , a, b, c, t c ) induce a P , and it leads to a P in G with midpoint t a ,which is a contradiction. Thus, Claim 15 is shown. Corollary 5.
If vertex z in G [ N ] has degree at least in G [ N ] then z is white. Proof.
Suppose to the contrary that there is a black vertex z in G [ N ] with degree atleast 3, say zz i ∈ E , 1 ≤ i ≤
3. Without loss of generality, assume that z is black. Butthen z and z are white, and thus, ( z , z, z ) induce a P with white end-vertices z , z ,which is a contradiction to Claim 15. Thus, Corollary 5 is shown.Thus, after the Vertex Reduction, every vertex in a component of G [ N ] has degree atmost 2 in G [ N ]. For every component D of G [ N ], this leads to feasible colorings of D : Claim 16.
Every component D in G [ N ] is either a P k , ≤ k ≤ , or a C k , k ∈ { , , } ,and D has at most three feasible colorings. Proof.
Recall that after the Vertex Reduction, every vertex in a component D of G [ N ]has degree at most 2 in G [ N ]. If D is cycle-free then, since D contains a P (recall (10)and Claim 12) and G is P -free, D is a P k , 3 ≤ k ≤
8. If D contains a C k C then, since G is P -free, k ≤
9, and since every vertex in C has degree 2, C is no C , C , C , C , sinceevery black vertex in C must have an M -mate in C . Thus, C is either a C , C , or C .Clearly, for a C k , k ∈ { , , } , say C = ( z , . . . , z k ), there are three feasible colorings; for18xample, in a C , if z is white then z and z are white and the remaining vertices areblack, and similarly if z is white or z is white. For induced paths P k , 3 ≤ k ≤
8, say P = ( z , . . . , z k ), there are either one or two feasible colorings; if z is white then z and z are black and thus z is white etc. Thus, it leads to exactly one feasible coloring for P , P , P , P , and for exactly two feasible colorings for P and P . Thus, Claim 16 isshown. Claim 17.
Let ( a, b, c ) be a P in G [ N ] for a, b, c ∈ N . If b is white then all N -neighborsof a, b, c are in the same T i . Proof.
Let t a ∈ N be the neighbor of a , and analogously, let t b , t c be the neighbors of b , c in N . Without loss of generality, let t a ∈ T . Clearly, t a b / ∈ E , t a c / ∈ E , and t c a / ∈ E , t c b / ∈ E . Since b is white, a and c are black, and there are black M -mates a ′ ∈ N of a and c ′ ∈ N of c (recall that by (7), there is no M -edge between N and N ). By Claim 16, a ′ b / ∈ E and c ′ b / ∈ E .Now by Corollary 4 ( i ), t a c ′ ∈ E and t c a ′ ∈ E . Clearly, t a and t c are white, and thus, t a t c / ∈ E . Since ( t a , a, b, c, t c ) do not induce a P with t c / ∈ T (else it leads to a P in G ),we have t c ∈ T .Suppose that t b / ∈ T . Then, since ( t b , b, c, c ′ , t a ) do not induce a P (else there is a P in G with midpoint t a ), we have t b t a ∈ E , and analogously, since ( t b , b, a, a ′ , t c ) do notinduce a P , we have t b t c ∈ E but now, t b / ∈ T contacts two vertices in T , which is acontradiction (recall Lemma 1 ( v )). Thus, t b ∈ T , and Claim 17 is shown. Corollary 6.
For a component D in G [ N ] with P ( a, b, c ) such that b is white, there arethree N -neighbors of D in the same T i such that every vertex of D contacts one of them. Proof. If D is a P ( a ′ , a, b, c, c ′ ) as in the proof of Claim 17 then clearly, there are three N -neighbors of D in the same T i such that every vertex a ′ , a, b, c, c ′ contacts one of them.Clearly, D is P -free. Now assume that there is a neighbor d ∈ N of c ′ (recall thatevery vertex in D has degree at most 2). Clearly, d is white, dc / ∈ E and db / ∈ E . Let t b ∈ N be a neighbor of vertex b . Since ( t b , b, c, c ′ , d ) do not induce a P , by the discussionat the beginning of the section, we have t b d ∈ E . Accordingly, if e ∈ N is a neighbor of d and t c ∈ N is a neighbor of vertex c then, since ( t c , c, c ′ , d, e ) do not induce a P , we have t c e ∈ E etc. Thus, Corollary 6 is shown. Claim 18.
Let D , D be two components in G [ N ] and let a, b ∈ V ( D ) with white vertex a and ab ∈ E as well as c, d ∈ V ( D ) with cd ∈ E . Then c and d are colored black by thewhite vertex a . Proof.
Let t a ∈ T be an N -neighbor of a . Then t a is black, and all other vertices in T are white. Let t c ∈ N be a neighbor of c . Clearly, t a b / ∈ E and t c d / ∈ E , and ab, cd inducea 2 P in G [ N ]. If t c / ∈ T , say t c ∈ T , and t a t c / ∈ E then ( b, a, t a , u ), ( d, c, t c , u ), andthe shortest path in N ∪ { x, y } between u and u lead to a P , which is a contradiction.Thus, either t c ∈ T or t c t a ∈ E which implies that t c is white, and thus, c is black.Analogously, d is colored black by the white vertex a , and Claim 18 is shown. Corollary 7.
There is only one component in G [ N ] . roof. Suppose to the contrary that there are two such components D , D in G [ N ].Clearly, by Claim 12 and the Edge Reduction, D contains a white vertex a ; let ab ∈ E for a, b ∈ V ( D ). As in the proof of Claim 18, let t a ∈ T be an N -neighbor of a whichis black, and all other vertices in T are white, and c and d are black for an edge cd ∈ E , c, d ∈ V ( D ). Clearly, D has at least three vertices; let e be a neighbor of c or d , say de ∈ E . Then e is white, and thus, an N -neighbor t e of e is black, and thus, t e / ∈ T and t a t e / ∈ E ; let t e ∈ T . But now, ( b, a, t a , u ), ( d, e, t e , u ), and the shortest path in N ∪ { x, y } between u and u lead to a P , which is a contradiction. Thus, Corollary 7is shown.Let K be a nontrivial component of G [ S ∪ N ∪ N ], and let Q , . . . , Q ℓ be the compo-nents of K in G [ S ∪ N ] and let D be the component of K in G [ N ]. For each of the (atmost three) feasible colorings of D , it leads to a partial coloring in every Q i since thereis no contact between Q i and Q j , i = j , and thus, there are contacts between Q i and D .Then, as in Section 3, for every Q i , it can be independently checked in polynomial timewhether Q i has a feasible coloring or a contradiction.This finally shows: Theorem 3.
DIM is solvable in polynomial time for P -free graphs. In [9], it is shown that for every graph class of bounded clique-width, the DIM problem canbe solved in polynomial time. However, there are many examples where the clique-widthis unbounded but DIM is solvable in polynomial time; for example, the clique-width of P -free graphs is unbounded. The complexity of DIM is still an open problem for manyexamples. Acknowledgment.
We are grateful to the anonymous referees for their helpful comments.The second author would like to witness that he just tries to pray a lot and is not able todo anything without that - ad laudem Domini.
References [1] G. Bacs´o and Zs. Tuza, A characterization of graphs without long induced paths,
J. Graph Theory
14, 4 (1990) 455-464.[2] N. Biggs, Perfect codes in graphs,
Journal of Combinatorial Theory, Series B
15 (1973) 289-296.[3] A. Brandst¨adt, C. Hundt, and R. Nevries, Efficient Edge Domination on Hole-Free graphs in Poly-nomial Time, Conference Proceedings LATIN 2010,
Lecture Notes in Computer Science P -Free Graphs in Linear Time, Algorithmica
68 (2014) 998-1018.[5] A. Brandst¨adt and R. Mosca, Finding Dominating Induced Matchings in P -Free Graphs in Polyno-mial Time, Algorithmica
77 (2017) 1283-1302.[6] A. Brandst¨adt and R. Mosca, Dominating Induced Matchings in S , , -Free Graphs, CoRRarXiv:1706.09301, 2017. Available online in Discrete Applied Math. [7] A. Brandst¨adt and R. Mosca, Finding Dominating Induced Matchings in S , , -Free Graphs, CoRRarXiv:1706.04894, 2017. Available online in Discrete Applied Math.
8] A. Brandst¨adt and R. Mosca, Finding Dominating Induced Matchings in S , , -Free Graphs, CoRRarXiv:1905.05582, 2019. Accepted for Discrete Applied Math. [9] D.M. Cardoso, N. Korpelainen, and V.V. Lozin, On the complexity of the dominating induced match-ing problem in hereditary classes of graphs,
Discrete Applied Math.
159 (2011) 521-531.[10] D.L. Grinstead, P.L. Slater, N.A. Sherwani, and N.D. Holmes, Efficient edge domination problems ingraphs,
Information Processing Letters
48 (1993) 221-228.[11] A. Hertz, V.V. Lozin, B. Ries, V. Zamaraev, and D. de Werra, Dominating induced matchings ingraphs containing no long claw,
Journal of Graph Theory
88, no. 1 (2018) 18-39.[12] N. Korpelainen, V.V. Lozin, and C. Purcell, Dominating induced matchings in graphs without a skewstar,
J. Discrete Algorithms
26 (2014) 45-55.[13] C.L. Lu, M.-T. Ko, and C.Y. Tang, Perfect edge domination and efficient edge domination in graphs,
Discrete Applied Math.
119 (2002) 227-250.[14] C.L. Lu and C.Y. Tang, Solving the weighted efficient edge domination problem on bipartite permu-tation graphs,
Discrete Applied Math.
87 (1998) 203-211.87 (1998) 203-211.