Identification Conditions for the Solvability of NP-Complete Problems for the Class of Prefractal Graphs

Modern network systems (unmanned aerial vehicles groups, social networks, network production chains, transport and logistics networks, communication networks, and cryptocurrency networks) are distinguished by their multielement nature and the dynamics of connections between their elements. A number of discrete problems on the construction of optimal substructures of network systems described in the form of various classes of graphs are NP-complete problems. In this case, the variability and dynamism of the structures of network systems lead to an additional complication of the search for solutions to discrete optimization problems. At the same time, for some subclasses of dynamic graphs that are used to model the structures of network system, conditions for the solvability of a number of NP-complete problems can be distinguished. This subclass of dynamic graphs includes prefractal graphs. This article investigates NP-complete problems on prefractal graphs: a Hamiltonian cycle, a skeleton with the maximum number of pendant vertices, a monochromatic triangle, a clique, and an independent set. The conditions under which it is possible to obtain an answer about the existence of and construct polynomial (when fixing the number of seed vertices) algorithms for finding solutions for some problems are identified.


INTRODUCTION
The number of applied problems in large networks is increasing as big data analysis is developing, the number of customers is increasing, and networks are becoming more complex; studying problems on large-scale dynamic graphs is growing more urgent [1][2][3][4].
Pupyrev and Tikhonov proposed the description of dynamic graphs, reviewed the known methods of their visualization, and proposed modified algorithms with improved characteristics [2]. The indicated sequence corresponds to the concept of the trajectory of a prefractal (dynamic) graph. On the one hand, the proposed visualization algorithms for dynamic graphs are applicable to prefractal graphs as their subclass. On the other hand, identification or recognition of social networks as prefractal graphs allows one to solve difficult problems faster; moreover, the possibilities of developing parallel algorithms or parallelizing the proposed modified algorithms arise.
Belov and Vovchok proposed a method for generating the graph of a social network whose structure is similar to the known social networks [3]. The authors proposed an algorithm that takes into account the basic properties of a social network. The distinctive feature of such algorithms is the dependence on the number of communities (or clusters), rather than on the number of users. In the terminology of prefractal graphs, communities are seeds (or blocks) of various ranks and the procedure for generating a prefractal graph allows one to transfer the characteristics of seeds to the entire graph or construct a graph with predetermined characteristics differently.
In [4] Morzhov and Sokolov proposed an efficient algorithm for detecting and removing the collisions in the rules of a firewall in a local network. A tree-like structure was considered as a structure for storing the rules of the safety policy. According to [5,6], any tree can be recognized as a prefractal graph. The adapted algorithm [4] may be applied in problems of selection or competition on prefractal and dynamic graphs.

DEFINITIONS AND DESIGNATIONS
In this work we use the commonly accepted designation and definition of a graph G = (V, E) [7,8]. The definition of prefractal graphs corresponds to [5,6]. The seed is a connected n-vertex graph H = (W, Q) with unlabeled vertices v ∈ W. The prefractal graph is designated by G L = (V L , E L ), where V L is the set of vertices and E L is the set of edges. In the course of construction of a prefractal graph, we form a trajectory G 1 , G 2 , ..., G l , ..., G L . The graph constructed at step l is referred to as a prefractal graph G l of rank l.
The new edges of a graph G L are edges of rank L, and the other edges are called old edges of rank l, where l = 1, 2, ..., L is the number in the trajectory G 1 , G 2 , ..., G l , ..., G L . Below, for prefractal (n, q, L) graphs G L = (V L , E L ) we use the simplified designation G L , where q = |Q| and n = |W|. Figure 1 presents a procedure for replacing a vertex with a seed (RVS). The vertices of the graph G 1 are replaced with a complete 3-vertex seed H of arbitrary contiguity of old edges: (a) the small dashed circles label the vertices replaced by the seed; (b) the moderate dashed circles label the seeds that replace the vertices; and (c) the old edges of the graph G 2 are denoted by thick lines.
The important characteristics of a prefractal graph G L = (V L , E L ) are its number of vertices N = N(n, L) = |V L | and edges M = M(n, q, L) = |E L |, respectively: During generation we use various contiguity conditions, the most important of which are as follows: the contiguity of old edges is arbitrary (Fig. 1c); the contiguity of old edges is preserved (Fig. 2); and old edges do not intersect (Fig. 3).
The condition of preserved contiguity of old edges is applied for old edges of all ranks. In some cases, it is specially stated that we preserve the contiguity of old edges of a single or several ranks, for instance, the preservation of the contiguity of old edges with alternation.
The condition of nonintersection of old edges, or, in other words, the absence of contiguity, is applied to old edges of all ranks, including old edges of different ranks.
In the sequel, we provide the formulations of difficult classical problems presented in monograph [9]. After each problem we propose a new theorem for prefractal graphs.

