An approach to algorithmizing the problem of vertex minimization of nondeterministic automata. Part I. Problem statement and the brief description of the basis methods

We consider our approach to the problem of vertex minimization of nondeterministic finite automata. It comes down to constructing a lot of grids and knocking out on its basis an optimal (or pseudo-optimal) subset. However, our problem is much more complicated than the classical problem of optimal coverage of a set, since we need to succeed (to build pseudo-optimal solutions in an acceptable time) in its particular case; in this particular case, we are considering has many specific features, which are not characteristic of most other variants of the problem of optimal coverage of a set. In the first part of the paper, we consider issues related to the brief description of the basic branch-and-bound method, testing approach to the basic method, and some modifications the basic algorithm.


Introduction
This work continues the study of the algorithm for solving the problem of vertex minimization of nondeterministic finite automata (NFA), based on the branch-and-bound method (BBM).
We consider our approach to the problem of vertex minimization of nondeterministic finite automata. It comes down to constructing a lot of grids and knocking out on its basis an optimal (or pseudo-optimal) subset. However, we shall not consider issues related to so called Waterloo automaton [1,2,3], since, according to the authors of this paper, the basic algorithmic questions of minimizing automata do not apply to Waterloo-like automata (so called "Walibad", from "Wa(terloo-)Li(ke) Bad(ness)", see [2]).
However, despite our remark about such automata, the considered problem is much more complicated than the classical problem of optimal coverage of a set [4,5,6], with the help of which, of course, all this can be solved in principle. This is because we need to succeed (to build pseudo-optimal solutions in an acceptable time) in its particular case. However, "the devil is in the details!": in this case, we are considering has many specific features, which are not characteristic of most other variants of the problem of optimal coverage of a set.
In Part I of the paper, we consider issues related to the brief description of the basic branch-andbound method, testing approach to the basic method, and some modifications the basic algorithm. IOP Conf. Series: Materials Science and Engineering 862 (2020) 052055 IOP Publishing doi:10.1088/1757-899X/862/5/052055 3 minimality and if the coverage is the minimum of the previously obtained, then it is considered as the next pseudo-optimal solution to the original problem. If the Yes set does not yet form a complete coverage, then the subtask is returned to the subtasks set for further processing.
It should be emphasized that even for the initial small-sized matrices, it turns out to be impossible to carry out processing of all arising subtasks in a reasonable time. Therefore, an important aspect of BBM is the method of choosing the next task for processing, which increases the chances of finding the next pseudo-optimal solution. This method is based on the concept of the "weight" of a subtask: at each moment in time, the subtask with the smallest weight is selected from the set of subtasks. As weight components, it is natural to consider the following three characteristics of the subtask: • the number of single elements of the original matrix, not yet covered with full grids from the Yes set of this subtask; • the set size of the subtask Yes; • the set size of the subtask number. Indeed, the small value of the characteristic (1) means that the subtask can be quickly completed to any solution to the original problem, the small value (2) increases the chances of getting a small solution, and the small value (3) means that there is more options for completing the subtask to the solution. Numerical experiments presented in [8] showed that the best results are achieved if characteristic (3) is used as the weight (or, if all the characteristics are included in the weight, a larger weight coefficient is used for characteristic (3)) . Therefore, when calculating the weight of the subtask, the algorithm used one of the following two sets of weighting coefficients: (0, 0, 1) and (1, 1, 10).

