# Approaches to Numerical Solution of Optimal Control Problem Using Evolutionary Computations
## 4 Multilayer Network Operator Method  
A network operator method encodes mathematical expressions in the form of directed graphs [29; 30]. A multilayer network operator method is a development of the network operator method that encodes mathematical expressions in the form of directed graphs which consist of several subgraphs. Let us consider an example of coding a mathematical expression using the multilayer network operator method. Let a mathematical expression be given as  
\[y=\left\{ \begin{array}{ll}q_{1}x_{1}+x_{2}\exp(-q_{2}x_{2})\cos(q_{1}x_{1}),\text{ if }x_{1}^{2}-x_{2}^{2}\leq 0\\ q_{1}x_{1}+x_{2}\sin(q_{2}x_{2}+q_{3}),\text{ otherwise}\end{array} \right.. \tag{19}\]  
To code this expression, it is enough to have the following basic sets:  
a set of arguments \(\text{F}_{0}=(f_{0,1}=q_{1},f_{0,2}=q_{2},f_{0,3}=q_{3},f_{0,4}=x_{1},f_{0,5}= x_{2})\);  
a set of unary functions \(\text{F}_{1}=(f_{1,1}(z)=z,f_{1,2}(z)=-z,f_{1,3}(z)=\exp(z),f_{1,4}(z)=z^{2}\),  
\[f_{1,5}(z)=\sin(z),f_{1,6}(z)=\cos(z),f_{1,7}(z)=\vartheta(z),f_{1,8}(z)=1- \vartheta(z)),\]  
where  
\[\vartheta(z)=\left\{ \begin{array}{ll}1,\text{if}\ z>0\\ 0,\text{ otherwise}\end{array} \right. ;\]  
a set of binary functions \(\text{F}_{2}=(f_{2,1}(z_{1},z_{2})=z_{1}+z_{2},f_{2,2}(z_{1},z_{2})=z_{1}z_{2})\). If some element of the set has two indices, then the first one shows the number of arguments, whereas the second one is an index of the element in the set. The Heaviside function \(\vartheta(z)\) is used for conditional operator IF. Let \(A=q_{1}x_{1}+x_{2}\exp(-q_{2}x_{2})\cos(q_{1}x_{1})\), \(B=x_{1}^{2}-x_{2}^{2}\), and \(C=q_{1}x_{1}+\sin(q_{2}x_{2}+q_{3})\); then,  
\[y=(1-\vartheta(B))A+\vartheta(B)C=f_{1,8}(B)A+f_{1,7}(B)C.\]  
Suppose that a multilayer network operator has \(K=4\) layers or subgraphs. Suppose that the number of nodes is equal to \(8\), and four of them are source nodes, \(n_{0}=4\). Each layer has the same number of source nodes, some of which may not be used. The graph of a multilayer network operator for Equation (11) is shown in Figure 1.  
Figure 1: The graph of a multilayer network operator. In Figure 1, the source nodes of the graph contain the indices of binary functions; next to the edges are the indices of unary functions. To calculate a mathematical expression, it is necessary to specify the matrix of connections \(\mathbf{D}\). This matrix has dimensions of \(K\times 2n_{0}\). Each row of the matrix is associated with a specific layer and indicates the source nodes of this layer. The odd element of the row contains the index of the layer. If the index is equal to 0 then it is a set of arguments. The even element of the row indicates the node number of this layer or the element number in the argument set. For the multilayer network operator in Figure 1, the matrix of connections has the form  
\[\mathbf{D}=\left[ \begin{array}{cccccccc}0&1&0&2&0&4&0&5\\ 1&5&1&6&1&8&0&3\\ 2&6&1&8&2&8&0&5\\ 1&5&3&5&3&7&3&8\end{array} \right].\]  
The network operator matrices of the four layers are  
\[\mathbf{\Psi}^{1}=\left[ \begin{array}{cccccccc}0&0&0&0&1&0&0&0\\ 0&0&0&0&0&1&0&0\\ 0&0&0&0&1&0&0&4\\ 0&0&0&0&0&1&4&0\\ 0&0&0&0&2&0&0&0\\ 0&0&0&0&0&2&0&0\\ 0&0&0&0&0&1&2\\ 0&0&0&0&0&0&0&1\end{array} \right],\mathbf{\Psi}^{2}=\left[ \begin{array}{ ccccccccc}0&0&0&0&0&6&0&0\\ 0&0&0&0&2&0&1&0\\ 0&0&0&0&0&8&0&0\\ 0&0&0&0&0&1&0\\ 0&0&0&0&1&3&0&0\\ 0&0&0&0&2&0&0\\ 0&0&0&0&0&2&0&0\\ 0&0&0&0&0&0&1&5\\ 0&0&0&0&0&0&0&1\end{array} \right],\]  
\[\mathbf{\Psi}^{3}=\left[ \begin{array}{cccccccc}0&0&0&0&0&6&0&0\\ 0&0&0&0&7&0&0&0\\ 0&0&0&0&1&0&0&0\\ 0&0&0&0&0&1&0&0\\ 0&0&0&0&0&1&0&0\\ 0&0&0&0&2&1&0&0\\ 0&0&0&0&0&1&1&0\\ 0&0&0&0&0&2&1&0\\ 0&0&0&0&0&0&2&1\\ 0&0&0&0&0&0&1\end{array} \right],\mathbf{\Psi}^{4}=\left[ \begin{array}{ ccccccccc}0&0&0&0&1&0&0&0\\ 0&0&0&0&0&0&0&0\\ 0&0&0&0&1&0&0&0\\ 0&0&0&0&0&0&0&0\\ 0&0&0&0&1&1&0&0\\ 0&0&0&0&0&2&1&0\\ 0&0&0&0&0&0&2&1\\ 0&0&0&0&0&0&0&1\end{array} \right].\]  
Note that, when solving the synthesis problem using the symbolic regression method, direct coding is not required.