## 3 Materials and Methods
### Structural and Quantitative Metric of Network Similarity
A norm with parameter \(p\) may be used as a norm in this formula:  
\[\|f_{k}^{B}(i)-f_{k}^{A}(j)\|=\|f_{k}^{B}(i)-f_{k}^{A}(j)\|_{p}=\left(\sum \limits_{r=1}^{n}\left|f_{k,r}^{B}(i)-f_{k,r}^{A}(j)\right|^{p}\right)^{1/p}, \tag{19}\]  
where \(f_{k,r}^{A},f_{k,r}^{B}\) describe the \(r\)-th component of the vector--functions \(f_{k}^{A},f_{k}^{B}\), respectively. Subsequently, for each function \(f_{k}^{A}\), \(k=\overline{1,LF}\), matrices of normalized values should be determined: \(V_{k}^{*}=\left[v_{ij}^{*}(k)\right]_{n_{B}\times n_{A}}\), where \(v_{ij}^{*}(k)=v_{ij}(k)/\|V_{k}\|_{F}\). Doing so makes the values in the matrix satisfy the property \(v_{ij}^{*}(k)\in\{0,1\}\). Having applied this procedure, it is feasible to calculate the value of the quantitative similarity of the vertices of both graphs, namely for the \(i\)-th vertex in the \(G_{A}\) graph and the \(j\)-th vertex in the \(G_{B}\) graph, using the following formula:  
\[\overline{v}_{ij}=\sum\limits_{k=1}^{LF}\lambda_{k}\cdot v_{ij}^{*}(k),\ \ \ \sum\limits_{k=1}^{LF}\lambda_{k}=1,\ \ \ \underset{k=1,\ldots,LF}{\forall}\lambda_{k}\in\{0,1\}. \tag{20}\]  
The value of \(d_{QN}(G_{A},G_{B})\) can be calculated on the basis of the above matrix--the vertex quantitative similarity of both graphs. The optimization problem is the same as in the process of calculating structural similarity--with two changes: the \(s_{ij}\) values should be changed to values \(-\overline{v}_{ij}\) (hence values lower in terms of modulus mean greater similarity) and the \(d_{S}(G_{A},G_{B})\) value into \(d_{QN}(G_{A},G_{B})\). A similar method is used to calculate the \(d_{QA}(G_{A},G_{B})\) value of the quantitative similarity of graphs from the perspective of the functions defined on the edges. A matrix vector is built in the first place (where \(E_{k}=\left[e_{ij}(k)\right]_{n_{B}\times n_{A}}\), \(k=\overline{1,LH}\) and \(m_{A}\),\(m_{B}\)--the number of edges in graphs \(G_{A}\) and \(G_{B}\), respectively). The values of this matrix are calculated for individual functions \(h_{K}\) defined on the edges: \(e_{ij}(k)=\|h_{k}^{B}(i)-h_{k}^{A}(j)\|_{p}\). Then, the whole process is normalized: \(e_{ij}^{*}(k)=e_{ij}(k)/\left\|E_{k}\right\|_{F}\), and the similarity for individual edges of both graphs can be calculated as follows:  
\[\overline{e}_{ij}=\sum_{k=1}^{LH}\mu_{k}\cdot e_{ij}^{*}(k),\ \ \ \sum_{k=1}^{LH}\mu_{k}=1,\ \ \ \underset{k=1,\ldots,LH}{\forall}\mu_{k}\geq 0. \tag{21}\]  
The last step involves solving the assignment problem defined as before with the following changes: the value \(s_{ij}\) should be substituted with \(-\overline{e}_{ij}\) and the value \(d_{S}(G_{A},G_{B})\) should be replaced with \(d_{QA}(G_{A},G_{B})\). Doing so allows for calculating the value of the edge quantitative similarity of the graphs. It is also worth mentioning that it is possible to calculate a single value of quantitative similarity of both graphs. To that end, one may use the method of transforming a weighted graph \(G\) (with weights on vertices and edges) into a substitute graph \(G^{*}\) with functions defined only on vertices. This method has been described in [19]. Since the result of the method described above is three criteria values (\(d_{S}(G_{A},G_{B})\) value describing structural similarity, \(d_{QN}(G_{A},G_{B})\) describing vertex quantitative similarity, \(d_{QA}(G_{A},G_{B})\) describing edge quantitative similarity), in the problem to be solved, it is crucial to propose a way to select the graph representing the musical arrangement most similar to the given pattern. This is equivalent to the issue of solving the MWGSP multi-objective problem defined as follows:  
\[MWGSP=(SG,F,R_{D}), \tag{22}\]  
where  
\[F:SG\to R^{3},F(G)=\left(d_{S}(P,G),d_{QS}(P,G),d_{QA}(P,G)\right),\]  
\[R_{D}=\left\{ \begin{array}{c}(Y,Z)\in SG^{2}:d_{S}(P,Y)\geq d_{S}(P,Z)\wedge \\ d_{QN}(P,Y)\leq d_{QN}(P,Z)\wedge\\ d_{QA}(P,Y)\leq d_{QA}(P,Z)\end{array} \right\} \tag{23}\]  
Indeed, the simplest option would be to choose a Pareto-dominant solution.