Vertex Deletion into Bipartite Permutation Graphs

A permutation graph can be defined as an intersection graph of segments whose endpoints lie on two parallel lines \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\ell _1$$\end{document}ℓ1 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\ell _2$$\end{document}ℓ2, one on each. A bipartite permutation graph is a permutation graph which is bipartite. In this paper we study the parameterized complexity of the bipartite permutation vertex deletion problem, which asks, for a given n-vertex graph, whether we can remove at most k vertices to obtain a bipartite permutation graph. This problem is \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathsf {NP}$$\end{document}NP-complete by the classical result of Lewis and Yannakakis [20]. We analyze the structure of the so-called almost bipartite permutation graphs which may contain holes (large induced cycles) in contrast to bipartite permutation graphs. We exploit the structural properties of the shortest hole in a such graph. We use it to obtain an algorithm for the bipartite permutation vertex deletion problem with running time \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(9^k \cdot n^9)$$\end{document}O(9k·n9), and also give a polynomial-time 9-approximation algorithm.


Introduction
Many standard computational problems, including maximum clique, maximum independent set, or minimum coloring, which are NP-hard in general, have polynomial-time exact or approximation algorithms in restricted classes of graphs. Due to the practical and theoretical applications, some of such graph classes are particularly intensively studied. Among them are: The extended abstract of the work was presented on IPEC 2020 [2]. Ł.B., J.N., and K.O. were supported by the project CUTACOMBS that has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme, grant agreement 714704. Their research was partially carried out during the Parameterized Algorithms Retreat of the University of Warsaw, PARUW 2020, held in Krynica-Zdrój in February 2020. T.K. was partially supported by Polish National Science Center (NCN) grant 2015/17/B/ST6/01873. J.N. was supported by the student grant SVV-2020-260578.
Extended author information available on the last page of the article Fig. 1 Hierarchy of inclusions between graph classes considered in the introduction. An arrow from graph class A to graph class B indicates that A ⊂ B interval graphs: intersection graphs of intervals on a real line, proper interval graphs: intersection graphs of intervals none of which is contained in another, chordal graphs: intersection graphs of subtrees of a tree, function and permutation graphs: intersection graphs of continuous and linear functions, respectively, defined on the interval [0, 1], comparability graphs: graphs whose edges correspond to the pairs of vertices comparable in some fixed partial order < on the vertex set (such an order is called a transitive orientation of the graph), co-comparability graphs: the complements of comparability graphs.
It is well known that the class of function graphs corresponds to the class of cocomparability graphs [13], and the class of permutation graphs corresponds to the intersection of comparability and co-comparability graphs [24] (see Fig. 1 for the hierarchy of inclusions). All these classes of graphs are hereditary, which means that they are closed under vertex deletion.
Being hereditary is a very useful property in algorithmic design as every hereditary class of graphs can also be uniquely characterized in terms of minimal forbidden induced subgraphs: a graph belongs to a class G if and only if it does not contain any graph from some family F as an induced subgraph. For every graph class introduced above, a characterization by forbidden subgraphs is known, see [8] for perfect graphs, [19] for interval graphs, [12] for comparability and permutation graphs. However, for all of them, the family of forbidden subgraphs is infinite and it may also be quite complex. Moreover, every graph G from any class introduced above is perfect. Grötschel, Lovász, and Schrijver [14] showed that in the class of perfect graphs the maximum clique, the maximum independent set, and the minimum coloring problems can be solved in polynomial time.
Polynomial-time algorithms devised for the above-mentioned graph classes can sometimes be adjusted to also work on graphs that are "close" to graphs from these classes. Usually, the "closeness" of a graph G to a graph class G is measured by the number of operations required to transform G into a graph from the class G, where a single operation consists either on removing a vertex from G or on adding or removing an edge from G. Such an approach leads us to the following generic problem.
Depending on the kind of modifications allowed, we obtain four variants of this problem: vertex deletion problem, edge deletion problem, edge completion problem, and edge edition problem (the latter allowing both deletions and additions of edges).

