**1. Introduction**

The monographs [1–3], which have become classic, are devoted to theoretical and applied issues of digraph research. They are closely related to the Ford–Fulkerson theorem on the equality of the maximum flow and the minimum cut [4,5]. At first glance, many problems with digraphs look like NP-problems. However, with a special selection of optimized indicators and graph transformation, these tasks can be reduced to the search for Ford–Fulkerson algorithms. In this way, it becomes possible to avoid the appearance of NP-problems when working with digraphs. Therefore, these studies can be attributed to the intensively developing applications of digraph theory in system analysis and the theory of optimization algorithms on graphs [6,7]. The papers closest to the subject of this article can be considered [8,9].

In particular, the strong connectivity in digraphs is considered in the presence of arc failures [10]. The paper [11] studies the use of digraphs in interferometry. The paper [12] explores the issues of spectral complexity of digraphs and their application to structural decomposition. In [13], using digraph models, the issues of signal processing and learning from network data are analysed. In the work [14], the multilevel task of identifying bottlenecks in the network is considered. In the works [15,16], minimal networks are built in which the Ford–Fulkerson procedure may not be completed. The paper [17] explores various ways of applying stochastic models on digraphs in computational biology. Due to the intensive development of biotechnology, two new applied problems of digraph theory are posed in this paper, which require both the development of the theory and the construction of new optimization algorithms on digraphs. Both tasks were initiated by biotechnological problems related to protein networks. Let us describe these tasks in more detail.

The importance of analysing protein networks in plant bioengineering is due to the fact that the growth and development of plants, as well as their protective functions, are regulated by the interaction of various protein signalling modules. At the same time,

**Citation:** Tsitsiashvili, G.; Bulgakov, V. New Applied Problems in the Theory of Acyclic Digraphs. *Mathematics* **2022**, *10*, 45. https:// doi.org/10.3390/math10010045

Academic Editor: Frank Werner

Received: 16 November 2021 Accepted: 22 December 2021 Published: 23 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

fine-tuning of metabolic processes takes place, allowing the plant to adapt to changing environmental conditions. Plant interactomes have not been worked out enough yet. Therefore, it is necessary to develop mathematical modelling methods that describe the natural functions of protein modules as accurately as possible.

Previously, we tried to link various cellular processes affecting the biosynthesis of anthocyanins. In this work, we have identified the main signalling protein modules that regulate the biosynthesis of anthocyanins. As far as we know, this was the first reconstruction of a network of proteins involved in the secondary metabolism of plants [18].

It was further shown that the signalling systems of abscisic acid (ABA) and chaperones are integrated by chromatin remodelling proteins (CRC) into a single regulatory network. CRC proteins "remember" the previous stressful effects and adjust the plant to the perception of new ones, and memory is generated in the offspring. A new scientific direction—"bioengineering of memory" was substantiated [19].

Fabregas et al. [20] reported that overexpression of the vascular brassinosteroid receptor BRL 3 provides improved drought resistance without disrupting plant growth. We have constructed a network of protein–protein interactions of ABA and brassinosteroid signalling systems. It has been established that the phenomenon of drought resistance mediated by BRL3 can be explained by the generation of stress memory (a process known as "priming" or "acclimation") [21]. Let us now turn to the mathematical formulation and algorithmic solution of the protein network modelling.

In the first problem, we are talking about finding a smallest set of arcs, the removal of which blocks all paths passing through an acyclic digraph with a set of *W* (corrupted) vertices. To solve this problem, it is proposed to cut the pathways entering the set of affected proteins or leaving this set, thus minimizing the number of cut paths. Such minimization deforms the structure of the protein network in the least way. It should be noted that isolation measures restricting the normal functioning of various communication networks, such as transport, economic, educational, etc., have recently invaded our lives. Therefore, the considered biotechnological problem acquires a more general meaning, which requires the construction of economical algorithms for its solution.

In biotechnology there is a problem to decrease a number of blocking arcs. To solve this problem it is possible to add to incoming and out coming arcs some arcs between corrupted vertices (selected by the biotechnologists) and to choose among them minimal number of blocking arcs. This procedure may be realized by implementing a large bandwidth to chosen arcs. All its stages are well known, but together they make it possible to solve an important and new problem in the field of biotechnology. Thus, it becomes possible to structure both the formulation and the solution of this problem, taking into account the choice of biotechnologists.

