Research of NP-Complete Problems in the Class of Prefractal Graphs

: NP-complete problems in graphs, such as enumeration and the selection of subgraphs with given characteristics, become especially relevant for large graphs and networks. Herein, particular statements with constraints are proposed to solve such problems, and subclasses of graphs are distinguished. We propose a class of prefractal graphs and review particular statements of NP-complete problems. As an example, algorithms for searching for spanning trees and packing bipartite graphs are proposed. The developed algorithms are polynomial and based on well-known algorithms and are used in the form of procedures. We propose to use the class of prefractal graphs as a tool for studying NP-complete problems and identifying conditions for their solvability. Using prefractal graphs for the modeling of large graphs and networks, it is possible to obtain approximate solutions, and some exact solutions, for on natural


Introduction
The beginning of the study of intractable problems is associated with the possibility of eliminating enumeration to find the optimal solution and create a polynomial algorithm. In the case of an exponential number of variants of solutions, the exhaustive algorithm does not allow one to find the optimal solution in an acceptable time and becomes intractable or even unsolvable. The efficiency of finding a solution and the complexity of the algorithm are estimated based on the solution time, limited by a function of the size of the problem. In discrete mathematics, two classes of problems are considered: the NP class of all exhaustive problems and the class P of exhaustive problems solvable in polynomial time (in classical terminology, with a Turing machine). In the NP class, typical (NP-complete) problems that set the "standard" of complexity are distinguished. Any problem from NP reduces polynomially to an NP-complete problem [1].
In [2], using the examples of the simple max cut, node cover, and directed Hamiltonian path problems, it was shown that a number of NP-complete problems remain NP-complete even when their domains are substantially restricted. In [3], a special class of indefinite quadratic programs with simple constraints and integer data was proposed. It was shown that the problem of checking that a given feasible solution is not a local minimum (or that the objective function is not bounded from below on the set of feasible solutions) in this class is NP-complete. In [4] some new graph problems (the optimal linear cut arrangement, optimal directed tree arrangement and arrangements on a grid) were added to the list of known NP-complete problems. Despite the significant amount of work on NP-completeness in the past years, research on this topic remains relevant. This also applies to graph problems. Among the modern approaches are the following. To study such NP-complete problems as the min dominating set, max independent set, max clique, etc., the effectiveness and ineffectiveness of all nodes in the given graph are computed in [5]. The use of modern methods and capabilities of computer science for solving well-known It should be noted that the first studies of Sierpinski carpets were carried out back in the 1990s [31,32]. In those publications, geometric objects were considered as one of the types of fractals [33]. Later, in the 2000s, publications appeared offering definitions of Sierpinski graphs from the classical point of view, when a graph is given sets of vertices and edges [34][35][36]. Recently, researchers have proposed a uniform definition of Sierpinski graphs [37,38]. As mentioned above, Sierpinski graphs belong to the class of prefractal graphs, and for which specific generation rules are given, that is, Sierpinski graphs are also prefractal graphs. All results obtained for Sierpinski graphs apply to the corresponding type of prefractal graphs, including optimization problems-finding the shortest paths, Hamiltonian subgraphs, coloring, etc. [39][40][41].
Sierpinski graphs generated by a triangle (complete 3-vertex graph) or square (complete 4-vertex graph or 4-vertex cycle) are often considered. Following the rules for generating a prefractal graph, both simple graphs with 3-4 vertices and complex graphs with a large number of vertices and connections can act as a basis, where it is possible to specify the preservation of the edge adjacency or to specify an arbitrary adjacency. In the case of weighing a prefractal graph, a similarity coefficient is set, which changes the weights of the edges at each step. The following are some commonly used definitions of prefractal graphs.
The generally accepted definitions and notation = ( , ) for graphs are used [42,43]. Most of the definitions of a class of prefractal graphs are shown in [44,45]. A seed is a connected graph = ( , ) with unlabeled vertices ∈ . Seeds-also called graphlets-are small connected non-isomorphic induced subgraphs of a large graph or network [46][47][48]. Graphlets were first used to design highly sensitive measures of network local structural similarities [49]. However, graphlets are used more often in specific formulations of problems; therefore, in this work, a general definition of a seed is used. A prefractal graph is denoted as = ( , ), where is the set of vertices, and is the set of edges. In what follows, a simplified notation is used for known (canonical) prefractal graphs = ( , ). In the process of constructing a prefractal graph, a trajectory is formed , , … , . The graph constructed at step = 1,2, … . , is called a prefractal graph of rank . The new edges of the graph are the edges of rank , and the remaining edges are the old edges of the rank .
As → ∞, the graph is fractal. The first mentions of fractal graphs can be found in [50]. A fractal graph, like a fractal, is an infinite object. For a fixed value of rank , a prefractal graph is considered. For example, as shown above for = the graph is considered. Sierpinski graphs generated by a triangle (complete 3-vertex graph) or square (complete 4-vertex graph or 4-vertex cycle) are often considered. Following the rules for generating a prefractal graph, both simple graphs with 3-4 vertices and complex graphs with a large number of vertices and connections can act as a basis, where it is possible to specify the preservation of the edge adjacency or to specify an arbitrary adjacency. In the case of weighing a prefractal graph, a similarity coefficient is set, which changes the weights of the edges at each step. The following are some commonly used definitions of prefractal graphs.
The generally accepted definitions and notation G = (V, E) for graphs are used [42,43]. Most of the definitions of a class of prefractal graphs are shown in [44,45]. A seed is a connected graph H = (W, Q) with unlabeled vertices v ∈ W. Seeds-also called graphletsare small connected non-isomorphic induced subgraphs of a large graph or network [46][47][48]. Graphlets were first used to design highly sensitive measures of network local structural similarities [49]. However, graphlets are used more often in specific formulations of problems; therefore, in this work, a general definition of a seed is used.
A prefractal graph is denoted as G L = (V L , E L ), where V L is the set of vertices, and E L is the set of edges. In what follows, a simplified notation G L is used for known (canonical) prefractal graphs G L = (V L , E L ). In the process of constructing a prefractal graph, a trajectory is formed G 1 , G 2 , . . . , G L . The graph constructed at step l = 1, 2, . . . ., L is called a prefractal graph G l of rank l. The new edges of the graph G L are the edges of rank L, and the remaining edges are the old edges of the rank l.
As l → ∞ , the graph G l is fractal. The first mentions of fractal graphs can be found in [50]. A fractal graph, like a fractal, is an infinite object. For a fixed value of rank l, a pre-fractal graph is considered. For example, as shown above for l = L the graph G L is considered. Figure 2 shows an example of replacing the vertices of a graph G 1 with a full 3-vertex seed H with an arbitrary adjacency of old edges: (a) small dashed circles outline the vertices replaced by the seed; (b) the middle dashed circles outline the seeds that replace the vertices; (c) old edges of the graph are marked with bold lines. Figure 2 shows an example of replacing the vertices of a graph with a full 3-vertex seed with an arbitrary adjacency of old edges: (a) small dashed circles outline the vertices replaced by the seed; (b) the middle dashed circles outline the seeds that replace the vertices; (c) old edges of the graph are marked with bold lines. The essential characteristics of a prefractal graph = ( , ) are the number of its vertices (1) and edges (2).
where = | | is the number of vertices of seed .
= ( , , ) = | | = (1 + + + ⋯ + ) = ( − 1)/( − 1), where = | | is the number of edges of seed . This article explores some NP-complete problems in the class of prefractal graphs and conditions for their solvability for particular statements. The purpose of this work is to lay the foundations for creating rules for determining conditions for the polynomial solvability of problems on prefractal graphs, and also to acquaint readers with these kinds of graphs as prefractal graphs.
Further, we present new theorems for particular problems in the class of prefractal graphs. The classical formulations of intractable problems are taken from [1].