Problem:
Graph modification problem into a class of graphs G Input: A g r a p h G (typically not from G) and a number k Question: C a n G be transformed into a graph of the class G by performing ≤ k modifications of an appropriate kind?
For the class of graphs defined above, all four variants of the modification problem are NP-hard-see [22] for references to NP-hardness proofs. In particular, Lewis and Yannakakis [20] showed that the vertex deletion problem into any non-trivial hereditary class of graphs is NP-hard. This is not surprising, as many classical hard problems can be formulated as vertex deletion problems into particular classes of graphs, for example, Vertex Cover as vertex deletion to edgeless graphs, Feedback Vertex Set as vertex deletion to forests, and Odd Cycle Transversal as vertex deletion to bipartite graphs. Graph modification problems are a popular research direction in the study of the parameterized complexity of NP-complete problems. In general, for a problem Π , an input of a parameterized problem consists of an instance I of Π and a parameter k ∈ N. Then we say that Π is fixed parameter tractable (FPT) if there exists an algorithm deciding whether I is a yes-instance of Π in time f (k) · |I | O(1) , where f is some computable function. For a graph modification problem, we often choose the parameter k as a number of allowed modifications, so the instance of such a problem is still a pair (G, k).
It turns out that characterizations by forbidden structures are sometimes useful to design FPT algorithms for graph modification problems. For example, Cai [4] proposed an FPT algorithm for modification problems into classes of graphs characterized by a finite family of forbidden induced subgraphs F. His algorithm identifies a forbidden structure in the input graph (which can be done in polynomial time when F is finite) and branches over all possible ways of modifying that structure. Since the families of forbidden structures are infinite for graph classes introduced above, modification algorithms for these classes have to be much more sophisticated. For several of them modification problems have satisfactory solutions: -chordal graphs: all four versions of the modification problem are FPT [7,23]; -interval graphs: edge completion and edge deletion are FPT [5,28], vertex deletion is FPT [7], edge edition remains open; -proper interval graphs: all four versions of the modification problem are FPT [6].
On the other hand, it is known that the vertex deletion to perfect graphs is W[2]-hard [15]. It is worth mentioning that for a long time, it was unknown whether there are classes of graphs recognizable in polynomial time for which modification problems are hard. The first such example was given by Lokshtanov [21], who proved that the vertex deletion is W[2]-hard for graphs avoiding all wheels (i.e., cycles with an additional vertex adjacent to all other vertices). It is unknown whether comparability graphs, cocomparability graphs, and permutation graphs have FPT modification algorithms. The class of co-comparability graphs, which constitutes the superclass of interval graphs and an important subclass of perfect graphs, seems to be particularly interesting from the parameterized point of view.
Our focus. Like the class of interval graphs, the class of permutation graphs admits polynomial-time algorithms for rich family problems which are NP-complete in general. Apart from the already mentioned classical hard problems which are polynomial-time solvable for perfect graphs, there also exist polynomial algorithms solving e.g., Hamiltonian Cycle, Feedback Vertex Set or Dominating Set in the class of permutation graphs [3,9].
In light of the above considerations, since all the modification problems into the class of permutation graphs-and the related classes of comparability and co-comparability graphs-remain open, restricting our attention to the class of bipartite permutation graphs appears to be a natural research direction. Bipartite permutation graphs form an interesting graph class themselves, first investigated by Spinrad, Brandstädt, and Stewart [25], who characterized them by means of appropriately chosen linear orderings of its bipartition classes. One of the most interesting results concerning the bipartite permutation graphs is by Heggernes et al. [16], who showed that the NP-complete problem of computing the cutwidth of a graph (i.e., finding a linear order of the vertices of a graph that minimizes the maximum number of edges intersected by any line inserted between two consecutive vertices) is polynomial for bipartite permutation graphs.
Our algorithm exploits the absence of some forbidden structures in bipartite permutation graphs. Since these structures cannot, in particular, occur in permutation graphs, we believe that besides being a complete result itself, our research is a step towards understanding the parameterized complexity of modification problems into permutation graphs.
Our results. We focus mainly on the modification by vertex deletion.

Theorem 1
There is an O(9 k · |V (G)| 9 )-time algorithm for instances (G, k) of the vertex deletion into bipartite permutation graphs problem.
We prove Theorem 1 in Sect. 4. Our algorithm is based on the characterization of bipartite permutation graphs by forbidden subgraphs. Using the characterization, at first, we get rid of constant-size forbidden subgraphs by branching, which is a standard technique in modification problems on hereditary graph classes [27,28]. We call graphs without these forbidden subgraphs almost bipartite permutation graphs.
Our main contribution is in the structural analysis of almost bipartite permutation graphs which may contain holes (on more than ten vertices) in contrast to bipartite permutation graphs. This approach is partially inspired by the ideas of van 't Hof and Villanger [27] who used similar tools in their work on proper interval vertex deletion problem. We use the result of Spinrad, Brandstädt, and Stewart [25], who showed that the vertices of every connected bipartite permutation graph G = (U , W , E) can be embedded into a strip in such a way that the vertices from U are on the bottom edge of the strip, the vertices from W are on the top edge of the strip, the neighbors N (u) of u occur consecutively on the top edge of the strip for every u ∈ U (adjacency property), the vertices from N (u) − N (u ) occur consecutively on the top edge of the strip for  Our structural result (see the discussion after Lemma 1) asserts that, depending on the parity of the length of the shortest hole, a connected almost bipartite permutation graph may be naturally embedded in either a cylinder, or a Möbius strip, locally satisfying adjacency and enclosure properties (see Fig. 3).
Once we obtain such structure, we show that every minimal vertex cut that destroys all holes lies nearby a few consecutive vertices from the shortest hole. This allows us to check all the possibilities where we can find a minimum cut. Finally, we use a polynomial algorithm for finding maximum flow (and thus a minimum cut).
The approach used to prove Theorem 1 can be slightly modified to obtain a 9approximation algorithm for the bipartite permutation vertex deletion problem. We show the following.
Theorem 2 There exists a polynomial-time 9-approximation algorithm for vertex deletion into bipartite permutation graphs problem.