The solution of this problem is based on a special building of the integer bandwidths of the arcs of an acyclic digraph, the minimum section in which contains only of arcs entering from the inside into the subset *W* and/or exiting from the inside of the subset *W* and some arcs between vertices from *W*. By choosing the integer bandwidths, the arcs connecting the vertices of the subset *U*<sup>∗</sup>, are made unsaturated by the maximum flow. In turn, saturated with the maximum flow (the maximum flow passing through them coincides with their throughput) can only be arcs entering from the outside into a subset of *W* and/or exiting from the outside of the subset *W*. Next, the minimal section is searched using the well-known Ford–Fulkerson algorithm [4,5], which guaranteed to converge only for integer throughput. This algorithm was developed in its modifications [22,23]. Minimizing the number of arcs satisfying certain properties creates a risk of encountering an NP-problem as the problem of continuous brute force. The use of techniques that lead the tasks to the modified Ford–Fulkerson algorithm allows us to avoid the risk of NP-complex problems. Thus, in order to use the Ford–Fulkerson algorithm in solving this problem, it is necessary to build a two-pole and select the integer throughputs of its arcs so that the solution obtained in this algorithm determines the solution of the problem.

An alternative and in some sense inverse second problem is connected with the introduction into the digraph of a smallest set of new arcs that turn an acyclic digraph into a strongly connected one (in which there is a path from any vertex to any other vertex). This procedure is needed to include all the vertices of the acyclic digraph in the feedbacks that stabilize the functioning of the network represented by the digraph.

To do this, we first consider a bipartite acyclic digraph, in which all arcs are directed from the first lobe to the second. By removing the orientation of the arcs, we obtain an undirected bipartite graph. Using the well-known generalizations of the Ford–Fulkerson [24] algorithm, the maximum matching is searched for in it by a method of increasing alternating paths [25], from which the minimum arc cover is constructed. It consists of an incoherent collection of star-like sub graphs (in which arcs connect some vertices with the base of the star) ([26] p. 318). Next, the orientation of the arcs is restored and additional arcs are introduced in the resulting bipartite digraph by a special algorithm. This algorithm is based on the sequential arrangemen<sup>t</sup> first of the stars of the first type-with roots in the first lobe and then of the stars of the second type with roots in the second lobe. If all the stars have the same type, then their vertices may be connected by a Hamiltonian cycle [27].

However, if there are stars of different types, then the stars of the first and then the second type are located first. Then, additional arcs are introduced from the vertices of the second lobe to the vertices of the first lobe so that their number equals the maximum between the number of vertices of the first lobe and the second lobe. This number of additional arcs is minimal for obtaining strongly connected digraph. When moving from the minimum arc cover to the original bipartite digraph, the minimum number of additional arcs cannot increase. At the same time, the set of additional arcs already found transforms this bipartite digraph into a strongly connected one. The transition from an arbitrary acyclic digraph to a bipartite one is based on the allocation in an arbitrary digraph of the first lobe, including vertices from which only arcs come out, and the second lobe, including vertices that only arcs enter. An arc between the vertex of the first lobe to the vertex of the second lobe in a bipartite digraph is drawn if and only if there is a path between these vertices in the original digraph.

When solving both problems, we have to deal with digraphs that are not initially acyclic. The transformation of an arbitrary digraph into an acyclic one is based on the procedure for allocating cyclic equivalence classes (in which there is a path from any vertex to any other vertex) and arcs between them [28]. The paper presents an original algorithm for solving the problem of allocating cyclic equivalence classes [29] basing on the sequential inclusion in the digraph of a new vertex and arcs connecting it to the already specified ones.

#### **2. Optimal Blocking of Selected Vertices of the Acyclic Digraph**

Consider an acyclic digraph G, with a finite set of vertices U and a finite set of arcs V. In the set U, a subset *U* ⊂ U of the so-called corrupted vertices is allocated. Let's define an acyclic digraph *G* ⊂ G, with a set of vertices *U* and a set of arcs *V* connecting these vertices.