Subgraph Isomorphism
INSTANCE: Graphs = ( , ), = ( , ). QUESTION: Does contain a subgraph isomorphic to ? An algorithm for the minimal numbering of the vertices is proposed to formulate and prove the theorem on the question of isomorphism. Let prefractal graph be generated by a complete seed, preserving the adjacency of the old edges. Figure 3 shows a prefractal graph generated by a 4-vertex seed-a complete graph where old edges are adjacent. The bold lines mark the edges of the seed of the first The essential characteristics of a prefractal graph G L = (V L , E L ) are the number of its vertices (1) and edges (2).
where n = |W| is the number of vertices of seed H. M = M(n, q, L) = |E L | = q 1 + n + n 2 + · · · + n L−1 = q n L − 1 /(n − 1), where q = |Q| is the number of edges of seed H. This article explores some NP-complete problems in the class of prefractal graphs and conditions for their solvability for particular statements. The purpose of this work is to lay the foundations for creating rules for determining conditions for the polynomial solvability of problems on prefractal graphs, and also to acquaint readers with these kinds of graphs as prefractal graphs.
Further, we present new theorems for particular problems in the class of prefractal graphs. The classical formulations of intractable problems are taken from [1].

Subgraph Isomorphism
. QUESTION: Does G contain a subgraph isomorphic to H? An algorithm for the minimal numbering of the vertices is proposed to formulate and prove the theorem on the question of isomorphism. Let prefractal graph G L be generated by a complete seed, preserving the adjacency of the old edges. Figure 3 shows a prefractal graph G 3 generated by a 4-vertex seed-a complete graph where old edges are adjacent. The bold lines mark the edges of the seed of the first rank, and the dashed circles outline the seed of the second and third ranks. Following Algorithm 1 (NUM), the vertices of the prefractal graph G 3 are numbered by n = 4. prefractal graph G L = (V L , E L ). Output : the minimum numbering of the vertices of G L by a number n.

2.
At the output of step 1, one vertex of the seed z (2) s of the second rank is numbered, which also belongs to the seed z (1)

.
Sequentially number the remaining (n − 1) vertices of z (2) s , s = 1, n with numbers from the set {1, 2, . . . , n} different from the already numbered vertices. for l = 3 to L do: l.
At the output of step l − 1, one vertex of the seed z (l) s of the rank l is numbered, which also belongs to the seed z rank, and the dashed circles outline the seed of the second and third ranks. Following Algorithm 1 (NUM), the vertices of the prefractal graph are numbered by = 4. Аlgorithm 1 Algorithm for the Minimal Numbering of the Vertices (NUM) Input: prefractal graph = ( , ).
Output: the minimum numbering of the vertices of by a number . 1.
Sequentially number the vertices of the seed ( ) of the first rank with numbers 1,2, … , .