Preliminaries
Unless stated otherwise, all graphs considered in this work are simple, i.e., undirected, with no loops and parallel edges. Let G = (V , E) be a graph. For a subset S ⊆ V , the subgraph of G induced by S is the graph We say that u and v are at distance k (in G) if k is the length of a shortest path between u and v in G.
We denote a complete graph and a cycle on n vertices by K n and C n , respectively. By hole we mean an induced cycle on at least five vertices. We say that a hole is even (or odd) if it contains even (odd) number of vertices, respectively.
For a graph G = (V , E), a pair (V , <) is a transitive orientation of G if < is a transitive and irreflexive relation on V that satisfies either u < v or v < u iff uv ∈ E for every u, v ∈ V .
A partially ordered set (shortly partial order or poset) is a pair P = (X , ≤ P ) that consists of a set X and a reflexive, transitive, and antisymmetric relation ≤ P on X . For a poset (X , ≤ P ), let the strict partial order < P be a binary relation defined on X such that x < P y if and only if x ≤ P y and x = y. Equivalently, (X , < P ) is a strict partial order if < P is irreflexive and transitive. Two elements x, y ∈ X are comparable in P if x ≤ P y or y ≤ P x; otherwise, x, y are incomparable in P. A linear order L = (X , ≤ L ) is a partial order in which every two vertices x, y ∈ X are comparable. A strict linear order (X , < L ) is a binary relation defined in a way that x < L y if and only if x ≤ L y and x = y.
we say that P is the intersection of P if for every x, y ∈ X we have x ≤ P y if and only if x ≤ P i y for every i ∈ I . The dimension of a poset P is the minimal number of linear extensions of P that intersect to P. In particular, we say that P is two-dimensional if it is the intersection of two linear extensions of P.
A comparability graph (incomparability graph) of a poset P = (X , ≤ P ) has X as the set of its vertices and the set including every two vertices comparable (incomparable, respectively) in P as the set of its edges. Note the following: if (X , ≤ P ) is a poset, then (X , < P ) is a transitive orientation of the comparability graph of P. A graph G = (V , E) is a comparability graph (co-comparability graph) if G is a comparability (incomparability, respectively) graph of some poset defined on V . So, G is a comparability graph if and only if G admits a transitive orientation. A graph G is a permutation graph if and only if G and the complement of G are comparability graphs [24] (or equivalently, G and the complement of G admit transitive orientations). Baker, Fishburn, and Roberts [1] proved that G is a permutation graph if and only if G is the incomparability graph of a two-dimensional poset.
We say that two sets X and Y are comparable if X and Y are comparable with respect to ⊆-relation (that is, X ⊆ Y or Y ⊆ X holds). We use the convenient (although non-

The Structure of (Almost) Bipartite Permutation Graphs
The characterization of bipartite permutation graphs presented below was proposed by Spinrad, Brandstädt, and Stewart [25].
Suppose G = (U , W , E) is a connected bipartite graph. A linear order (W , < W ) satisfies adjacency property if for each vertex u ∈ U the set N (u) consists of vertices that are consecutive in (W , < W ). A linear order (W , < W ) satisfies enclosure property if for every pair of vertices u, u ∈ U such that N (u) is a subset of N (u ), Note that, whenever (U , < U ) and (W , < W ) form a strong ordering of U ∪ W , then (U , < U ) and (W , < W ) satisfy the adjacency and enclosure properties. properties.
An example of a bipartite permutation graph G = (U , W , E) with linear order w 1 < W w 2 < W . . . < W w 8 < W w 9 of the vertices of W which satisfies the adjacency and the enclosure properties is shown in Fig. 2. Another characterization of bipartite permutation graphs can be obtained by listing all minimal forbidden induced subgraphs for this class of graphs. Such a list can be compiled by taking all odd cycles of length ≥ 3 (forbidden structures for bipartite graphs) and all bipartite graphs from the list of forbidden structures for permutation graphs obtained by Gallai [12]. The whole list is shown in Fig. 4.

Almost Bipartite Permutation Graphs
The goal of this section is to characterize graphs which do not contain small forbidden subgraphs for the class of bipartite permutation graphs. Following terminology of van 't Hof and Villanger [27] we call such graphs almost bipartite permutation graphs. [5,9] as induced subgraphs.
Suppose G = (V , E) is a connected almost bipartite permutation graph.

Proposition 1 Every hole in G is a dominating set.
Proof Let C = {c 0 , c 1 , . . . , c m−1 } be a hole in G. Hence, m ≥ 10. Suppose, for contradiction, that there exists a vertex in the set V \ (C ∪ N (C)). As G is connected, there must exist v ∈ V at distance two from C. Let w ∈ N (v) ∩ N (C) and let c j be a neighbor of w in C. We now look at the neighborhood of w. As G contains no triangle, wc j−1 and wc j+1 are non-edges. Moreover, as G contains no copy of T 2 , vertex w is adjacent to at least one of c j−2 and c j+2 , say c j−2 . Thus, w is nonadjacent to c j−3 . Therefore, the set {c j−3 , c j−2 , c j−1 , c j , c j+1 , w, v} induces a copy of X 2 in G, which leads to a contradiction.
Let C be a shortest hole in G, m be the size of C, and c 0 , c 1 , . . . , c m−1 be the consecutive vertices of C, m ≥ 10. In the remaining part of the paper we use the following notation with respect to C. For any integral number i by c i we denote the unique vertex c i mod m from the cycle C. For any two different vertices c i , c j in C, by the set of all vertices between c i and c j from C we mean the set {c i , c i+1 , . . . , c i+k }, where k is the smallest natural number such that c i+k = c j . Note that this notion is not symmetric, i.e., the set of all vertices between c j and c i from C contains c i , c j and all the vertices from C that are not between c i and c j .
Proof Since C is an induced cycle, (2) clearly holds for the vertices from C, so let v be a vertex in V \ C. As C is a dominating set, by Proposition 1, vertex v has at least one neighbor in C. If v has exactly one neighbor in C, then (1) holds and we are done. So assume that it has more than one neighbor. We now distinguish two cases. First, suppose that there exist two vertices c j , c ∈ N (v) ∩ C at distance at least three in C such that v has no neighbor in the set of vertices between c j and c l , except c j and c l . Then, {c j , c j+1 , . . . , c , v} induces a cycle C on at least five vertices in G. As c j and c are at distance at least three in C, C is shorter than C. In particular, C contradicts either G containing no copy of C , for ∈ {5, . . . , 9}, or C being a shortest hole in G. Therefore, this case never occurs.
Hence, v has either (i) exactly two neighbors in C and those are at distance two as there is no triangle in G, so (2) holds, or (ii) C has an even number of vertices and v is adjacent to every second vertex of C. It remains to show that the latter never occurs. Indeed, if it does, then without loss of generality c 0 ∈ N (v). But observe that since C has at least ten vertices, the set {c 0 , c 1 , c 2 , c 3 , c 4 , c 6 , v} induces a copy of X 3 . This concludes the proof.
we have c i ∈ A i . Following our notation, for any integer i by A i and B i we denote the sets A i mod m and B i mod m , respectively. Furthermore, for every i ≤ j we set: We now characterize the neighborhoods of the vertices in sets A i and B i , see also (1) A i and B i are independent sets.
(2) For every u ∈ A i and every w ∈ B i we have uw ∈ E.
Proof Statement (1) follows trivially from the fact that G contains no triangle. To show statement (2), assume for a contrary that uw / ∈ E for some u ∈ A i and some To prove statements (3) and (4), consider a graph G induced by the set U ∪ W , where Since any edge with two endpoints in U (or two endpoints in W ) could be extended by some vertices from {c i−2 , c i−1 , c i , c i+1 , c i+2 } to an odd cycle of size ≤ 7 in G, the graph G[U ∪ W ] is bipartite with bipartition classes U and W .
To see that (3) holds, first note that B i ⊆ N (u) by statement (2). Therefore, suppose that u has a neighbor v in the set V \ (U ∪ W ).
Consider the case when v ∈ A j for some j / c j+1 }, u, v and the vertices between c j+1 and c i−1 in C as well as u, v and the vertices between c i+1 and c j−1 in C induce cycles in G of size ≤ m − 2. Since |C| ≥ 10, at least one from these cycles has size ≥ 6, and as such it cannot occur in G.
, as the other one follows by symmetry.
∈ E and uu / ∈ E as G contains no triangle. Consequently, the set {c i−3 , w, w , c i−4 , c i−2 , u, u } induces a copy of T 2 in G, which cannot be the case.
To show (2), we again only consider the case It means that there are w, w ∈ B i such that uw, u w ∈ E and u w, uw / ∈ E. Since u, u ∈ A i−2 ∪ B i−1 , we have uc i−1 , u c i−1 ∈ E and uc i+1 , u c i+1 / ∈ E. Furthermore, uu / ∈ E and ww / ∈ E as G contains no triangle. Hence, the set {c i−1 , w, w , c i+1 , u, c i , u } induces a copy of X 3 in G, which cannot be the case.
To see the second part of the statement, assume that w} induces a copy of X 3 in G, which is a contradiction.
Proposition 4 allows us to order vertices of A i based on two properties. We now define relation < A i which combines them and we show that < A i is a partial order (see Fig. 6 for an illustration). We define for every u, u ∈ A i : Fig. 6 The neighborhoods of the vertices from Similarly, we define a relation < B i for every w, w ∈ B i :