The testing approach to the basic method
When testing the implemented algorithm, two methods were used: StepRun(steps) and TimeRun(seconds). The StepRun() method executes the number of calls to the MainStep() method specified in the steps parameter. The duration of the TimeRun() method (and thus the number of calls to the MainStep() method) is determined by the seconds parameter as follows: the TimeRun() method stops working if no new pseudo-optimal solutions are found in the specified number of seconds.
The basic algorithm and its modifications were tested on two sets of 100 matrices. The first set contained matrices of size 15 by 25, which were randomly generated by adding 20 initial grids (grids were constructed in such a way that none of them was embedded in another). The second set contained 30 by 40 matrices based on 35 random grids. Thus, for the first set, the size of the optimal solution was estimated from above by a value of 20, and for the second set, by a value of 35. Each of the matrices was processed using the following methods: StepRun(500), StepRun(5000), TimeRun (10). Thus, to find a pseudo-optimal solution, either a fixed number of calls to the MainStep() method (500 or 5000) was used, or the time (10 seconds) was determined, after which the matrix processing was completed if no new pseudo-optimal ones were found during this time solutions.  Tables 1 and 2 show the results of numerical experiments for the basic algorithm. Table 1 contains data on the size of the obtained pseudo-optimal solutions, and table 2 contains data on the running time of the algorithm (in seconds). For each data element, three characteristics are indicated: the average value for the processed 100 matrices and (in brackets) the minimum and maximum value. Here and below, we considered a variant of the algorithm with a set of weighting coefficients (0, 0, 1). In addition, in this clause, for comparison, the results are given for the variant corresponding to the set (1, 1, 10).
The calculations were carried out on a computer with an AMD A10-6700 3.70 GHz processor. The results of numerical experiments indicate that the implemented algorithm allows us to quickly determine good pseudo-optimal solutions to the original problem. In particular, for a set of [a] weights (for [a], we again use terminus of [8]), in the case of matrices of size 15×25, already in the StepTun() method (5000) (0.83 seconds), it is possible to reach the upper boundary of the optimal solution (equal to 20 grids) for all 100 matrices, and for matrices of size 30×40 the indicated value (35 grids) is achieved on average in the TimeRun() method (10) (19 seconds), although in this case there is a rather large scatter of the obtained pseudo-optimal values (from 27 to 46). The results also demonstrate the importance of choosing weights for subtasks, especially for large matrices.

The modification of the basic algorithm: cutting subtasks
The basic version of the algorithm for solving the main problem described Section 2 allows several modifications. To study the effectiveness of such modifications, one could generate, based on the Task class, which contains the implementation of the basic algorithm and derived classes. However, this method makes it difficult to analyze options based on combinations of modifications. Therefore, a different approach was used, in which all possible modifications of the algorithm are introduced into the methods of the original Task class, and its constructor provides the algOptions parameter, which determines the combination of those modifications that should be used at the current start. The algOptions parameter has an enumerated type AlgOptions, equipped with the [Flags] attribute, which allows to use this parameter to specify a set of bit flags.
In the basic version of the algorithm, the subtask was cut off in the only case: if in the Subtask() method for the specified number of attempts it was not possible to form a new grid that could be added to the current subtask. It should be noted that for large matrices a similar situation arises relatively rarely. At the same time, a part arises when, in the process of constructing a subtask, the number of grids added to it (i.e., the size of the Yes set) becomes equal to or larger than the already found size of the pseudooptimal solution. Obviously, in this situation it does not make sense to analyze this subproblem (and generate new subproblems on its basis). Moreover, you can immediately interrupt the processing of a subtask extracted from the subtasks set if it contains OptSize-1 grid, where OptSize is the size of the pseudo-optimal solution already found. Cutting off the subtask should also be performed in the case when, after adding another grid to it, the size of the Yes set becomes OptSize-1, while the subtask is not yet a solution to the original problem, i.e., it does not determine the coverage of the matrix. Thus, the clipping actions should be performed not only in the Substep() method, but also at the beginning of the MainStep() method (when extracting the next subtask from the subtasks set), as well as at the end of this method when performing the final actions after adding a new grid to the subtask. For the described heuristic, we shall use the notation CutOff in the next parts of this paper. It is natural to expect that using the CutOff heuristic, a greater number of subtasks will be processed, and this will increase the chances of finding the best pseudo-optimal solutions. For the StepRun mode, an acceleration of the algorithm is observed (table 3), and for the TimeRun mode, an increase in the number of processed subtasks (table 4).

Conclusion
We intend to consider the continuation of this topic in the following parts of this paper. The plans for the next research on this topic are as follows.
We intend to consider various options for choosing a separating element: it is obvious that several heuristics are possible for this. For different variants of the "simple" choice of this element, we shall present statistical data (already partially obtained by us by now) related to the quality of the implementation of the algorithms. We check the quality itself, first, based on the average working time.
In addition, we present our studies related to the random generation of finite automata [13] and the difference that arises for different versions of such generation.
After that, we intend to publish the complication of the "simple" choice of the separating element: based on several implemented algorithms for its generation, we show the possibility of using risk functions [14,15] for the final selection of this element.
Preliminary calculations show that in this direction it is also possible to obtain a decrease in the running time of the entire algorithm of the branch and bound method.
And, of course, we intend to continue the parallel implementation of the algorithms we describe before. We started such a parallel implementation in [7].