Computing $2$-twinless blocks

Let $G=(V,E))$ be a directed graph. A $2$-twinless block in $G$ is a maximal vertex set $B\subseteq V$ of size at least $2$ such that for each pair of distinct vertices $x,y \in B$, and for each vertex $w\in V\setminus\left\lbrace x,y \right\rbrace $, the vertices $x,y$ are in the same twinless strongly connected component of $G\setminus\left \lbrace w \right\rbrace $. In this paper we present algorithms for computing the $2$-twinless blocks of a directed graph.


Introduction
Let G = (V, E) be a directed graph. G is twinless strongly connected if it contains a strongly connected spanning subgraph (V, E t ) such that E t does not contain any pair of antiparallel edges. A twinless strongly connected component of G is a maximal subset C t ⊆ V such that the induced subgraph on C t is twinless strongly connected. A strong articulation point of G is a vertex whose removal increases the number of strongly connected components of G. A strong bridge of G is an edge whose deletion increases the number of strongly connected components of G. A strongly connected graph is 2vertex-connected if it has at least 3 vertices and it has no strong articulation points. A 2-vertex-connected component of G is a maximal vertex subset C v ⊆ V such that the induced subgraph on C v is 2-vertex-connected. A 2-directed block in G is a maximal vertex subset B d ⊆ V with |B d | > 1 such that for any distinct vertices x, y ∈ B d , the graph G contains two vertexdisjoint paths from x to y and two vertex-disjoint paths from y to x. A 2-edge block in G is a maximal subset B eb ⊆ V with |B eb | > 1 such that for any distinct vertices v, w ∈ B eb , there are two edge-disjoint paths from v to w and two edge-disjoint paths from w to v in G. A 2-strong block in G is a maximal vertex subset B s ⊆ V with |B s | > 1 such that for each pair of distinct vertices x, y ∈ B s and for every vertex u ∈ V \ {x, y}, the vertices x and y are in the same strongly connected component of the graph G \ {u}. A twinless articulation point of G is a vertex whose removal increases the number of twinless strongly connected components of G. A 2-twinless block in G is a maximal vertex set B ⊆ V of size at least 2 such that for each pair of distinct vertices x, y ∈ B, and for each vertex w ∈ V \ {x, y}, the vertices x, y are in the same twinless strongly connected component of G \ {w}. Notice that 2-strong blocks are not necessarily 2-twinless blocks (see Figure 1). A twinless strongly connected graph G is said to be 2-vertex-twinlessconnected if it has at least three vertices and it does not contain any twinless articulation point [19]. A 2-vertex-twinless-connected component is a maximal subset U 2vt ⊆ V such that the induced subgraph on U 2vt is 2-vertextwinless-connected. While 2-vertex-twinless-connected components have at least linear number of edges, the subgraphs induced by 2-twinless blocks do not necessarily contain edges.
Strongly connected components can be found in linear time [25]. In 2006, Raghavan [22] showed that the twinless strongly connected component of a directed graph can be found in linear time. In 2010, Georgiadis [7] presented an algorithm to check whether a strongly connected graph is 2-vertex-connected in linear time. Italiano et al. [15] gave linear time algorithms for identifying all the strong articulation points and strong bridges of a directed graph. Their algorithms are based on dominators [3,4,1,2,6,21]. In 2014, Jaberi [17] presented algorithms for computing the 2-vertex-connected components of directed graphs in O(nm) time (published in [16]). Henzinger et al. [14] gave algorithms for calculating the 2-vertex-connected components in O(n 2 ) time. Jaberi [18] presented algorithms for computing 2-blocks in directed graphs. Georgiadis et al. [9,10] gave linear time algorithms for determining 2-edge blocks. Georgiadis et al. [11,12] also gave linear time algorithms for calculating 2-directed blocks and 2-strong blocks. Georgiadis et al. [13] and Luigi et al. [20] performed experimental studies of recent algorithms that calculate 2-blocks and 2-connected components in directed graphs. In 2019, Jaberi [19] presented an algorithm for computing 2-vertex-twinless-connected components. Georgiadis and Kosinas [8] gave a linear time algorithm for calculating twinless articulation points.
In the following section we show that the 2-twinless blocks of a directed graph can be calculated in O(n 3 ) time.