2.
At the output of step 1, one vertex of the seed ( ) of the second rank is numbered, which also belongs to the seed ( ) .
At the output of step − 1, one vertex of the seed ( ) of the rank is numbered, which also belongs to the seed ( ) .
Sequentially number the remaining ( − 1) vertices of ( ) , = 1, with numbers from the set {1,2, … , } different from the already numbered vertices.  Proof of Theorem 1. Since the seed is a complete graph, the minimum possible number for numbering the vertices is at least = | |. At the first step, the vertices of the graph or, in another way, the seed ( ) of the first rank are numbered with 1,2, … , . In the second step, we consider a graph in which the vertices are already numbered. Each vertex of ( ) is included in only one seed of the second rank ( ) , = 1, due to the Proof of Theorem 1. Since the seed is a complete graph, the minimum possible number for numbering the vertices is at least n = |W|. At the first step, the vertices of the graph G 1 or, in another way, the seed z 1 of the first rank are numbered with 1, 2, . . . , n. In the second step, we consider a graph G 2 in which the n vertices are already numbered. Each vertex of z (1) 1 is included in only one seed of the second rank z (2) s , s = 1, n due to the preserving of the adjacency of the old edges of the first rank. The vertices common for z (1) 1 and z (2) s are already numbered, that is, in each seed z (2) s one vertex is numbered with a number from {1, 2, . . . , n}. Then the remaining n − 1 vertices of z (2) s are numbered differently from those 1 . Since the seed is a complete graph, the vertices of z (2) s can be numbered at least with n. At the following steps l = 3, 4, . . . , L the order of numbering is repeated, in each G l seeds z (l) s , s = 1, n l−1 are added. Since the added seed z (l) s is a complete graph, the minimum possible number for numbering the vertices of G l is at least n. Furthermore, the preservation of the adjacence of the old edges of G l guarantees the numbering of the vertices, the newly added seeds, by numbers 1 + (n − 1) = n. Consequence 1. Algorithm 1 enumerates the vertices of a prefractal graph, the adjacency of the old edges of which is preserved, no more than n numbers.

Theorem 2. Any two prefractal graphs G
L are isomorphic if the adjacence of the old edges is preserved, the seeds H 1 = (W 1 , Q 1 ), H 2 = (W 2 , Q 2 ) that generate them are complete graphs, and |W 1 | = |W 2 |.
Proof of Theorem 2. Following the definition of isomorphism of two graphs, it is necessary to set a one-to-one mapping f : V 1 L → V 2 L such that any two vertices u and v of G 1 L are adjacent if and only if the vertices f (u) and f (v) are adjacent in G 2 L . In other words, if there is an edge e ∈ E 1 L between two vertices in G 1 L , then there is an edge f (e) ∈ E 2 L in G 2 L . Seeds H 1 , H 2 and, accordingly, graphs G 1 1 , G 2 1 are isomorphic since they are complete graphs according to the conditions of the theorem. Using Algorithm 1, the vertices of G 1 1 and G 2 1 are numbered with the minimum number n = |W 1 | = |W 2 |. Next, we consider the graphs G 1 2 , G 2 2 of the second rank in the trajectory l = 1, 2, . . . , L. Seeds of the first rank are isomorphic due to the isomorphism G 1 1 and G 2 1 . Seeds of the second rank are isomorphic due to the isomorphism H 1 and H 2 . Thus, for any edge between a pair of vertices in G 1 2 , there is an edge between a pair of vertices in G 2 2 that is confirmed by the numbering of the vertices of both graphs.
The adjacency of the old edges in G 1 L , G 2 L and the generation by complete n-vertex seeds in the trajectory l = 1, 2, . . . , L provides, due to isomorphism H 1 and H 2 , the isomorphism of prefractal graphs. In other words, at each step of the trajectory l = 1, 2, . . . , L, isomorphic seeds are added to the isomorphic graphs G 1 l , G 2 l . Consequence 2. Any two prefractal graphs G 1 l , G 2 l are isomorphic in the trajectory l = 1, 2, . . . , L, if the adjacency of the old edges is preserved, and the seeds that generate them are complete n-vertex graphs.
Theorem 2 deals with unweighted prefractal graphs. In the case of prefractal graphs weighted by the similarity coefficient, we will talk about interval isomorphism when the weights of two compared edges lie on the same interval.
A prefractal graph G L = (V L , E L ) is called weighted if a real number w(e l ) ∈ θ l−1 a, θ l−1 b is assigned to each of its edges e l ∈ E L , where l = 1, 2, . . . , L is the rank of the edge, a > 0, θ < a/b.

Consequence 3.
Any two weighted prefractal graphs are interval isomorphic if the adjacency of the old edges is preserved; the seeds that generate them are complete n-vertex graphs.