We attach to the digraph *G* the arcs of the digraph G, walking to the set *U* from the set U \ *U* and the arcs coming out of *U* to U \ *U* and some arcs from the set U, selected by biotechnologists. The set of these arcs is denoted by *W* and we call the *path passing through* the set *U* in the digraph G, if it starts at the vertex of the set U \ *U* moves by an arc of *W* to the set *U*, passes through the set *U* and then moves by an arc of the set *W* to the set U \ *U*. Our task is to determine in the set *W* the smallest subset of arcs whose removal from the digraph G breaks all paths, passing through the set of vertices *U*.

To do this, we transform the digraph *G* together with the set of its incoming and out coming arcs into the digraph *G*- as follows. All vertices of the set U \ *U*, from which arcs of the set *W* move to *U* we combine into one vertex *S* and call it the *source*. All vertices of the set U \ *U*, to which arcs of the set *W* move from *U* we combine into one vertex *T* and call it a *drain*. All arcs of the set *W*, going from the source *S* to the vertex *P* ∈ *U*, we combined into one arc *w*∗ and determine its throughput equal to *<sup>n</sup>*(*P*), which is the number of arcs to be combined. All arcs of the set *W*, going from the vertex *P* ∈ *U* to the drain *T*, we combine coming arcs, and the single vertex *T*,

into one arc *w*<sup>∗</sup> and determine its throughput equal to *<sup>N</sup>*(*P*). If there is not an arc from the source *S* to vertex *P*, then *n*(*P*) = 0, if there is not an arc from the vertex *P* to the drain *T*, then *N*(*P*) = 0 as well.

Note that to formulate the optimization problem, it is necessary to exclude from its solution all arcs of the set *V*, which are not chosen by biotechnologists. To realize this procedure denote *L* = min <sup>∑</sup>*<sup>P</sup>*∈*<sup>U</sup> <sup>n</sup>*(*P*), ∑*P*∈*U N*(*P*)! and assign the bandwidth *L* + 1 to all arcs of the digraph *G*-, which are not included in the set *W*. All arcs of the digraph *G*-, which are chosen by biotechnologists, receive bandwidth 1. Therefore, the acyclic digraph *G*- becomes the bipolar, that is the digraph with the single vertex *S*, which has only out

#### **Proposition 1.** *The quantity of maximal flow in the bipolar G*- *is not larger than L.*

which has only incoming arcs.

**Proof of Proposition 1.** Indeed, the quantity of maximal flow in the bipolar *G*- is not larger than a sum ∑ *P*∈*U n*(*P*) of weights of arcs moving from the source *S*. The quantity of maximal flow in the bipolar *G*- is not larger than a sum ∑ *P*∈*U N*(*P*) of weights of arcs moving from the drain *T*. Consequently, the quantity of the maximal flow in the bipolar *G*- is not larger than *L* = min <sup>∑</sup>*<sup>P</sup>*∈*<sup>U</sup> <sup>n</sup>*(*P*), ∑*P*∈*U <sup>N</sup>*(*P*)!.

**Proposition 2.** *If in bipolar G*-*, some arc w has bandwidth L* + 1*, then it does not include into any minimal cut.*

**Proof of Proposition 2.** From the theorem of Ford–Falkerson [4,5], it is clear that any minimal cut in the bipolar *G*- consists only of arcs saturated by any maximal flow. Therefore, the arcs which have bandwidths *L* + 1 cannot be included into any minimal cut.

**Remark 1.** *It follows from Propositions 1 and 2 that the proposed method for setting the bandwidths in the two-pole G*- *allows determining the minimum cuts only from the arcs of the set W, as required in the original formulation of the problem.*

As all included bandwidths are integers, using the Ford–Fulkerson algorithm [4,5] (or its modifications [22,23]) it is possible to calculate the maximum flow in the digraph *G*- and to obtain minimal cut *W*-. Each of the arcs of the set *W*-, going from *S* to *P* ∈ *U* is defined as the union of *n*(*P*) arcs of the digraph G. Similarly, each of the arcs of the set *W*-, going from *P* ∈ *U* to *T* is defined as the union of *N*(*P*) arcs of the digraph G. Denote *W*-- a set of arcs from the set *W*, included in the combined arcs of the set *W*-. Consequently from Propositions 1 and 2 and Remark 1 we have that *W*-- is the solution of the optimization problem of selecting a smallest set of arcs from the set *W* whose removal breaks all paths passing through the vertex set of *U*. Indeed, if the united arc *w* ∈ *W*-, then to block all paths passing through the vertex set *U*, we must delete all arcs, united in an arc *w*.

