# Leveraging Blockchain and Consignment Contracts to Optimize Food Supply Chains Under Uncertainty
## 5 Mathematical Model and Methods
### Assignment Contract Without Blockchain  
As the leader in the supply chain, the manufacturer uses make-to-order production to optimize profit by offering the \"retailer a consignment policy\" that comprises a fixed charge and per-unit commission. The two firms' decision-making is modeled by the CP as a Stackelberg (leader-follower) game in this way. In the capacity of a follower, the retailer accepts the conditions of the agreement in return for a predetermined price and a consignment commission that is determined on a unit basis. In order to optimize his profit, he also chooses how many units of the assigned goods to order. Fixed fees may be valued negatively or positively. Typically, a positive fixed cost is seen as the manufacturer's \"admission fee\" for supplying their goods to the retailer for display on the shelves. If, however, the set fee is negative, it might be thought of as a royalty that the seller pays to the manufacturer. In order to optimize its profit, the retailer first chooses to receive a fixed charge (\(C_{f}\)) and a per-unit commission (\(\psi\)) from the manufacturer. \[\phi_{CP}^{r}=\left\{ \begin{array}{l}\psi D_{WBC}-h_{CP}^{r}(q-D_{WBC})+C_{f}; \ D_{WBC}\leq q\\ \psi q-s^{r}(D_{WBC}-q)+C_{f};\ D_{WBC}>q\end{array} \right.\]  
The producer opts for a consignment arrangement aimed at maximizing its profitability, which encompasses a predetermined fee \(C_{f}\) along with a commission per unit (\(\psi\)) that is contingent upon the order quantity placed by the retailer. \[\phi_{CP}^{m}=\left\{ \begin{array}{l}(p_{WBC}-\psi)D_{WBC}-cq-h_{CP}^{m}(q-D _{WBC})-C_{f};\ )D_{WBC}\leq q\\ (p_{WBC}-\psi-c)q-s^{m}()D_{WBC}-q)-C_{f};\ )D_{WBC}>q\end{array} \right.\]  
The combination of the profit of the entire supply chain is given below  
\[\phi_{CP}^{t}=\left\{ \begin{array}{l}p_{WBC}D_{WBC}-cq-h_{CP}^{t}(q-D_{WBC}) ;D_{WBC}\leq q\\ (p_{WBC}-cq)-s^{t}(D_{WBC}-q);D_{WBC}>q\end{array} \right.\]  
The supply chain receives a holding cost in order to satisfy the demand, \(h_{CP}^{t}\), on each unit unsold, where \(h_{CP}^{t}=h_{CP}^{r}+h_{CP}^{m}\). When consumer demand exceeds supply and the existing inventory is sold out, the second equation calculates the supply chain profit, with each unfilled unit resulting in a stock-out cost \(s^{t}\). The estimated profit of the manufacturer, the retailer, and the supply chain, respectively, are determined as follows:  
\[E(\phi_{CP}^{r}) = \int_{0}^{q^{*}}(\psi(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_ {c})x-h_{CP}^{r}(q^{*}-(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})xf(x)dx \tag{13}\] \[+ \int_{q^{*}}^{\infty}\psi q^{*}-s^{r}(D_{0}^{WBC}-\eta_{1}p_{WBC} -\alpha-\beta h_{c})x-q^{*}f(x)dx+X\] \[E(\phi_{CP}^{m}) = \int_{0}^{q^{*}}[(p_{WBC}-\psi)((D_{0}^{WBC}-\eta_{1}p_{WBC}- \alpha-\beta h_{c})]-h_{CP}^{m}\Bigg{(}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha- \beta h_{c})\] (14) \[- cq\Bigg{)}f(x)dx+\int_{q^{*}}^{\infty}(p_{WBC}-\psi)q^{*}-s^{m}( D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})-cqf(x)dx-X\] \[E(\phi_{CP}^{t}) = \int_{0}^{q}[(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h _{c})]-cq-h_{CP}^{t}(q-D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})f(x)dx\] (15) \[+ \int_{q}^{\infty}((p_{WBC}-c)q-s^{t}(D_{0}^{WBC}-\eta_{1}p_{WBC} -\alpha-\beta h_{c})xf(x)dx\]  
Retailers receive a commission of \(\psi\) per unit from manufacturers when their order quantity is equal to the supply chain optimal production amount. The proof is given in the Appendix A.2. \[\psi=\frac{h_{CP}^{r}(p_{WBC}-c+s^{t}((D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha- \beta h_{c})}{c+h_{CP}^{t}}-s^{r}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{ c}) \tag{16}\]  
Assuming that there is no goodwill loss to the producer and the store in the event of a stock-out (i.e., \(s^{r}=s^{t}=0\)), \(\psi\) can be written as  
\[\psi=\frac{h_{CP}^{r}(p_{WBC}-c)}{c+h_{CP}^{t}} \tag{17}\]In arranging to optimize the anticipated income for the retailer, the producer must ensure beyond any doubt the takings after the person judiciousness imperative are met.