Proof.
On graph G 1 there exists a Hamiltonian cycle C 1 = by the hypothesis of the theorem; thus, G 1 is the seed H. At the next step, we apply the RVS procedure to all vertices of G 1 and form G 2 ; in this case the old edges of first rank do not intersect. Alternatively, the vertices of the Hamiltonian cycle C 1 are subject to the RVS procedure and the old edges of first rank do not intersect. The edges of first rank contiguous in C 1 appear to be divided in C 1 by seeds H. At each seed we extract a Hamiltonian chain between the edges of first rank that were contiguous in C 1 . Thus, we have covered all vertices of G 2 and constructed the Hamiltonian cycle C 2 .
The condition of the theorem about the nonintersection of old edges allows the separation of the Hamiltonian cycle by subgraph seeds at each step and completion of the construction of deficient parts by Hamiltonian chains. The inverse condition of preservation of the contiguity of old edges does no allow the construction of the Hamiltonian cycle after the graph G 1 , because the seeds H at each step of generation are glued to the existing vertices and the cycle passes the common vertices at least twice. The theorem is proved.  Using the exhaustive search algorithm, separation of a Hamiltonian cycle of a chain on a seed H requires executing (n -1)! operations in the worst case. In total, on a prefractal graph G l there are (n l -1)/(n -1) ≤ n l = N seeds. Remark 1.1. In Theorem 1 and Corollary 1.1 we consider two opposite cases: the old edges do not intersect and the contiguity of the old edges is preserved. Here, the condition that old edges do not inter-  Proof. On the graph G 1 there is a skeleton T 1 = that has at least k ≤ n pendant vertices according to the hypothesis of the theorem, because G 1 is the seed H. At the next step, we apply the RVS procedure to all vertices of G 1 and generate G 2 with preservation of the contiguity of old edges. Alternatively, we apply the RVS procedure to the vertices of the skeleton T 1 with preservation of the contiguity of old edges. Separation of skeleton trees with the maximum number of pendant vertices on seeds can be executed by any known algorithm; in the worst case the algorithm requires 2 n operations. In total, on a prefractal graph G l there are (n l -1 )/(n -1) ≤ n l = N seeds.