Proposition 5
The following statements hold for every i ∈ [m − 1]: is a strict partial order, we need to show that < A i is irreflexive and transitive. The irreflexivity follows from the definition, in aim to show transitivity, we first prove that < A i is antisymmetric. Suppose for a contrary that there are u, u ∈ A i such that u < A i u , and u < A i u. Suppose u < A i u is witnessed by a vertex w ∈ B i−2 ∪ A i−1 such that u ∈ N (w) and u / ∈ N (w); the other case w ∈ A i+1 ∪ B i+2 is analogous. By Proposition 4.(1), there is no w ∈ B i−2 ∪ A i−1 such that u ∈ N (w ) and u / ∈ N (w ). Hence, since u < A i u, there must be a vertex w ∈ A i+1 ∪ B i+2 such that u ∈ N (w ) and u / ∈ N (w ). We have uc i+1 , u c i+1 ∈ E and uc i+2 , u c i+2 , uc i+3 , u c i+3 / ∈ E as {u, u } ⊆ A i . We have also wc i+1 , wc i+2 , wc i+3 , w c i+1 , w c i+3 / ∈ E and w c i+2 ∈ E as w ∈ B i−2 ∪ A i−1 and w ∈ A i+1 ∪ B i+2 . Moreover, uu , ww / ∈ E, by Proposition 3. Consequently, the set {w, w , c i+1 , c i+3 , u, u , c i+2 } induces a copy of X 2 in G, which cannot be the case.
To show transitivity, suppose for a contrary that there are vertices u, u , u ∈ A i such that u < A i u and u < A i u , but u < A i u does not hold.
∈ N (w ) and u ∈ N (w ), which enforces also u ∈ N (w ) as u < A i u and we already proved that < A i is antisymmetric. Thus, u ∈ N (w ) and u / ∈ N (w ), which shows u < A i u . Hence, we must have w ∈ A i+1 ∪ B i+2 , and so u / ∈ N (w ) and u ∈ N (w ). Moreover, u ∈ N (w ) as otherwise u < A i u . As {u , u } ⊆ A i , w ∈ B i−2 ∪ A i−1 , and w ∈ A i+1 ∪ B i+2 , we have u u , ww / ∈ E, by Proposition 3. Consequently, {w, w , c i+1 , c i+3 , u , u , c i+2 } induces a copy of X 2 in G, which is not possible. We conclude that (A i , < A i ) is a strict partial order. By definition, if N (u) = N (u ), then u and u are incomparable in (A i , < A i ). Hence, for the second statement of (1), it is enough to show that N (u) = N (u ) implies that u and u are comparable in (A i , < A i ). Let w be a vertex such that wu ∈ E and wu / ∈ E. By Proposition 3. (2) and (3), Hence, u and u are comparable in < A i .
The proof of (2) is similar. For antisymmetry, suppose that we have w, w ∈ B i such that w < B i w and w < B i w. Let w < B i w and w < B i w be witnessed by u and u from A i−2 ∪ B i−1 ∪ B i+1 ∪ A i+2 , respectively. Analogously to (1), by Proposition 4.(2), we can assume that u ∈ A i−2 ∪ B i−1 and u ∈ B i+1 ∪ A i+2 and uw, u w ∈ E, uw , u w / ∈ E. Observe that the set {c i−1 , w, w , c i+1 , u, c i , u } induces a copy of X 3 in G, a contradiction.
For transitivity of < B i , suppose that for some w, w , and w ∈ B i we have w < B i w and w < B i w , but w < B i w does not hold. By symmetry of the proof of (1), we reach the case u ∈ A i−2 ∪ B i−1 and u ∈ B i+1 ∪ A i+2 , uw, uw , u w, u w ∈ E and uw , u w / ∈ E. Then, one can easily check that the set {w , w , c i+1 , u, c i , u , c i+2 } induces a copy of X 2 in G, a contradiction. Now, assume that N (w) = N (w ). Without loss of generality assume that there Therefore, w and w are comparable, which finishes the proof.
Finally, for every i ∈ [m−1] we order arbitrarily the elements inside every antichain of (A i , < A i ) and of (B i , < B i ), obtaining strict linear orders (A i , < A i ) and (B i , < B i ). We introduce a binary relation ≺ defined on the set V , such that v ≺ v for v, v ∈ V if one of the following conditions holds for some i ∈ [m − 1]: Informally, to get an embedding of G into a cylinder (the shortest hole is even) or into a Möbius strip (the shortest hole is odd) which locally satisfies the adjacency and the enclosure properties, we place the vertices v, v satisfying v ≺ v next to each other, v before v assuming that the border of the cylinder or the Möbius strip are oriented as shown in Fig. 3. In what follows we extend ≺ relation as follows: Finally, the following lemma characterizes the global structure of an almost bipartite permutation graph.