Degree Constrained Spanning Tree
Is there a spanning tree for G in which no vertex has degree larger than K?
An algorithm for finding a spanning tree is proposed to formulate and prove the theorem on the degree constrained spanning tree. Let prefractal graph G L be generated with an arbitrary adjacency of the old edges.
As a procedure, instead of Prim's algorithm, it is possible to use any other known algorithms for finding a spanning tree on a graph. Figure 4 shows a prefractal graph G 3 generated by the 4-vertex seed-a complete graph, the old edges of which are not adjacent. At the first step of the algorithm ( Figure 4a) spanning trees of the seeds of the third rank are selected, at the second step ( Figure 4b) the spanning trees of the second rank seeds are selected. At the third step (Figure 4c), the spanning tree is selected on the graph G 1 , which corresponds to the selection of the spanning tree of the entire prefractal graph G 3 .
An algorithm for finding a spanning tree is proposed to formulate and prove the theorem on the degree constrained spanning tree. Let prefractal graph be generated with an arbitrary adjacency of the old edges.
As a procedure, instead of Prim's algorithm, it is possible to use any other known algorithms for finding a spanning tree on a graph. Figure 4 shows a prefractal graph generated by the 4-vertex seed-a complete graph, the old edges of which are not adjacent. At the first step of the algorithm ( Figure  4a) spanning trees of the seeds of the third rank are selected, at the second step ( Figure  4b) the spanning trees of the second rank seeds are selected. At the third step (Figure 4c), the spanning tree is selected on the graph , which corresponds to the selection of the spanning tree of the entire prefractal graph .    prefractal graph G L = (V L , E L ). Output: spanning tree T L = V L , E * L of G L . for l = L to 1 do: for s = 1 to n l−1 do: At the output of step L, k = n L − 1 /(n − 1) spanning trees T form a spanning forest of connected n L−2 componentsblocks of the second rank. Since spanning trees are added to spanning trees from high to low rank through one vertex, the new components are also spanning trees without cycles. Thus, passing step-by-step from L to the second rank, we obtain n spanning trees-blocks  Figure 5 shows the steps of the sequential selection of spanning trees for G 1 , G 2 , G 3 . At the first step, a spanning tree is selected for G 1 and the same edges are highlighted by a bold line on G 3 (a). At the second and third steps, the spanning trees for G 2 (b), G 3 (c) are respectively selected. Consequence 4. Algorithm 2 selects a minimum weight spanning tree of a prefractal graph weighted by a similarity coefficient < / .
Prim's procedure uses the weights of the spanning trees obtained in the previous steps and maintains a minimum weight at each rank = , − 1, … ,1. At rank , the procedure corresponds to the classical Prim algorithm. At rank − 1, the procedure uses the spanning trees obtained in the seeds of rank . Each vertex in the seeds of the rank − 1 is assigned a weight of the minimum spanning tree of the corresponding seed of the rank . Furthermore, the search for the minimum spanning tree of the current seed of the rank − 1 is carried out, taking into account the total weight of the vertex-edge-vertex. Figure 6 shows an example of the calculation of the total weight of a vertex-edgevertex. To search for the minimum spanning tree ( ) the weights of the vertices , , are used, ( ) = ( ( ) ), ( ) = ( ( ) ), ( ) = ( ( ) ). Prim's procedure uses the total weight of an edge : ( ) + ( ) + ( ). It is assumed that the prefractal graph is connected; otherwise, the algorithm will result in a spanning forest of minimum weight.  Prim's procedure uses the weights of the spanning trees obtained in the previous steps and maintains a minimum weight at each rank l = L, L − 1, . . . , 1. At rank L, the procedure corresponds to the classical Prim algorithm. At rank L − 1, the procedure uses the spanning trees obtained in the seeds of rank L. Each vertex in the seeds of the rank L − 1 is assigned a weight of the minimum spanning tree of the corresponding seed of the rank L. Furthermore, the search for the minimum spanning tree of the current seed of the rank L − 1 is carried out, taking into account the total weight of the vertex-edge-vertex. Figure 6 shows an example of the calculation of the total weight of a vertex-edgevertex. To search for the minimum spanning tree z 3 ). Prim's procedure uses the total weight of an edge e : w(v ) + w(e ) + w(v ). It is assumed that the prefractal graph is connected; otherwise, the algorithm will result in a spanning forest of minimum weight.  Proof of Theorem 4. The maximum degree of vertices of a spanning tree of seed is following the conditions of the theorem. In the process of generating a prefractal graph at each step = 1,2, … , , each vertex can be incident to only one old edge due to the condition that any old edges are not adjacent. Thus, any vertex of spanning tree in the trajectory , , … , has a degree or + 1 in the case of incidence with the old edge. In other words, the spanning tree of contains only vertices with degrees at most = + 1. □ Consequence 6. If the old edges are not adjacent, there is a spanning tree for any prefractal graph , = 1,2, … , in which no vertex has a degree larger than = + 1.

Remark 2.
If the old edges are adjacent, there is a spanning tree for any prefractal graph in which vertexes have a degree from to • .  At each step, the algorithm selects the minimum spanning trees for z (l) s , s = 1, n L−1 . Prim's algorithm takes less than O n 2 time. Prim's procedure includes two additional operations for adding the weights of the vertices: (2n) 2 = 4n 2 . In total, one will perform (n L − 1)/(n − 1)·2n 2 ≤ n L ·4n 2 = 4n 2 ·N operations. Theorem 4. If the old edges are not adjacent, there is a spanning tree for any prefractal graph G L in which no vertex has a degree larger than K = k + 1, where k-the maximum degree of vertices of a spanning tree of the seed.

Maximum Leaf Spanning Tree
Proof of Theorem 4. The maximum degree of vertices of a spanning tree of seed H is k following the conditions of the theorem. In the process of generating a prefractal graph at each step l = 1, 2, . . . , L, each vertex can be incident to only one old edge due to the condition that any old edges are not adjacent. Thus, any vertex of spanning tree in the trajectory G 1 , G 2 , . . . , G L has a degree k or k + 1 in the case of incidence with the old edge. In other words, the spanning tree of G L contains only vertices with degrees at most K = k + 1.