A MONOCHROMATIC TRIANGLE Problem A monochromatic triangle.
Condition. The graph G = (V, E) is given. Question. Does a partitioning of the set E into two nonintersecting sets E 1 and E 2 exist such that no one of the graphs G 1 = (V, E 1 ) and G 2 = (V, E 2 ) contains a triangle. Proof. We consider a second-rank prefractal graph G 2 . We assume that a triangle consisting of two first-rank edges and a second-rank edge exists. We apply the operation of contracting the seeds, inverse to the RVS; then, the two adjacent first-rank edges contract into a multiple edge, which contradicts the definition of a prefractal graph. We assume that a triangle exists consisting of two second-rank edges and a first-rank edge. We apply the operation of contracting the seeds and see that two adjacent second- rank edges contract to a vertex and the first-rank edge is a loop, which also contradicts the definition of the prefractal graph. We consider a prefractal graph G l of lth rank. We assume that a triangle exists consisting of two edges of (l -1)th rank and a lth-rank edge. We apply the operation of contracting the lth-rank seeds and obtain the situation where two adjacent edges of (l -1)th rank contract to a multiple edge, which contradicts the definition of the prefractal graph. We assume that a triangle exists consisting of two lth-rank edges and a (l -1)th-rank edge. We apply the operation of contracting the lth-rank seeds and obtain the case where the two adjacent lth-rank edges contract into a vertex and an edge of (l -1)th rank is a loop, which also contradicts the definition of the prefractal graph. Thus, on a prefractal graph G l we cannot construct a triangle with edges of neighboring ranks. The theorem is proved. Proof. On a prefractal graph G l we cannot construct a triangle with edges of neighboring ranks, as we have proved in the previous theorem.
We consider a prefractal graph G l of lth rank. We assume that a triangle exists consisting of two l 1 th-rank edges and a l 2 th-rank edge, l 1 < l 2 and l 1 , l 2 ∈ [1, 2, ..., L]. We apply the operation of contracting the l 2 th-rank seeds and obtain the situation where two adjacent l 1 th-rank edges contract into a multiple edge, which contradicts the definition of the prefractal graph. We assume that a triangle exists consisting of two l 2 th-rank edges and an l 1 th-rank edge, l 1 < l 2 . We apply the operation of contracting the l 2 th-rank seeds and see that the two adjacent l 2 th-rank edges contract into a vertex and the l 1 th-rank edge is a loop, which also contradicts the definition of a prefractal graph. Now, we assume that a triangle exists consisting of an l 1 th-rank edge, a l 2 th-rank edge, and a l 3 th-rank edge, l 1 < l 2 < l 3 and l 1 , l 2 , l 3 ∈ [1, 2, ..., L]. We apply the operation of contracting the l 3 th-rank seeds and obtain the situation where two adjacent edges of l 1 th and l 2 th rank contract into a multiple edge, which contradicts the procedure for generating the prefractal graph and brings us outside the class of prefractal graphs closed with respect to the RVS operation. Thus, on a prefractal graph G l we cannot construct a triangle with edges of different ranks. The theorem is proved. Proof. A prefractal graph G 1 is a monochromatic triangle according to the hypothesis of the theorem, because it is a seed H. This means that E 1 can be partitioned into two nonintersecting sets and , each of which contains no triangles. On the second-rank graph G 2 the seeds H are added to the graph G 1 ; the set of edges of each of these seeds can be divided into two nonintersecting subsets and . We join all into a single set E' and all into another set E''. New triangles cannot appear after joining, because the edges of the secondrank seeds do not intersect. After adding to E' and to E'', no new triangles are formed, because the theorem about the nonexistence of triangles with edges of different ranks is valid. Thus, the edges of G 2 are divided into two nonintersecting subsets E' and E'' containing no triangles.
The edges of each lth-rank seed can be partitioned into two nonintersecting subsets and . We join all into a single set E' and all into another set E''. New triangles also cannot form, because the theorem of nonexistence of triangles with edges of different ranks is valid. This yields that the edges of G l are partitioned into two nonintersecting subsets E' and E'' containing no triangles.
Thus, we have proposed a procedure for partitioning the sets of edges of a prefractal graph G l , l ∈ [1, 2, ..., L] into two nonintersecting subsets E' and E'' containing no triangles. The procedure is executed step-by-step from the graph G 1 to G 2 and further to G l inclusively. The theorem is proved. With the use of the exhaustive-search algorithm, partitioning of a set of edges on a seed H requires execution of 2 n operations in the worst case. Altogether, on prefractal graph G l there are (n l -1)/(n -4. A CLIQUE Problem 4. Condition. The graph G = (V, E) and a positive integer number K ≤ |V| are given. Question. Is it true that G contains a clique with a size not smaller than K? In other words, does a subset V' ⊆ V exist such that |V'| ≥ K and any two vertices in V' are joined by an edge from E? Theorem 4. If a seed H includes a clique with a size not smaller than k ≤ n, then on the prefractal graph G l , l ∈ [1, 2, ..., L] a clique exists with a size not smaller than k.
Proof. On a prefractal graph G l , on lth-rank seeds there are cliques with a size not smaller than k due to the condition of the theorem.
The cliques of size k separated on lth-rank seeds cannot be increased due to the old edges of previous ranks. The clique contains triangles and in order to proceed to a clique of size (k + 1) we need to use the edges of previous ranks (the edges of different seeds of the same rank do not intersect). However, we cannot construct triangles with edges of different ranks due to the limitations of the theorem about the nonexistence of triangles consisting of edges of different ranks. Thus, by choosing any clique of size k on the seeds we cannot increase it to the size (k + 1) on a prefractal graph. The theorem is proved.