Lemma 1 Let i, j be such that i ≤ j, | j − i| = m − 3. Let U = A[i, j] and W = B[i, j]. Then G[U ∪ W ] is a bipartite permutation graph with bipartition classes U and W .
Moreover To prove the adjacency property, consider u ∈ A k ⊆ U for some suitable k. Recall that by Proposition 3.
To show that N (u) consists of consecutive vertices in W it suffices to note that: w ) and uw ∈ E, then uw ∈ E, by Proposition 5, and that analogous statements hold by symmetry for the part of N (u) contained in

the case analysis is similar (one needs to swap letters
A and B in the reasoning above). Therefore, the adjacency property is proved.
To show that (W , < W ) satisfies the enclosure property assume for a contradiction that there are w, w , w ∈ W and u, u ∈ U such that N (u ) ⊆ N (u), w < W w < W w and uw, uw , uw ∈ E, u w ∈ E, and u w, u w / ∈ E.
Claim There is k ∈ [i, j] such that either u, u ∈ A k , or u, u ∈ B k .

Proof of Claim
If u ∈ B k , then since N (u ) ∩ C ⊆ N (u) ∩ C = {c k }, we have u ∈ B k , so the claim holds. Therefore, assume that u ∈ A k , and suppose that u / ∈ A k . Then N (u ) ∩ C ⊆ N (u) ∩ C = {c k−1 , c k+1 }. Assuming u < U u (the other case is symmetric), we have that u ∈ B k+1 . Due to Proposition 3 and w < W w we have w , w ∈ A[k − 1, k + 2]. Moreover, as we already proved that N (u ) is consecutive in (W , < W ) (adjacency property), and c k+1 ∈ N (u ), we have c k+1 < W w . Therefore w ∈ A k+1 ∪ B k+2 . Note that: This concludes the proof of claim.
Suppose u, u ∈ A k . Since u w, u w / ∈ E and u c k−1 , u c k+1 ∈ E, we have by adjacency property of (W , < W ) that w < W c k−1 < W c k+1 < W w . Therefore, we must have w ∈ B k−2 ∪ A k−1 and w ∈ A k+1 ∪ B k+2 . Observe that w witnesses that u < A k u by definition, however, w witnesses the opposite, that is u < A k u . We have a contradiction by Proposition 5.
Suppose u, u ∈ B k . An analysis, which is analogous to the one in the previous case (again, it is enough to swap letters A and B in that reasoning above), gives us that we must have w ∈ A k−2 ∪ B k−1 and w ∈ B k+1 ∪ A k+2 . Again, we obtain a contradiction by the definition of < B k and Proposition 5.
Lemma 1 provides an interesting view on classification of almost bipartite permutation graphs. Specifically, if m is even, then the graph may be drawn on a cylinder, whose boundary consists of two closed curves, one of which traverses the vertices of A 0 , B 1 , . . . A m−2 , B m−1 , and the second one-the vertices of  B 0 , A 1 , . . . , B m−2 , A m−1 . If in turn m is odd, then the graph can be represented on a Möbius strip, whose boundary traverses the vertices of A 0 , B 1 , . . . , B m−2 , A m−1  and then B 0 , A 1 , . . . A m−2 , B m−1 . In both cases we draw the vertices of A i and of B i on the opposite side of the strip according to the orders given by < A i and < B i , for i ∈ [m − 1] (recall Fig. 3).
The following definitions are taken from [27]. A hole cut of G is a vertex set X ⊆ V such that G − X is a bipartite permutation graph. Lemma 1 asserts that for every i ∈ [m − 1] the set V [i, i + 1] is a hole cut in G. A hole cut X of G is minimum if G does not have a hole cut whose size is strictly smaller than the size of X . A hole cut X of G is minimal if any proper subset of X is not a hole cut in G.
The next proposition describes the structure of every hole in G. 0 , c 1 , . . . , c t−1 so as the following conditions hold (the indices are taken modulo k):