Consequence 6.
If the old edges are not adjacent, there is a spanning tree for any prefractal graph G l , l = 1, 2, . . . , L in which no vertex has a degree larger than K = k + 1.

Remark 2.
If the old edges are adjacent, there is a spanning tree for any prefractal graph G L in which vertexes have a degree from k to k·L. Proof of Lemma 5. Let a prefractal graph generated by a seed be a connected graph. Otherwise, since the prefractal graph will consist of several connected components, it is impossible to select a connected spanning tree. Following the procedure for replacing vertices with a seed, each vertex of G 1 is replaced with a seed H. The old edges are adjacent to the new edges in an arbitrary order. In G 2 each vertex is incident with new edges, and some of the vertexes are incident with old edges. Thus, vertices incident to both old edges and new ones cannot be leaf vertices. Only the vertices incident to the new edges are leaf vertices. Continuing the procedure for generating a prefractal graph, at each step l = 1, 2, . . . , L the vertices are replaced with seed. Vertices of G L−1 were replaced by seeds, and only vertices incident to new edges can be a leaf. In other words, the leaf vertices of G L are placed in seeds of the rank L. In the case of generating a spanning tree, leaf vertices are also placed in seeds of the rank L, as in any arbitrary case described above.

Maximum Leaf Spanning Tree
Consider the case of the selection of a spanning tree of an arbitrary G L . Suppose that any leaf vertex is incident only to the old edge, but this contradicts the definition of a connected prefractal graph. Any vertex is incident to a new edge. Thus, any vertex incident to the old edge is also incident to the new edge and is not a leaf vertex, and the leaf vertex of the spanning tree can only be incident to a new edge. In other words, leaf vertices of any spanning tree of a prefractal graph are placed in seeds of the rank L.

Theorem 6.
If there is a spanning tree for the seed H with at least k ≤ n leaf vertices and the adjacency of old edges is preserved, then there is a spanning tree for the prefractal graph G l , l = 1, 2, . . . , L with at least K = (k − 1)·n l−1 leaf vertices.
Proof of Theorem 6. According to the lemma, the leaf vertices of any spanning tree are placed in the seeds of the rank L. Let us consider step-by-step the procedure for generating a prefractal graph and selecting its spanning tree.
There is a spanning tree T 1 = T 1 1 of G 1 = H with at least k ≤ n leaf vertices according to the hypothesis of the theorem. At the next step, all vertices G 1 are replaced with a seed H and G 2 is formed while preserving the adjacence of the old edges. The same goes for T 1 . The spanning trees T 2 s in seeds of the second rank and T 1 forms spanning tree T 2 in G 2 . Only leaf vertices in T 2 s can be leaf vertices in T 2 . T 2 s are actually attached to T 1 by one vertex. In the minimal case, T 2 s can be attached with its leaf vertex, then the number of leaf vertices of T 2 is equal to (k − 1)·n. By selecting T l s in the trajectory l = 1, 2, . . . , L the spanning trees T l of G l are formed. Thus, a spanning tree T l with at least (k − 1)·n l−1 vertices are selected for each G l , l = 1, 2, . . . , L.
When the old edges are not adjacent and the seed is the star, there is the maximum increase of leaf vertices in G L . Then there are (n − 1) leaf vertices in G 1 . The old edges are at first not incident to leaf vertices, and then are incident to leaf vertices. Then there are n 2 − 2(n − 1) leaf vertices in G 2 and n n 2 − 2(n − 1) − 2(n − 1) in G 3 . Furthermore, K = n l − 2n l−1 + 2 leaf vertices remain in G l , l = 1, 2, . . . , L. The selection of spanning trees with the maximum number of leaf vertices in seeds can be carried out by means of any known algorithm. In the worst case, it will require 2 n operations. In total, there are n l = N seeds in G l . Figure 7 shows several examples of the generation of spanning trees, and the numbers of leaf vertices for them are calculated:

Balanced Complete Bipartite Subgraph
Theorem 7. A complete bipartite subgraph exists only on the seed for any prefractal graph.
Proof of Theorem 7. The complete bipartite subgraph G 1 = V 1 1 , V 2 1 , E 1 of graph G 1 matches with the complete bipartite subgraph H = W 1 , W 2 , Q of the seed H according to the conditions of the theorem.
Next, we consider the case of generating a prefractal graph while preserving the adjacency of old edges. Spanning complete bipartite subgraphs are selected in the seeds (including all vertices) of G 2 . Otherwise, the subgraph of G 2 may split into separate components. Let one vertex w ∈ W 1 be incident to the old edges of G 1 or, in another way, w also belongs to the part V 1 1 (see Figure 8). Then, to preserve the bipartition, set W 1 is included in V 1 1 : where each vertex of one part must be adjacent to each vertex of the second part. Thus, the selection of a complete bipartite subgraph of any seed in G 2 does not allow the formation of a complete bipartite subgraph G 2 in G 2 . Adhering to the proof of violation of the completeness in G l , l = 1, 2, . . . , L it is impossible to select a spanning complete bipartite subgraph G l .
Next, we consider the case of generating a prefractal graph while preserving the adjacency of old edges. Spanning complete bipartite subgraphs are selected in the seeds (including all vertices) of . Otherwise, the subgraph of may split into separate components. Let one vertex ∈ be incident to the old edges of or, in another way, also belongs to the part (see Figure 8). Then, to preserve the bipartition, set is included in : ⊂ . The second set is included in : ⊂ . Since the adjacence of the old edges is preserved, vertices of are not adjacent to vertices (except vertices ). Then the definition of completeness of a bipartite graph is violated, where each vertex of one part must be adjacent to each vertex of the second part. Thus, the selection of a complete bipartite subgraph of any seed in does not allow the formation of a complete bipartite subgraph in . Adhering to the proof of violation of the completeness in , = 1,2, … , it is impossible to select a spanning complete bipartite subgraph . □ Figure 8. Prefractal graph generated by a complete bipartite seed, preserving the adjacency of old edges.
Next, we consider the case of generating a prefractal graph, the adjacency of the old edges of which is not preserved. The old edges and the adjacent ones in are not adjacent in (see Figure 9). The ends and of the old edges belong to the same part . Otherwise, the condition of bipartition is violated, and the vertices , will be adjacent. The second end of the old edge in a bipartite seed should be adjacent to . However, such an edge does not exist since the old edges are not adjacent, and the new edges are present only in the seeds. Thus, the condition of completeness of the bipartite graph is violated. Thus, when the adjacency of the old edges in is not preserved, it is impossible to form a complete bipartite subgraph . Following the proof of violation of the completeness, it is impossible to select a spanning complete bipartite subgraph , = 1,2, … , . Next, we consider the case of generating a prefractal graph, the adjacency of the old edges of which is not preserved. The old edges e 1 and e 2 the adjacent ones in G 1 are not adjacent in G 2 (see Figure 9). The ends w 1 and w 2 of the old edges belong to the same part W 2 . Otherwise, the condition of bipartition is violated, and the vertices w 1 , w 2 will be adjacent. The second end w 2 of the old edge e 2 in a bipartite seed should be adjacent to w 1 . However, such an edge does not exist since the old edges are not adjacent, and the new edges are present only in the seeds. Thus, the condition of completeness of the bipartite graph is violated. Thus, when the adjacency of the old edges in G 2 is not preserved, it is impossible to form a complete bipartite subgraph G 2 . Following the proof of violation of the completeness, it is impossible to select a spanning complete bipartite subgraph G l , l = 1, 2, . . . , L.
For each graph G l with an arbitrary adjacency of old edges, it is possible to select a complete bipartite subgraph separately on each seed of rank l = 1, 2, . . . , L. It corresponds to generating a prefractal graph by a seed, and is thus a complete bipartite graph.
If the adjacency of the old edges is preserved, a complete bipartite subgraph can be selected only in a single seed of any rank, and in the case when the old edges are not adjacent, only in a single seed of rank L.

Consequence 9.
A balanced complete bipartite subgraph exists only in a single seed of any prefractal graph. For each graph with an arbitrary adjacency of old edges, it is possible to select a complete bipartite subgraph separately on each seed of rank = 1,2, … , . It corresponds to generating a prefractal graph by a seed, and is thus a complete bipartite graph.
If the adjacency of the old edges is preserved, a complete bipartite subgraph can be selected only in a single seed of any rank, and in the case when the old edges are not adjacent, only in a single seed of rank .

Consequence 9.
A balanced complete bipartite subgraph exists only in a single seed of any prefractal graph. An algorithm for selecting a bipartite subgraph is proposed to formulate and prove the theorem. Let prefractal graph be generated with preserving the adjacency of the old edges, and there is a spanning bipartite subgraph on the seed. The following is a description of an algorithm for packing a prefractal graph into a bipartite graph.

Bipartite Subgraph
Algorithm 3 can be immediately applied to a prefractal graph generated by a bipartite seed. Any known algorithm for selecting a bipartite subgraph can be used as a procedure. Figure 9. Prefractal graph G 2 generated by a complete bipartite seed; old edges are not adjacent.

Bipartite Subgraph
An algorithm for selecting a bipartite subgraph is proposed to formulate and prove the theorem. Let prefractal graph G L be generated with preserving the adjacency of the old edges, and there is a spanning bipartite subgraph on the seed. The following is a description of an algorithm for packing a prefractal graph into a bipartite graph.
Algorithm 3 can be immediately applied to a prefractal graph generated by a bipartite seed. Any known algorithm for selecting a bipartite subgraph can be used as a procedure.

Algorithm 3 Algorithm for Packing a Bipartite Graph
Input: prefractal graph G L = (V L , E L ). Output: spanning bipartite subgraph Select a bipartite subgraph G 1 = V 1 1 , V 2 1 , E 1 of G 1 using the procedure. This action corresponds to the selection of a bipartite subgraph H = W 1 , W 2 , Q of H. for l = 2 to L do: for s = 1 to n l−1 do: l.s. Select a bipartite subgraph H (l) s = W 1 l,s , W 2 l,s , Q l,s of seed z (l) s using the procedure. G l = V 1 l , V 2 l , E l is formed as follows: one part W 1 l,s is added to the part of G l−1 with which it intersects; the second part W 2 l,s is added to the part of G l−1 that has no common vertices.
At the output of step L, spanning bipartite subgraphs G 1 , G 2 , . . . , G L are selected, which corresponds to the selection of a bipartite subgraph of the prefractal graph G L . Procedure for Selecting a Spanning Bipartite Subgraph Input: graph G = (V, E). Output: spanning bipartite subgraph G = V 1 , V 2 , E of G. Figure 10 shows subgraphs G 1 , G 2 , G 3 that correspond to prefractal graphs generated by a bipartite seed. G 1 is a bipartite subgraph H . Algorithm 3 for packing bipartite graphs G 2 , G 3 is applied.
is a bipartite subgraph . Algorithm 3 for packing bipartite graphs , is applied.