#### **3. Optimal Algorithm for Converting an Acyclic Digraph into a Strongly Connected One**

**Problem statement.** Suppose that a complex system, for example, a protein network, is represented by an acyclic digraph G without loops and isolated vertices. Let's denote *V*1 the set of vertices from which the arcs only come out, and *V*2 the set of vertices into which the arcs only enter. Now let's construct a bipartite digraph *G*, in which the set of vertices of the first lobe *V*1, and the set of vertices of the second lobe *V*2, the vertex *v*1 ∈ *V*1 is connected to the vertex *v*2 ∈ *V*2 by an arc, if there is a path between them in the acyclic digraph G. As the digraph G is acyclic so there are not ways from vertices of the second lobe *V*2 to vertices of the first lobe *V*1. We denote *p*(G) the smallest set (by a number of

arcs) of additional arcs (call them "good arcs"), the introduction of which in G transforms it into a strongly connected digraph and designate |*p*(G)| the number of good arcs in *p*(G).

Let us transform a bipartite digraph *G* into an undirected one by removing the orientation of the arcs and find a minimal arc cover in it (see, for example, [6,24]). To do this, using the algorithm of increasing alternating paths, we find the maximum matching that can be transformed into a minimum arc cover, whose connected components are star-like sub graphs (all arcs come from one vertex or enter one vertex, called the root). In the minimal arc cover, we restore the direction of the arcs and denote the resulting bipartite digraph *G*. It should also be noted that there are two types of star-like sub graphs. In the *star-like sub graph* of the first type, the root is contained in the first lobe *V*1 (on the left in Figure 1) and in the star-like sub graph of the second type, the root is contained in the second lobe *V*2 (on the right in Figure 1).

The main result of the work is an algorithm for constructing a smallest set of good arcs that turn *G* into a strongly connected digraph. It is proved that the number of good arcs in a smallest set *p*(*G*) = max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|), where |*Vi*| the number of vertices in the set *Vi*, *i* = 1, 2. This equation applies to a bipartite graph *G* with lobes *V*1, *V*2 and to acyclic digraph G. This is due to the fact that "good arcs," turning the bipartite digraph *G* into strongly connected, also turn the bipartite digraph *G* and the original acyclic digraph G into strongly connected.

**Main results.** Consider a bipartite digraph *G*, consisting of the set of unrelated *M* stars *G*<sup>1</sup> 1, ... , *G M* 1 with the root in the first lobe and *N* stars *G*<sup>1</sup> 2, ... , *G N* 2 with the root in the second lobe. Let *m* the number of leaves in the stars *G*<sup>1</sup> 1, ... , *G M* 1 and *n* the number of leaves in the stars *G*<sup>1</sup> 2, ... , *G N* 2 . Then, it performs equality |*<sup>V</sup>*1| = *M* + *n*, |*<sup>V</sup>*2| = *m* + *N*. Figure 1 shows an example of a digraph *G*, consisting of stars *G*<sup>1</sup> 1, *G*<sup>2</sup> 1, *G*<sup>1</sup> 2, *G*<sup>2</sup> 2 in the case of *m* = *n* = 6, *M* = *N* = 2. Here, the upper vertices make up the first lobe, and the lower ones make up the second lobe.

**Figure 1.** Unrelated stars *G*<sup>1</sup> 1, *G*<sup>2</sup> 1, *G*<sup>1</sup> 2, *G*<sup>2</sup> 2, *M* = *N* = 2, *m* = *n* = 6.

**Theorem 1.** *Equality* |*p*(*G*)| = max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|) *is true.*

