# Entropy-Based Algorithm for Supply-Chain Complexity Assessment
## 2 Basic Definitions
Introduce the following notation:  
\(p_{i}^{(1)}(s)=\Pr\Bigl{(}A_{i}^{prime}(s)\Bigr{)}=\Pr\Bigl{(}A_{i}^{(1)} \Bigr{)}=\Pr\) {the risk driver \(\mathsf{f_{i}}\) is the cause of adverse event on the layer \(s\) only}  
\(p_{i}^{(2)}(s)=\Pr\Bigl{(}A_{i}^{\text{sec}\,cond}(s)\Bigr{)}=\Pr\) {the risk driver \(f_{i}\) is the cause of adverse effect on the layer \(s\) as the result of the risk drivers on the layers \(s+1\)}. For simplicity, and without loss of generality, suppose that the list of risk drivers \(F=\{f_{1},f_{2},\ldots f_{N}\}\) is complete for each layer. Then the following holds  
\[\sum_{i=1}^{N}p_{i}(s)=1\text{ for }s=0,1,2,\ldots. \tag{1}\]  
Denote \(\overline{p}(s)=(p_{1}(s),p_{2}(s),\ldots p_{N}(s))\). It is obvious that  
\[A_{i}(s)=A_{i}^{(1)}(s)\cup A_{i}^{(2)}(s)\text{ and }A_{i}^{(1)}(s)\cap A_{i}^{( 2)}(s)=\varnothing\text{, }j=1,2,\ldots,N.\]  
Therefore,  
\[p(A_{i}(s))=p\Bigl{(}A_{i}^{(1)}(s)\Bigr{)}+p\Bigl{(}A_{i}^{(2)}(s)\Bigr{)}\]  
or  
\[p_{i}(s)=p_{i}^{(1)}(s)+p_{i}^{(2)}(s)\qquad i=1,2,\ldots,N. \tag{2}\]  
Then the vector of risk driver probabilities \(\overline{p}(s)=(p_{1}(s),p_{2}(s),\ldots p_{N}(s))\) can be decomposed into two vectors as  
\[\overline{p}(s)=\overline{p}^{(1)}(s)+\overline{p}^{(2)}(s), \tag{3}\]  
where \(\overline{p}^{(1)}(s)=\Bigl{(}p_{1}^{(1)}(s),p_{2}^{(1)}(s),\ldots,p_{N}^{(1)} (s)\Bigr{)}\) is the vector of drivers' primary probabilities and \(\overline{p}^{(2)}(s)=\Bigl{(}p_{1}^{(2)}(s),p_{2}^{(2)}(s),\ldots,p_{N}^{(2)} (s)\Bigr{)}\) the vector of drivers' secondary probabilities. For any layer \(s\), define the transition matrix \(M^{(2)}(s)\) of conditional probabilities of the risk drivers on layer \(s\) that are obtained as the result of risk drivers existing on layer \(s+1\)  
\[M^{(2)}(s)=\Bigl{(}p_{ij}^{(2)}(s)\Bigr{)}_{N\times N^{\prime}}\text{, }s=0,1,2,\ \ldots,\text{ with}\]  
\[p_{ij}^{(2)}(s)=\Pr\Bigl{(}A_{j}^{(2)}(s)\Bigl{|}A_{i}(s+1)\Bigr{)}i,\quad j=1, 2,\ldots,N,\quad s=0,1,2\ldots \tag{4}\]  
Next, define the matrices \(M\)L(\(s\)) of the primary drivers' probabilities as  
\[M\)L(\(s)=\bigl{(}q_{ij}(s)\bigr{)}_{N\times N^{\prime}}\text{, }s=0,1,2,\ \ldots,\]  
\[q_{ij}(s)=p_{j}^{(1)}(s),\qquad i,j=1,2,\ldots,N\text{, }s=0,1,\ldots\]  
\[M\)L(\(s)=\left( \begin{array}{ccccc}p_{1}^{(1)}(s)&p_{2}^{(1)}(s)&.&.&p_{N}^ {(1)}(s)\\ p_{1}^{(1)}(s)&p_{2}^{(1)}(s)&.&.&p_{N}^{(1)}(s)\\.&.&.&.&.\\.&.&.&.&.\\.&.&.&.&.\\ p_{1}^{(1)}(s)&p_{2}^{(1)}(s)&.&.&p_{N}^{(1)}(s)\end{array} \right) \tag{5}\]  
As far as the tables \(TBL_{u}\), for all the nodes belonging to a certain arbitrary SC layer, says, are derived, all the tables are gathered into the Cut_Table \(CT_{s}\) for the entire SC cut. Let \(R_{s}(u)\) denote the total number of observed adverse (critical) events in a node \(u\) of cut \(C_{s}\) during a certain planning period. If such cut contains \(n(s)\) nodes, the total number of critical events in it is \(N^{s}=\sum_{u=1,\ldots\ n(s)}R_{s}(u)\). Assume that there are \(F\) risk drivers. For each risk driver \(f\) (\(f=1,\ldots,F\)), we can compute the number \(N_{s}(u,f)\) of critical events caused by driver \(f\) in the node \(u\) and the total number \(N_{s}(f)\) of critical events in all nodes of cut \(C_{s}\), as registered in the risk protocols. The relative frequency \(p_{s}(f)\) of that driver \(f\) is the source of different critical events in nodes of \(s\) and can be treated as the estimation of the corresponding probability. Then we compute the latter probability as  
\[p_{s}(f)=N_{s}(f)/N^{s} \tag{12}\]  
Then \(\sum_{f}p_{s}(f)=1\). For the sake of simplicity of further analysis, our model applies to the case when the critical events are independent within the same tier and the losses are additive (these assumptions will be relaxed in our future research).