Theorem 8.
If there is a bipartite subgraph H = W 1 , W 2 , Q for the seed H and the adjacency of old edges is preserved, then there is a bipartite subgraph G l = V 1 l , V 2 l , E l for the prefractal graph G l , l = 1, 2, . . . , L with E l = K where K = k· n l − 1 /(n − 1), k = |Q |.
s is selected. One part W 1 2,1 is added to the part of G 1 with which it intersects; the second part W 2 2,1 is added to the part of G 1 that has no common vertices: Since the adjacency of the old edges is preserved, then H 1 and G 1 is equal to E 1 + |Q 2,1 | = k + k = 2k. The selection of alternately bipartite subgraphs H (2) s in the remaining seeds z (2) s and the addition of parts W 1 2,s , W 2 2,s to V 1 2 , V 2 2 in the same way corresponds to the selection of a bipartite subgraph G 2 in G 2 . Furthermore, since G 2 contains one seed of the first rank and n seeds of the second rank, |E 2 | = k·|Q | = k·(n + 1). Next, G 3 , G 4 , . . . , G L are sequentially considered, for which G 3 , G 4 , . . . , G L are selected in accordance with the described approach. Adding bipartite subgraphs H of seeds H does not violate the definition of a bipartite graph. All vertices within one part are not adjacent, and adjacency exists only between vertices of two different parts.
Consequence 10. The proof of Theorem 8 is the justification of Algorithm 3.

Planar Subgraph
The union of two planar graphs at one common vertex is also a planar graph.
Proof of Lemma 9. When two planar graphs G 1 = (V 1 , E 1 ) and G 2 = (V 2 , E 2 ) are united at one common vertex w * no new edges appear in G * = G 1 ∪ G 2 (see Figure 11).
late the definition of a bipartite graph. The total number of edges ( ) and is equal to | | + , = + = 2 . The selection of alternately bipartite subgraphs ( ) in the remaining seeds ( ) and the addition of parts , , , to , in the same way corresponds to the selection of a bipartite subgraph in . Furthermore, since contains one seed of the first rank and seeds of the second rank, | | = • | | = • ( + 1). Next, , , … , are sequentially considered, for which , , … , are selected in accordance with the described approach. Adding bipartite subgraphs of seeds does not violate the definition of a bipartite graph. All vertices within one part are not adjacent, and adjacency exists only between vertices of two different parts.
At each step , , … , , seeds are added; that is, there entire 1 + + + ⋯ + Proof of Lemma 9. When two planar graphs = ( , ) and = ( , ) are united at one common vertex * no new edges appear in * = ∪ (see Figure 11). □ Figure 11. Operation of replacing a vertex with a seed or union of a graph G 1 and a seed H in one vertex.
The operation of replacing a vertex with a seed (RVW) while preserving the old edges' adjacency corresponds to the union of two graphs G 1 = (V 1 , E 1 ) and H = (W, Q) at one common vertex in a new graph G * = (V * , E * ): V * = (V 1 ∪ W) − {w * }, E * = (E 1 ∪ Q), or, in another way, joining a seed H. Under the condition of planarity H, the new graph G * is also planar.

Consequence 10.
When two arbitrary graphs are united at one common vertex, their planar subgraphs are united into a planar graph.

Theorem 10.
If there is a planar subgraph H = (W, Q ) in seed H = (W, Q), and the adjacency of old edges is preserved, then there is a planar subgraph G l = V, E l in prefractal graph G l , l = 1, 2, . . . , L, for which E l = K, where K = k· n l − 1 /(n − 1), k = |Q |.
Proof of Theorem 10. There is a planar subgraph G 1 in G l under the conditions for the existence of a planar subgraph H in seed H, where E 1 = |H | = k. Since the adjacency of the old edges is preserved, for constructing the prefractal graph G l , l = 2, 3, . . . , L a seed H is alternately attached to each vertex of G l−1 . G l−1 is planar, and joining planar subgraphs H to its vertices does not violate the planarity of G l following Lemma 9 and Consequence 10. At each step l = 1, 2, . . . , L, n l−1 seeds are added, that is, total 1 + n + n 2 + . . . + n l−1 = (n l − 1)/(n − 1) seeds in G l .
Thus, there is a planar subgraph G l = V, E l in prefractal graph G l , for which E l = k· n l − 1 /(n − 1). Figure 12 shows the procedure for isolating a planar subgraph of a prefractal graph. Following Theorem 10, a planar subgraph H is selected in the seed H (a), and a planar Proof of Theorem 10. There is a planar subgraph in under the conditions for the existence of a planar subgraph in seed , where | | = | | = . Since the adjacency of the old edges is preserved, for constructing the prefractal graph , = 2,3, … , a seed is alternately attached to each vertex of . is planar, and joining planar subgraphs to its vertices does not violate the planarity of following Lemma 9 and Consequence 10. At each step = 1,2, … , , seeds are added, that is, total 1 + + + ⋯ + = ( − 1)/( − 1) seeds in . Thus, there is a planar subgraph = ( , ) in prefractal graph , for which | | = • ( − 1)/( − 1).

