# Sequential Polar Decoding with Cost Metric Threshold
## 3 Our Contribution  
### Cost Function  
In the original version, the decoder moves along the branches of the code tree under the control of the dynamic threshold \(T\). In the modified algorithm, similar control is carried out by the cost function \(\Gamma\), which, in the general case, may not produce T-nodes. In this case, however, the equality always holds. The current movement of the decoder is controlled by the current cost \(\gamma_{i}=\Gamma(v_{i})\), where \(v_{i}\) is the number of the last (current) vertex. Thus, the current threshold may not change at every node of the branch being viewed, but only at some of them.  
Let us assume that we have found two T-nodes such that each is an ancestor for the current vertex and their PMF metrics have not yet been updated. In this case, we will call such metrics the first and second thresholds.  
Let us introduce the concept of a new and an old node. A node is considered new if it has never been visited before during the decoding process or was visited but did not have continuation (i.e., it was an open node). Otherwise, the node is considered old. During operation, the decoder identifies the nodes of the branch being viewed in accordance with the gradation--new or old. For any node, the inequality \(\gamma_{i+n}<\gamma_{n}\) is always true: the values of the current thresholds for different visits to the node (the difference is \(i\)). It follows from this that, to identify a node, it is enough to know whether it was visited during the penultimate analysis of the current branch, and, if so, with which threshold.  
Having monitored the operation of the Creeper decoder over time, we can draw the following conclusions. The decoder always either continues the branch with a metric not less than the metrics of previously viewed branches (if it is stored in the decoder memory), or restores the branch with the maximum metric (if it was previously viewed and trimmed). Until the moment at which any of the edges of the code tree begins to be viewed again, the operation of the decoder is similar to that of the SCS decoder, which affects the performance of the entire decoding.  
The main reason is a serious consequence of the algorithm that can occur when moving through the same branches of the code tree repeatedly--when re-analyzing the code subtree rooted at the next \(T\) node, the decoder will repeat exactly the same operations as in the first pass. The developed cost metric allows us to avoid repeated passes and cycles, which slightly reduce the performance of the algorithm.  
In Figure 1, it is shown that after defining two thresholds, the T-nodes will be updated to find nodes with a threshold value that becomes \"old\". In this case, a situation arises wherein the costs of two vertices \(a\) and \(b\) will coincide (\(\Gamma(a)=\Gamma(b)\)), since they are between two threshold values. After the PMF update process in the old node, however, the cost equality may not hold. The current thresholds for decoder control were indicated in red and T-Nodes in blue. Arrows indicate the transition from one vertex to another in the tree. Thus, the transition from the old threshold value corresponding to vertex \(a\) to the new threshold value at vertex \(b\) through the T-Node is possible due to the calculation of the cost metric at each movement step.  
The cost function allows [15; 16] the decoder to make informed decisions about which path to take in the decoding tree and to discard decoding paths that are deemed less promising. Paths with higher costs can be pruned (or bypassed, as we did in this study) to focus the computational resources on more likely paths, thereby improving the efficiency of the decoding process.