Proposition 6 Suppose C is a hole of size t in G for some t ≥ m. Then, the consecutive vertices of C can be labeled by c
Proof Let c 0 , c 1 , c 2 , . . . , c t−1 be consecutive vertices of C denoted in such a way that c 0 < cl c 2 . We can assume it, since c 0 , c 2 ∈ N (c 1 ), thus, by Proposition 3. (3) and (4), both c 0 , c 2 belong to A[ − 2, + 2] or both belong to B[ − 2, + 2] for some ∈ [m − 1]. Now, we show that if there exists j ∈ [t − 1] such that c j < cl c j+2 , then c j+1 < cl c j+3 . Suppose, for contradiction that c j < cl c j+2 and c j+1 ≮ cl c j+3 .
For the last property, suppose for the sake of contradiction that there exists j / ∈ {i, i + 2} such that c i < cl c j < cl c i+2 . Then, by Lemma 1, c j c i+1 ∈ E due to the adjacency property. But then the edge c j c i+1 is a chord in C . This completes the proof.

Proposition 7 Every minimal hole cut X in G is fully contained in the set V
Proof Let X be a minimal hole cut. Since X is minimal, we can choose elements z 1 , x 1 , x 2 , z 2 in V such that the following conditions hold: and is contained in X , and the elements z 1 , z 2 are not in X .
Note that either . However, Proposition 6 and Proposition 3. (3) and (4) + 3], respectively) in G and the neighborhood of this vertex intersects also B j−1 and A j+4 (A j−1 and B j+4 , respectively), which cannot be the case due to Proposition 3. (3) and (4). So, we have either B[ j, j + 3] = X = X or A[ j, j + 3] = X = X as X is a minimal hole cut. But then, we have X ⊆ V [ j, j + 3], which completes the proof of our claim. Therefore, for the rest of the proof we assume ; the other case is proved similarly. Moreover, we may assume that i is picked such that: See Fig. 7 for an illustration.
Suppose Y is the set consisting of all the neighbors of both z 1 and z 2 ; that is, To complete the proof of the proposition we show that: -every element of Y is a member of X , -X ∪ Y is a hole cut in G.
Then, since X ⊆ X , we have X ∪ Y = X by minimality of X and consequently X ⊂ V [i − 2, i + 2]. So, it remains to prove the claims about the set Y .
Suppose we have y ∈ Y such that y / ∈ X . We fix some x ∈ X , clearly, since X is a minimal hole cut, there is a hole C in G − (X \ {x}). Note that C must contain x. Suppose c 0 , . . . , c −1 for some ≥ 9 are consecutive vertices in C chosen such that c j < cl c j+2 for every j ∈ [ − 1] (indices are taken modulo ). Now we pick p, q ∈ [ − 1] such that c p < cl z 1 ≤ cl c p+2 and c q ≤ cl z 2 < cl c q+2 . Since x ∈ C , we have c p+2 ≤ cl x and x ≤ cl c q . Note that c p+1 is adjacent to z 1 and c q+1 is adjacent to z 2 due to the adjacency property. Next we replace in C all the vertices between c p+2 and c q (this set includes x) with the vertices z 1 , y, z 2 and we obtain a cycle C containing no elements from X . Clearly, we can easily find a hole among the elements from C that avoids all the elements from X . This yields a contradiction as X is a hole cut.
To prove the second claim, suppose there is a hole C in G − (X ∪ Y ). By Proposition 6 there are c 1 , c 2 , c 3 ∈ C such that c 1 < cl X < cl c 3 and c 1 , c 3 ∈ N (c 2 ). However, since c 1 ≤ cl z 1 < cl z 2 ≤ cl c 3 and c 1 , c 3 ∈ N (c 2 ), we have z 1 ∈ N (c 2 ) and z 2 ∈ N (c 2 ). So, we have c 2 ∈ Y , which is a contradiction.