**Proof of Theorem 1.** When converting the digraph *G*, the number of good arcs, entering the roots of stars *G*<sup>1</sup> 1, ... , *G M* 1 , must be no less than *M*, and entering the leaves of stars *G*<sup>1</sup> 2, ... , *G N* 2 —no less than *n*. The number of good arcs, leaving the leaves of stars *G*<sup>1</sup> 1, ... , *G M* 1 , must be no less than *m*, and leaving the roots of the stars *G*<sup>1</sup> 2, ... , *G N* 2 are no less than *N*. Therefore, the number of good arcs entering the vertices of the first lobe is no less than *M* + *n*, and leaving the vertices of the second lobe is no less than *m* + *N*. Additional incoming and outgoing arcs may coincide. Therefore, the minimum number of additional arcs is |*p*(*G*)| ≥ max(*m* + *N*, *n* + *<sup>M</sup>*). Now, we prove that |*p*(*G*)| = max(*<sup>M</sup>* + *n*, *m* + *N*) = max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|).

Let us first consider the case when the digraph *G* consists only of stars *G*<sup>1</sup> 1, ... , *G M* 1 or only of stars *G*<sup>1</sup> 2,..., *G N* 2 . Let us add stars *G*<sup>1</sup> 1,..., *G M* 1 by good arcs.

In the stars *G*<sup>1</sup> 1, ... , *G M* 1 with good arcs, we indicate the Hamiltonian cycle. It starts at the root of the star *G*<sup>1</sup> 1, passes sequentially through all the leaves of this star, goes to the root of the star *G*<sup>2</sup> 1, etc., from the last leaf of the star *G M* 1 to the root of the star *G*<sup>1</sup> 1. As a result, we transform the stars *G*<sup>1</sup> 1, ... , *G M* 1 into a strongly connected digraph with the number of additional arcs *m* = max(*m* + 0, 0 + *M*) (Figure 2). If *M* = 1, then the last leaf of the star

*G*<sup>1</sup> 1is connected by the good arc with its root.

**Figure 2.** A strongly connected digraph constructed from the stars *G*<sup>1</sup> 1, *G*<sup>2</sup> 1(right).

Similarly, in the digraph *G*, consisting only of stars *G*<sup>1</sup> 2, ... , *G N* 2 , let us add these stars with good arcs sequentially connected by their leaves. In addition, from the root of the star *G<sup>k</sup>* 2, we will draw a good arc to the first leaf of the star *Gk*+<sup>1</sup> 2 , *k* = 1, ... , *N* − 1, and from the root of the star *G N* 2 to the first leaf of the star *G*<sup>1</sup> 2. If *N* = 1, we connect the root of the star *G*<sup>1</sup> 2with its first leaf.

In the stars *G*<sup>1</sup> 2, ... , *G N* 2 with additional arcs, we indicate the Hamiltonian cycle. It starts in the first leaf of the star *G*<sup>1</sup> 2, passes sequentially through all its leaves, and goes to its root, then goes to the first leaf of the star *G*<sup>2</sup> 2, etc. From the root of the star *G N* 2 , the path continues to the first leaf of the star *G*<sup>1</sup> 2. As a result, we transform the stars *G*<sup>1</sup> 2, ... , *G N* 2 into a strongly connected digraph with the number of additional arcs *n* = max(<sup>0</sup> + *N*, *n* + 0) (Figure 3). If *N* = 1, we connect the root of the star *G*<sup>1</sup> 2by the good arc with its first leaf.

**Figure 3.** A strongly connected digraph constructed from the stars *G*<sup>1</sup> 2, *G*<sup>2</sup> 2(right).

Let us now consider the case when *MN* > 0, i.e., in the digraph *G*, there are stars of both the first and the second types. Denote *W*1 the set of all vertices in the stars *G*<sup>1</sup> 1, ... , *G M* 1 and *W*2 the set of all vertices in the stars *G*<sup>1</sup> 2, ... , *G N* 2 . Let us introduce a good arc, coming out of the root of the star *G N* 2 and entering some leaf of the star *G N*−1 2 , an arc coming out of the root of the star *G N*−1 2 and entering some leaf of the star *G N*−2 2 , etc., good arc, coming out of the root of the star *G*<sup>1</sup> 2 and entering the root of the star *G M* 1 , good arc, coming out of some leaf of the star *G M* 1 and entering the root of the star *G M*−1 1 , coming out of any leaf of the star *G M*−1 1 and entering the root of the star *G M*−2 1 , etc., good arc, coming out of any leaf of the star *G*<sup>2</sup> 1 and entering the root of the star *G*<sup>1</sup> 1. Let us call the introduced good arcs and their incident vertices marked (see Figure 4, highlighted in grey). It is obvious that from any labelled, and hence from any vertex of the star of the set *G*<sup>1</sup> 2, ... , *G N* 2 , there is a path to any vertex of the star of the set *G*<sup>1</sup> 1, ... , *G M* 1. We will denote this statement *W*2 ⇒ *W*1.