Results and Discussion
In this paper, we have discussed six known NP-complete problems in relation to the class of prefractal graphs. For each of the problems, conditions are proposed under which we can answer the question positively or negatively. Algorithms for finding a solution are proposed for some problems.
In the problem of the isomorphism of a subgraph, an algorithm for numbering the vertices of a prefractal graph and a figure with an example are proposed. A theorem is also proposed for the isomorphism of two prefractal graphs, provided that the adjacency of the old edges is preserved.
In the second problem, on a degree constrained spanning tree, an algorithm for finding a spanning tree of minimum weight (MST) of any prefractal graph is proposed. The complexity of the algorithm is shown, where any known MST algorithm, including the modern one, can be used as a procedure. The procedure is applied to the seeds, and then the subgraphs are united into the MST of the entire prefractal graph. The execution time of the algorithm is linear O(c·N) and depends on the number of vertices N = n l . The parameter c = 4n 2 is a constant since the number of seed vertices n is fixed before building the prefractal graph. In the theorem, conditions are proposed under which there exists a spanning tree with vertex degrees at most K = k + 1, where the number k is the maximum vertex degree of the generating seed.
In the problem of a maximum leaf spanning tree, a lemma is proposed that any leaf vertex is on a seed of the last rank. This property is associated with the process of constructing a prefractal graph when at each step, the vertices are replaced by seeds. As for other problems, the characteristics of the entire prefractal graph depend on the seed. This dependence is key and requires additional study.
For the problem of a balanced complete bipartite subgraph, we have proved the theorem that it can be distinguished only on one separate seed. The rule for constructing a prefractal graph preserves this property throughout the entire trajectory. As one of the conclusions, we can suggest the impossibility of identifying a balanced full bipartite subgraph, for example, in social networks. This claim requires research and additional evidence.
For the problem of selecting a bipartite subgraph, a packing algorithm is proposed in the case of preserving the adjacency of old edges. These results can be reformulated as constructing a graph with given characteristics. That is, how can one construct a graph so that a bipartite subgraph exists in it? For such a constructed graph, a packing algorithm can be applied.
The problem of the planarity of a prefractal graph is also related to the design of graphs with predetermined characteristics. If the seed is a planar graph and the adjacency of the old edges is preserved, then for the entire sequence l = 1, 2, . . . , L the graphs G l are planar.
As one of the results, we can single out the possibility of developing algorithms for solving optimization problems with polynomial complexity. Such a modular execution of sequential algorithms on subgraphs (seeds) will allow them to be parallelized in the future. Furthermore, the use of well-known algorithms in the form of procedures will allow researchers in the future to change them to new ones with improved characteristics.
It is assumed that the study of individual NP-complete problems on prefractal graphs will make it possible to form a set of rules for identifying solvability conditions for any known NP-complete problem in this class of graphs, and also to approve the class of prefractal graphs as a special class for which there are conditions for the solvability of NP-complete problems. An example of this is demonstrated in [51] for inherited classes.
Therefore, for all theorems, consequences are proposed with a generalization of the results to the sequence G 1 , G 2 , . . . , G L . Since G L is a dynamic graph that changes in the trajectory l = 1, 2, . . . , L and for each G l an algorithm and a solution to the problem are proposed. In further studies, we plan to pay more attention to the formulation of problems for dynamic graphs, to definitions of solutions to dynamic problems and to the study of the characteristics and properties of prefractal graphs as a subclass of dynamic graphs.

Conclusions
The paper considers and investigates NP-complete problems for one of the classes of dynamic graphs-prefractal graphs. For each of the problems, solvability conditions are given under which it is possible to obtain an existing answer for some subproblems, as well as to construct polynomial algorithms for finding solutions for some. A number of corollaries generalize the results obtained, or provide conditions for the absence of a solution.
In this paper, we study only a small part of the known NP-complete problems. The study of the entire set of problems and the selection of solvability conditions for this class of dynamic graphs-prefractal graphs-will essentially allow us to talk about the selection of an entire subclass of graphs with conditions for the solvability of NP-complete problems.
The development of polynomial algorithms for dynamic graphs will make it possible to solve with improved characteristics such well-known applied problems as the selection of subgraphs in large dynamic networks [52,53]; the detection of communities in social networks [54][55][56]; the solution of multicriteria problems in large-scale transport and logistics systems [57]; the searching and highlighting of DDoS attacks in cryptocurrency systems [58,59] and many other problems.
In the future, we plan to introduce definitions for a dynamic prefractal graph, setting a multicriteria graph-theoretic problem, solving a dynamic problem and the concept of topological time. Furthermore, we also aim to define families of dynamic problems for prefractal graphs.
The number of applied problems in large networks is only growing. With the development of the direction of big data analysis, the increase in the number of subscribers and the complication of networks, the study of problems on dynamic graphs of large dimensions is becoming more and more urgent. Thus, we propose to use all the available tools of dynamic prefractal graphs to solve optimization problems in large networks, as well as to design networks with given characteristics, including predicting the development of real networks [60,61].
It should be noted separately that it is necessary to define fractal graphs and related concepts. Since a fractal graph is an infinite object, what does the formulation of the optimization problem look like, how do the algorithms work and what is the solution? For this purpose, we plan to publish a separate article on fractal and prefractal graphs to familiarize the scientific community with this class of special graphs and to consecrate their properties and characteristics.