Proof of Theorem 1
The aim of this section is to provide a complete proof of Theorem 1 using structural results from the previous section. Let us start by showing that the Bipartite Permutation Vertex Deletion problem can be decided in polynomial time on almost bipartite permutation graphs.

Lemma 2 Let (G, k) be an instance of Bipartite Permutation Vertex Deletion where G is an n-vertex almost bipartite permutation graph. Then Bipartite Permutation Vertex Deletion can be decided in time O(n 6 ).
Proof If G is a bipartite permutation graph, (G, k) is a yes-instance, thus, we are done in this case. If G is not connected, we can consider each connected component independently and, at the end, we compare k with the total number of deleted vertices over all components. Let G be a connected r -vertex component of G such that G is not a bipartite permutation graph (otherwise, clearly, no vertex needs to be deleted). Let C = {c 0 , . . . , c m−1 } be a shortest hole in G (it exists as G is not a bipartite permutation graph). It can be found in time O(r 6 ) as follows. We iterate over all possible four-element subsets Set capacities of arcs of the form (u, in)(u, out) to 1 and capacities of all the remaining arcs to ∞ (practically |V G |). It is readily seen that minimum (s, t)-cut in the defined network H i corresponds to minimum hole cut in G [V ] (arc of unit capacity (u, in)(u, out) naturally corresponds to the vertex u of G ). Therefore it remains to apply classical max-flow algorithm to each H i for i ∈ [m−1] and remember the smallest size k G of minimal (s, t)-cuts. This can be performed in [11]. Finally, (G, k) is a yes-instance if and only if the sum of remembered sizes k G over the all considered connected components G is at most k. Clearly, the total running time is O(n 6 ).
We now propose the algorithm. Given an n-vertex graph G = (V , E) and number k, we want to answer the Bipartite Permutation Vertex Deletion problem. We say that (G, k) is the initial instance. We split our algorithm into two parts. The first part consists of a branching algorithm for deletion to almost bipartite permutation graphs. The output of the first part is a set of instances (G , k ) where G is an almost bipartite permutation graph and 0 ≤ k ≤ k (or no-answer is no such instance exists) such that the initial instance (G, k) is a yes-instance if and only if at least one of these instances is a yes-instance. In the second part, the algorithm runs an O(n 6 )time algorithm for Bipartite Permutation Vertex Deletion for each instance (G , k ) output by the first phase.
Let us start with the first part. We say that X ⊆ V is a forbidden set if G[X ] is isomorphic to one of the graphs: K 3 , T 2 , X 2 , X 3 , C 5 , C 6 , C 7 , C 8 , C 9 . We define the following rule.
Rule : Given an instance (G, k), k ≥ 1, and a minimal forbidden set X , branch into |X | instances, Starting with the initial instance, the algorithm applies the rule exhaustively. In other words, the algorithm forms a branching tree with leaves corresponding to instances (G , k ) where k = 0 or G is an almost bipartite permutation graph. Clearly, as at least one vertex from each forbidden set must be removed from G, the initial instance is a yes-instance if and only if at least one of the leaves is a yes-instance.
The algorithm continues to the second part only with such leaves (G , k ) that G is an almost bipartite permutation graph (as otherwise, the leaf is no-instance). It runs the algorithm described in Lemma 2 to find if G can be transformed into a bipartite permutation graph by using at most k vertex deletions. It either finds a yes-instance or concludes after checking all the instances that there is no solution; that is, the initial instance is a no-instance.
We note that such a branching into a bounded number of smaller instances is a standard technique, see e.g., [27] for more details.
We now analyze the running time of the whole algorithm. In the first part, observe that the branching tree has depth at most k and has at most 9 k leaves, as k decreases by one whenever the algorithm branches and each of the listed forbidden subgraphs has at most nine vertices. Therefore the total number of nodes in the branching tree is O(9 k ). Moreover, in each node (G , k ) the algorithm works in time O(n 9 ) as it checks if G contains a forbidden set of size at most 9. So, the first part works in time O(9 k · n 9 ). In the second part, the algorithm does a work O(n 6 ) in each of at most 9 k leaves, by Lemma 2. Thus, the second part works in time O(9 k · n 6 ). We conclude that the total running time of our algorithm for Bipartite Permutation Vertex Deletion is O(9 k · n 9 ).