**Figure 4.** Introduction of *M* + *N* − 1 additional arcs.

The number of labelled arcs connected the vertices of the star *G*<sup>1</sup> 1, ... , *G M* 1 , is *M* − 1, and the arcs connected the vertices of the star *G*<sup>1</sup> 2, ... , *G N* 2, is *N* − 1. Then, the total number

of marked arcs taking into account the arc from the star *G*12 to the star *<sup>G</sup>M*1 is *M* − 1 + *N* − 1+ 1 = *M* + *N* − 1.

The total number of unlabelled vertices in the stars *G*11, ... , *<sup>G</sup>M*1 is *m* − (*M* − <sup>1</sup>), the number of unlabelled vertices in the stars *G*12, ... , *<sup>G</sup>N*2 is *n* − (*N* − 1). From each unlabelled vertex of the set *W*1 (see Figure 5), let us draw good arc to some unlabelled vertex of the set *W*2 so that each unlabelled vertex of the set *W*2 includes an arc from some vertex of the set *W*1. Thus, the number of additionally introduced good arcs is equal to max(*m* − (*M* − <sup>1</sup>), *n* − (*N* − <sup>1</sup>)). Therefore, the total number of good arcs becomes equal to max(*m* − (*M* − <sup>1</sup>), *n* − (*N* − 1)) + *M* + *N* − 1 = max(*m* + *N*, *n* + *<sup>M</sup>*).

**Figure 5.** Introduction of max(*m* − (*M* − <sup>1</sup>), *n* − (*N* − 1)) good arcs.

We prove that the introduction of all good arcs into the stars *G*11, ... , *<sup>G</sup>M*1 , *G*12, ..., *<sup>G</sup>N*2 transforms these stars into a strongly connected digraph. Let us take an arbitrary unlabelled vertices *v*1 ∈ *W*1, *v*2 ∈ *W*2 and draw the path through unlabelled vertices *v*1, *v*-2, *v*-1, *v*2, where *v*-2 ∈ *W*2—the vertex connected with a vertex *v*1 by good arc, and *v*-1 ∈ *W*1—the vertex connecting with the vertex *v*2 by good arc. Since from any labelled vertex of the set *W*1 it is possible to draw a path to some unlabelled vertex of this set and from any unlabelled vertex of the set *W*2 it is possible to draw good arc to some labelled vertex of this set, then it is possible to draw a path from any vertex of the set *W*1 to any vertex of the set *W*2, i.e., *W*1 ⇒ *W*2. Then, from the relations *W*1 ⇒ *W*2, *W*2 ⇒ *W*1 we ge<sup>t</sup> *W*1 *W*2 ⇒ *W*1 *W*2. Therefore, constructing from the stars *G*11, ... , *<sup>G</sup>M*1 , *G*12, ... , *<sup>G</sup>N*2 digraph with the entered max(*m* + *N*, *n* + *M*) good arcs, is strongly connected. The statement of Theorem 1 is fully proved.

**Theorem 2.** *For a bipartite digraph G, the minimum number of good arcs, that turn it into a strongly connected digraph is determined by the equality*

$$|p(G)| = \max(|V\_1|, |V\_2|). \tag{1}$$

**Proof of Theorem 2.** From Theorem 1, the equalities

$$|V\_1| = n + M\_\prime \ |V\_2| = m + N\_\prime \ |p(\widehat{G})| = \max(|V\_1|, |V\_2|)$$

follow. From the definition of a minimal arc cover *G* , it follows that the set of its vertices coincides with the set of vertices in the bipartite digraph *G*. And the set of arcs in *G* is contained in the set of arcs in *G*, therefore max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|) = |*p*(*<sup>G</sup>* )|≥|*p*(*G*)|. However, since |*p*(*G*)| ≥ max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|), the equality (1) is fulfilled. Theorem 2 is proved.

