# A Cross-Layer Optimization QoS Scheme in Wireless Multimedia Sensor Networks
## 3 Problem Formation and Dynamic Algorithm
### Design Dynamic Algorithm via Lyapunov Optimization
 \tag{39}\]  
where  
\[\Psi_{{}_{1}}\!=\!\!\left[\!\left(1/\,B_{F}^{2}\right)\cdot B\cdot\log\!\left( \frac{G_{{}_{\alpha}}p_{{}_{\alpha}}^{T}(t)K_{{}_{\alpha}}}{\sum\limits_{k,i,k=n}^{C}G_{{}_{\alpha}}p_{{}_{\alpha}}^{T}(t)+n_{{}_{i}}}\right)\!\!\right] \!\cdot\!w_{{}_{\alpha}}+\delta_{{}_{i}}\cdot p_{{}_{\alpha}}^{T}(t)\,. \tag{40}\]  
\(I_{{}_{c}}\in I\) is defined as a link set for simultaneous data transmission. \(I\) denotes the set of \(I_{{}_{c}}\). (39) can be transformed as follows. \[ \begin{split}\text{maximize}&\Psi_{{}_{2}}(p^{T}(t) )\\ \text{subject to}& 0\leq p_{{}_{\alpha}}^{T}(t)\leq p_{{}_{ \alpha},\max}^{T},n\
eq d_{{}_{*}},i\in O(n),(n,i)\in I_{{}_{c}}\,,\end{split}  \tag{41}\]  
where  
\[\Psi_{{}_{2}}(p^{T}(t))=\!\!\!\sum_{n\
eq d,\,i\in O(n),(n)\leq I,\,i\leq n}\! \!\left[\!\left(w_{{}_{\alpha}}\,/\,B_{F}^{2}\right)\cdot B\cdot\log\!\left( \frac{G_{{}_{\alpha}}p_{{}_{\alpha}}^{T}(t)K_{{}_{\alpha}}}{\sum\limits_{k,i,k=n}^{C}G_{{}_{\alpha}}p_{{}_{\alpha}}^{T}(t)+n_{{}_{i}}}\right)\!+\!\delta_{ {}_{i}}\cdot p_{{}_{\alpha}}^{T}(t)\!\right]. \tag{42}\]  
**Theorem 1**. : _Optimization problem (41) is a log-convex optimization problem. It implies that if we set \(P^{T}(t)=\log p^{T}(t)\), the new optimization problem (43) is derived:_  
\[ \begin{split}\text{maximize}&\Psi_{{}_{3}}(P^{T}(t) )\\ \text{subject to}& 0\leq p_{{}_{\alpha}}^{T}(t)\leq\log p _{{}_{\alpha},\max}^{T},n\
eq d_{{}_{*}},i\in O(n),(n,i)\in I_{{}_{c}}\,,\end{split}  \tag{43}\]  
_where_  
\[\Psi_{{}_{3}}(P^{T}(t))\!=\!\!\sum_{n\
eq d,\,i\in O(n),(n)\leq I,\,i\leq d}\! \!\left[\!\left(w_{{}_{\alpha}}\cdot B\,/\,B_{F}^{2}\right)\cdot\log\!\left( G_{{}_{\alpha}}K_{{}_{\alpha}}e^{p_{{}_{\alpha}}^{T}(t)}\right)\!-\!\left(w_{{}_{ \alpha}}\cdot B\,/\,B_{F}^{2}\right)\cdot\log\!\left(\sum_{k,i,k=n}^{C}G_{{}_{ \alpha}}e^{p_{{}_{\alpha}}^{T}(t)}+n_{{}_{i}}\right)\!+\!\delta_{{}_{i}}\cdot e ^{p_{{}_{\alpha}}^{T}(t)}\!\right] \tag{44}\]  
_The optimization problem (43) is a convex optimization problem._  
**Proof. ** For problem (43), if the optimization objective function \(\Psi_{{}_{3}}(P^{T}(t))\) is a convex or concave function in regard to \(P^{T}(t)\), and the constraint is a convex set of \(P^{T}(t)\), then (43) is a convex optimization problem. According to the principle that the logarithm of the sum of \(e\) exponent functions is a convex function, then [47] and the conclusion from [48], \(\left(w_{{}_{\alpha}}\cdot B\,/\,B_{F}^{2}\right)\cdot\left[\log\!\left(G_{{}_{ \alpha}}K_{{}_{\alpha}}\right)+P_{{}_{\alpha}}^{T}(t)-\log\!\left(\sum_{k,i,k=n} ^{C}G_{{}_{\alpha}}e^{p_{{}_{\alpha}}^{T}(t)}+n_{{}_{i}}\right)\right]\), are concave functions. In each time slot, for \(E_{{}_{\alpha}}(t)\leq\theta_{{}_{\alpha}}^{\varepsilon}=E_{{}_{\alpha}}(0)\), we can get \(\delta_{{}_{i}}\leq 0\). If the exponent function is convex [48], \(\delta_{{}_{i}}\cdot e^{p_{{}_{\alpha}}^{T}(t)}\) is a concave function if \(\delta_{{}_{i}}<0\). When \(\delta_{{}_{i}}=0\), the value of \(\delta_{{}_{i}}\cdot e^{p_{{}_{\alpha}}^{T}(t)}\) is zero. According to the principle that the sum of concave functions is a concave function, the optimization objective function of (43) is a concave function. As the constraint of (43) is linear, it is a convex set of \(P^{T}(t)\). Therefore, problem (43) is a convex optimization problem and problem (41) is a log-convex optimization problem. \(\Box\)  
In the case of \(I_{{}_{c}}\in I\) being known, problem (43) can be solved using the interior point method [48]. The optimal transmission powers can then be gained through equality \(p^{T}(t)=e^{p^{T}(t)}\). However,the interior point method is not suitable for wireless sensor networks, as this method may result in heavy control message overhead. Two distributed optimization algorithms (Algorithm 1 and Algorithm 2) can be used to solve problem (41). ```
There are \(s\) links in link set \(I_{c}\), which are \((n_{1},n_{1}^{{}^{\prime}})\),\((n_{2},n_{2}^{{}^{\prime}})\),...,\((n_{s},n_{s}^{{}^{\prime}})\).