Proof of Theorem 2
In this section, we provide a proof of Theorem 2. The idea of the algorithm is very similar to the FPT algorithm described in Sect. 4.
Let G = (V , E) be a graph and let Y ⊆ V be a subset of vertices of G such that G − Y is a bipartite permutation graph. We want to construct a set Z ⊆ V in polynomial time such that G − Z is a bipartite permutation graph and |Z | ≤ 9|Y |. We construct Z as follows. We start with Z = ∅. Then, as long as G − Z contains a set X isomorphic to one of K 3 , T 2 , X 2 , X 3 , C 5 , C 6 , C 7 , C 8 , C 9 we add all vertices of X to Z . Observe that Y ∩ X = ∅ and |X | ≤ 9.
After this step G − Z is an almost bipartite permutation graph. Note that |Z | ≤ 9|Z ∩ Y |. We find a shortest hole C = {c 0 , . . . , c m−1 } in G − Z and find a minimum hole cut X as described in Sect. 4 We add X to Z . Observe that G − Z is a bipartite permutation graph.
Since K 3 , T 2 , X 2 , X 3 , C 5 , C 6 , C 7 , C 8 , C 9 have at most 9 vertices, we have that |Z | ≤ 9|Y |. This implies that the above algorithm is a 9-approximation algorithm. It runs in polynomial time because finding small forbidden subgraphs can be done in polynomial time and finding a minimum hole cut in an almost bipartite permutation graph can be done in polynomial time.

Conclusion
In this paper we investigate for the first time the modification problems in graph classes related to partial orders. Our main result says that the bipartite permutation vertex deletion problem is fixed parameter tractable. We leave open the following two questions that inspired our research.

Problem 1 What is the parameterized status of the vertex deletion problems to the class of permutation graphs and to the class of co-comparability graphs?
We recall that, due to the result of Lewis and Yannakakis [20], both of these problems are NP-complete. Problem 1 appears to be difficult; in particular, in contrast to bipartite permutation graphs, in which sufficiently large forbidden structures are just cycles, arbitrarily large forbidden structures for permutation graphs and co-comparability graphs may belong to several different infinite families of graphs. One of the most important results of our work is the description of the structure of almost bipartite permutation graphs, which are defined as graphs which do not induce small graphs from the list of forbidden structures for bipartite permutation graphs. In a similar fashion we can define the class of almost permutation and almost co-comparability graphs. Although the families of forbidden structures for permutation graphs and co-comparability graphs are quite complex, the next two questions seem very natural in order to solve Problem 1.

Problem 2 What is the structure of almost permutation and almost co-comparability graphs?
We are aware that the two problems mentioned above can be quite difficult. Therefore, it is worth considering intermediate problems that may be easier to attack. One of the proposed simplifications relies on the transition from the world of graphs to the world of posets. The following vertex deletion into two-dimensional posets problem seems very natural in the context of our research: we are given in the input a poset P and a number k and we ask whether we can delete at most k points from P so that the remaining points induce a two-dimensional poset in P.

Problem 3 What is the parameterized status of the vertex deletion into twodimensional poset problem?
Since permutation graphs are co-comparability graphs of two-dimensional posets and since permutation graphs are both comparability and co-comparability graphs, the vertex deletion into two-dimensional poset problem is equivalent to the vertex deletion into co-comparability graph (or into permutation graph) problem if we assume that only comparability graphs can be given in the input. The class of two-dimensional posets is very well understood; in particular, the list of minimal forbidden structures for this class of posets, which is still infinite, is known (obtained independently by Trotter and Moore [26] and by Kelly [18]). Of course, it is natural to ask the following question:

Problem 4 What is the structure of almost two-dimensional posets?
Since the comparability graphs of posets do not contain odd holes of size ≥ 5, we know the structure of almost two-dimensional posets that are bipartite. Indeed, these are the posets whose comparability graphs are almost bipartite permutation graphs embeddable into cylinder stripes. The last problem we want to ask is as follows:

Problem 5 Is there a polynomial kernel for the bipartite permutation vertex deletion problem?
A positive answer to this question obtained by indicating so-called irrelevant vertices may give some hope to solve Problem 1 with the use of irrelevant vertex technique.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.