**Remark 2.** *Using the algorithm for proving Theorem 1, it is possible to construct a smallest set p*(*G*) *of good arcs that transform a bipartite digraph G into a strongly connected digraph G* 8 *. Thus, a constructive solution is given to the problem of determining the smallest set of good arcs in a bipartite digraph G.*

**Theorem 3.** *For an acyclic digraph* G*, the minimum number of good arcs that turn it into a strongly connected one is determined by the equality*

$$|p(\mathcal{G})| = \max(|V\_1|, |V\_2|).$$

**Proof of Theorem 3.** By arcs from the smallest set *p*(*G*) of good arcs, we connect the vertices of the sets *V*1, *V*2 into G. We obtain from the acyclic digraph G a strongly connected digraph in which the minimum number of good arcs |*p*(G)| = max(|*<sup>V</sup>*1|, |*<sup>V</sup>*2|). Theorem 3 is proved.

**Remark 3.** *Assume that the acyclic digraph* G *has an isolated vertex that no arcs enter into it or exit from it. Then, we may fictitiously introduce this vertex into the first and second lobes and connect these vertices with a fictitious arc. Then all further constructions are saved.*

#### **4. Recurrent Algorithm for Class Allocation Cyclic Equivalence**

This section provides one of the algorithms for converting a digraph into an acyclic digraph by allocating cyclic equivalence classes in it. There are different algorithms to solve this problem, see for example [12,28], etc. In this section, we show sequential algorithm in which at each step new vertex and arcs connecting it with previously introduced are added to the digraph. This algorithm was convenient to deal with protein networks in numerical examples [29,30].

Let us say that two vertices of a digraph are cyclically equivalent if they are included in any cycle contained in it. On the set of cyclic equivalence classes (clusters), a partial order relation is defined *v w*, if there is a path from the cluster *v* to the cluster *w*. We define a zero-one matrix ||*a*(*<sup>v</sup>*, *w*)|| by the condition *<sup>a</sup>*(*<sup>v</sup>*, *w*) = 1 ⇐⇒ *v w*. Then, the algorithm for determining the set of clusters and the matrix *a*, specifying the partial order on it, is based on the following recurrent procedure [29].

Let all vertices in the original digraph be numbered: 1, 2, ... , *n*. At step 1, a single cluster is constructed consisting of a vertex 1 and a partial order matrix *a*, consisting of a single element *a*(1, 1) = 1. Suppose that at step *t* − 1, clusters and a matrix specifying a partial order between them are given. Then, at the step *t*, the vertex *t* and the good arcs connecting this vertex to the already specified clusters are added. Then, in a digraph consisting of clusters constructed at step *t* − 1 and paths between them, after adding a vertex *t* and good arcs connecting it to already constructed clusters, sets of clusters *B*1, *B*2, *B* are determined (see Figure 6, left). The set *B*1 contains clusters into which there is a path from the vertex *t*. Similarly, the set *B*2 contains clusters from which there is a path to the vertex *t*. All other clusters fall into the set *B*, and from them there can be paths only to the clusters of the set *B*1 and paths can exist in them only from clusters of the set *B*2 (see Figure 6, left). Then, at step *t*, a new cluster [*t*] is built, consisting of the vertex *t* and the clusters of the set *A* = *B*1 ∩ *B*2, and the paths between the remaining clusters are shown in Figure 6, on the right. Then, the matrix *a* of partial order is defined by Table 1. In this table, rectangular sub matrices 0 consist of only zeros, rectangular sub matrices 1 consist of only ones, and rectangular matrices denoted by values at step *t* − 1 repeat the corresponding sub matrices of the matrix *a* at step *t* − 1 (see [29]).

**Figure 6.** The algorithm of transition from step *t* − 1 to step *t* for clusters.

**Table 1.** Algorithm of transition from step *t* − 1 to step *t* for a matrix of partial order *a*.


As a result of such clustering, the original digraph is transformed into a digraph with a set of cluster vertices. An arc is drawn between two clusters if at least one arc exists between them in the original digraph.