AN INDEPENDENT SET Problem 5.
Condition. The graph G = (V, E) and a positive integer number K ≤ |V| are given. Question. Is it true that G contains an independent set of power not less than K? In other words, is it true that a subset V' ⊆ V exists such that |V'| ≥ K and no two vertices in V' are joined by an edge from E? Theorem 5. If a seed H contains an independent set of power not less than k ≤ n and the contiguity of old edges is preserved, then the prefractal graph G l , l ∈ [1, 2, ..., L] contains an independent set of power K ≤ kn l -1 .
Proof. According to the hypothesis of the theorem, G 1 contains an independent set of power not less than k, because it is the seed H. Upon separating an independent set on G 1 , we transfer the contiguous vertices to the set . At the next step, we remove the vertices of from G 1 and transfer them to . Then, in all new second-rank seeds do not intersect (due to preservation of the contiguity of old edges) because the new vertices with contiguous old first-rank edges are removed. On the truncated seeds we separate the independent sets and preserve them in and place all the contiguous vertices in . The set contains the vertices removed at the first step from G 1 and at the second step from G 2 .
At the next step, we remove the vertices of from G 3 and transfer them to . Then, in all the new seeds of third rank do not intersect, because the vertices with contiguous old edges of second rank have been removed. On the truncated seeds of we separated the independent sets and preserved them in and placed all contiguous vertices in . The set contains the vertices that were removed at the first step from G 1 , at the second step from G 2 , and at the third step from G 3 .
The procedure for generating the graphs of trajectory G l , l = 2, 3, ..., L from the seeds H forms the independent sets on the prefractal graphs G l . Thus, for any prefractal graph G l of rank l ∈ [1, 2, ..., L] an independent set of power K ≤ kn l -1 is separated. The theorem is proved.
CONCLUSIONS In this work we considered and studied NP-complete problems on one of the classes of dynamic graphs, on prefractal graphs. For each of the problems we provided the solvability conditions at which for certain subproblems we can obtain the answer about the existence of and construct the polynomial (for a fixed number of vertices in the seed) algorithms for searching the solutions. Several corollaries generalize the results or provide the conditions when there is no solution. As an example, for the problem of separat- ing the Hamiltonian cycle, we provided the condition where there is no solution on a prefractal graph. For certain problems we calculated the computational complexities of searching the solutions.
In the present work we investigated a small part of the known NP-complete problems. Studying the full list of problems and determining the solvability conditions for a class of dynamic graphs, that is, prefractal graphs, allows one to separate an entire subclass of graphs with solvability conditions of NP-complete problems.
Development of polynomial (for a fixed number of vertices in the seed) algorithms for dynamic graphs will allow solving well-known applied problems with improved characteristics: separation of subgraphs in large dynamic networks, that is, separation of communities in social networks; solution of multicriteria problems in large-scale transport-logistical systems; detection and separation of DDOS attacks in cryptocurrency systems; and many others.