## 3 Proposed Method
### Heuristic Function Based on the Characteristics of \(MTV\)  
The generation of \(MTV\) using AO* model includes forward searching and backward tracing. In the forward searching, let the test vector matrix composed of \(STVs\) from the first row to row \(i\) be a sub-matrix \(MTV_{i}\), as shown in Equation (14). \[MTV_{n}\left\{\begin{aligned} & MTV_{i}\left\{ \begin{aligned} MTV_{2} \left\{\begin{aligned} & \begin{aligned} & a_{11}& a_{12}& \cdots& a_{1m}\\ & a_{21}& a_{22}&\cdots& a_{2m}\\ &\vdots&\vdots&\ddots&\vdots\\ & a_{i1}& a_{i2}&\cdots& a_{im}\\ &\vdots&\vdots&\ddots&\vdots\\ & a_{n1}& a_{n2}&\cdots& a_{nm}\end{aligned}\right.\end{aligned}\right.\end{aligned} \right. \tag{14}\]  
The heuristic function \(f(MTV_{i})\) will calculate the \(\hat{P}_{MTV_{i}}\) (estimated \(P_{MTV}\)) of the sub-matrix \(MTV_{i}\), then this paper will choose the \(MTV_{i}\) with least \(\hat{P}_{MTV_{i}}\) as a direction of searching. \(\hat{P}_{MTV_{i}}\) is calculated by Equation (15). It represents an estimate of the \(P_{MTV}\) of the \(MTV\) after completing the remaining n-i rows if the previous i-row STVs are \(MTV_{i}\). \[\hat{P}_{MTV_{i}}=P_{MTV_{i}}+f(MTV_{i})-P_{MTV_{i}}\cdot f(MTV_{i}) \tag{15}\]  
The implication of the \(f(MTV_{i})\) is to estimate the \(P_{MTV}\) of the MTV after generation based on the information of STVs in former \(i\) row, that is, to evaluate the impact of the STVs in former \(i\) row in the future. According to the analysis of Section 3.2, for a given STV, its effect on \(P_{MTV}\) can be divided into three types of events:  
* The result of wired-AND between it and other STVs is the same as other STVs in latter n-i rows, thus leading to misjudgment. * The result of wired-AND of other STVs (at least one of those STVs is from latter n-i row) is the same as it, thus leading to misjudgment. * The result of wired-AND between it and another STV is the same as the result of wired-AND of another two STVs (at least one of those three STVs is from latter n\(-\)i row), thus leading to confusion. These events can be divided into 13 cases, depending on whether STVs belong to the former i row or latter n\(-\)i row, and the order of wired-AND. For a given STV, each case is independent. Let \(f_{jk}\) be the estimate of influence on \(P_{MTV}\) of the case k (\(1\leq k\leq 13\)) of \(STV_{j}\) (the row j of \(MTV_{i}\)). Then, \(f(MTV_{i})\) can be represented by the following Equation (16). \[f(MTV_{i})=\prod_{j=1}^{i}\prod_{k=1}^{13}f_{jk}\] (16)  
According to the analysis of the 3.2, the effect of each case on \(P_{MTV}\) is represented by \(P_{MTV}\) times \((1-P_{k})\). Under the premise of randomly assigning STV, \(P_{k}\) is the probability that case k will occur according to the classical probability. At the same time, for a given \(STV_{j}\), there are different random combinations that make the case \(k\) occur, and the occurrence of these combinations is independent of each other, If the number of these combinations is \(D_{jk}\), then the effect of \(P_{MTV}\) is the product of all the results, which is \((1-P_{k})^{D_{jk}}\). Considering the characteristics of the different circuits, it is necessary to add parameters \(\beta\) to describe the characteristics of the circuits in each case, so the final form of \(f_{jk}\) is as follows:  
\[f_{jk}=(1-\beta_{k}\cdot P_{jk})^{D_{jk}} \tag{17}\]  
For a \(n\times m\) MTV and each of its sub-matrix \(MTV_{i}\), set \(N_{a}=2^{m}-2\), \(N_{a}\) denotes the number of all types of STV with length m, that is, the number of 0/1 sequences with length \(m\). Set \(N_{s}=2^{m}-2-i\), \(N_{s}\) denotes the number of available STV types left when the former \(i\) rows have been set. Set \(N_{e}=n-i\), \(N_{e}\) denotes the number of STVs waiting to be set.