Algorithm for computing 2-twinless blocks
In this section we present an algorithm for computing the 2-twinless blocks of a twinless strongly connected graph. Since twinless strongly connected components do not share vertices of the same 2-twinless block, we consider only twinless strongly connected graphs. Let G = (V, E) be a twinless strongly connected graph. We define a relation 2t as follows. For any distinct vertices x, y ∈ V , we write x 2t y if for all vertices w ∈ V \ {x, y}, the vertices x, y are in the same twinless strongly connected component of G \ {w}. By definition, a 2-twinless block in G is a maximal subset B 2t ⊆ V with |B 2t | > 1 such that for every two vertices x, y ∈ B 2t , we have x 2t y. The next lemma shows that 2-twinless blocks share at most one vertex.
Proof. Suppose for the sake of contradiction that B 2t 1 and B 2t 2 have at least two vertices in common. Clearly, B 2t 1 ∪ B 2t 2 is not a 2-twinless block in G. Let x and y be vertices belonging to B 2t 1 and B 2t 2 , respectively, such that Proof. Assume for the purpose of contradiction that there are two vertices v r and v q in G such that v r and v q are in distinct 2-twinless blocks of G and r, q ∈ {0, 1, . . . , l}. Suppose without loss of generality that r < q. Then there is a vertex z ∈ V \ {v r , v q } such that v r and v q are in distinct twinless strongly connected components of G \ {z}. We distinguish two cases. Let G = (V, E) be a twinless strongly connected graph. We construct the 2-twinless block graph G 2t = (V 2t , E 2t ) of G as follows. For every 2-twinlesss block B i , we add a vertex v i to V 2t . Moreover, for each vertex v ∈ V , if v belongs to at least two distinct 2-twinless blocks, we add a vertex v to V 2t . For any distinct 2-twinless blocks   Let S be an n × n matrix. 5 Initialize S with 1s. 6 determine the twinless articulation points of G.    16 calculate the blocks of size ≥ 2 of G b = (V, E b ) and output them.
The correctness of Algorithm 2.5 follows from the following lemma. Proof. Georgiadis and Kosinas [8] showed that the twinless articulation points can be computed in linear time. The initialization of matrix S takes O(n 2 ) time. The number of iterations of the for-loop in lines 7-11 is at most n because the number of twinless articulation points is at most n. Consequently, lines 7-11 require O(n 3 ). Furthermore, the blocks of an undirected graph can be found in linear time [25,24].
The following lemma shows an important property of G b . Proof. It follows from Lemma 2.2.
By Lemma 2.8, one can calculate the maximal cliques of G b instead of blocks. The maximal cliques of a chordal graph can be calculated in linear time [5,23].

An improved version of Algorithm 2.5
In this section we present an improved version of Algorithm 2.5. The following lemma shows a connection between 2-twinless blocks and 2-strong blocks.   Proof. The 2-strong blocks of a directed graph can be computed in linear time [11]. Furthermore, the twinless articulation points of a directed graph can be identified in linear time using the algorithm of Georgiadis and Kosinas [8]. Since the number of iterations of the for-loop in lines 16-20 is at most t, lines 16-20 take O(t(s 2 + m)) time.
Let G = (V, E) be a twinless strongly connected graph. If the refine operation defined in [20] is used to refine the 2-strong blocks of G for all twinless articulation points, then the 2-twinless blocks of a directed graph G = (V, E) can be computed in O(tm) time, where t is the number of twinless articulation points of G.
We leave as open problem whether the 2-twinless blocks of a directed graph can be calculated in linear time. Let S be an n × n matrix. 6 Initialize S with 0.