## 4 Analytical Framework for Heterogeneous Service Provisioning
### Algorithms for Rate-Adaptive Provisioning
\[w_{s,i}^{t}=\frac{1}{|\{j\ |\ t\in T_{s,j}\}|},\quad p_{s,i}^{t}=0. \tag{16}\]```
1:Updated link prices \(P\), weights \(W\), service paths \(T_{s,i}\)
2:Adapted delivery rates \(g_{s,i}\)
3:for all nodes \(e\)do
4:if\(e\) is a provider of service \(s\)then
5:for all consumers \(i\) of service \(s\)do
6:\(p_{s,i}\leftarrow\sum_{t\in T_{s,i}}p_{s,i}^{t}\) (Aggregate path cost (used in Equation (8)))
7: Observe state \(s_{t}=\{p_{s,i},d_{s,i},g_{s,i}^{\text{prev}}\}\) {State includes price, delay, previous rate}
8: Select action \(a_{t}\) using RL policy \(\pi(a_{t}|s_{t})\): adjust \(g_{s,i}\) {Action chosen to optimize utility}
9: Receive reward \(r_{t}=\mathcal{U}_{s}(g_{s,i})-\varphi_{s}D_{s,i}\) {Reward defined in Equation (8)}
10: Update policy parameters using gradient of \(r_{t}\) {Policy improvement via DQN gradient}
11:\(g_{s,i}\leftarrow\alpha\cdot U_{s}^{-1}\bigg{(}\Big{[}\frac{1}{p_{s,i}}\Big{]} _{U_{s}(m_{s})}^{U_{s}(M_{s})}\bigg{)}+(1-\alpha)\cdot a_{t}\) {Adaptive rate via inverse utility (related to Equation (1))}
12:endfor
13:endif
14://Check for new service requests to trigger feedback-based re-optimization
15:if any new service is requested by node \(e\)then
16: Update network state and repeat Algorithm 2
17:endif
18:endfor
19:return Updated rates \(g_{s,i}\)
```

**Algorithm 3** Service Rate Adaptation and Delivery

Algorithm 2 iteratively updates prices and weights. Lines 3-6 identify each active node \(e\) and its outgoing links \(t\). For each link, the maximum rate of any service traversing it is computed:

\[g_{s}^{t}=\max_{\{i|t\in T_{s,i}\}}g_{s,i}, \tag{17}\]

and the aggregate link load is:

\[g^{t}=\sum_{s\in\mathbb{S}}g_{s}^{t}. \tag{18}\]

Link prices are adjusted via a gradient step:

\[p^{t}=\big{[}p^{t}+\lambda(g^{t}-c^{t})\big{]}^{+}, \tag{19}\]

where \(\lambda\) is a learning rate or step size. Consumer-specific weight coefficients are then updated to reflect usage:

\[w_{s,i}^{t}=\big{[}w_{s,i}^{t}+\lambda(g_{s,i}-g_{s}^{t})\big{]}^{+}, \tag{20}\]

followed by normalization for fairness:

\[w_{s,i}^{t}=1-\sum_{j\
eq i,t\in T_{s,i}}w_{s,j}^{t}. \tag{21}\]

Finally, consumer-level link prices are computed:

\[p_{s,i}^{t}=w_{s,i}^{t}\cdot p^{t}. \tag{22}\]

These updates reflect both current traffic and anticipated changes (predicted via ML models), ensuring dynamic resource reallocation under evolving healthcare conditions. Algorithm 3 focuses on service rate adaptation. For each service provider node, lines 1-3 compute the total service delivery path price for consumer \(i\):

\[p_{s,i}=\sum_{t\in T_{s,i}}p_{s,i}^{t}. \tag{23}\]

Using the inverse utility function, the consumer's service delivery rate is adjusted:

\[g_{s,i}=U_{s}^{-1}\Bigg{(}\bigg{[}\frac{1}{p_{s,i}}\bigg{]}_{U_{s}(m_{s})}^{U_{ s}(M_{s})}\Bigg{)}. \tag{24}\]

This ensures that rate adjustments respect both the bounds of the service and its urgency. The algorithm supports real-time healthcare needs by ensuring that critical services (e.g., real-time monitoring, emergency alerts) receive bandwidth quickly as network conditions change. If any node is receiving a new service, the process iterates to re-evaluate the network status, ensuring up-to-date adaptation. Together, these algorithms implement a closed-loop control mechanism that dynamically adjusts service delivery in response to both real-time network data and predictive insights from ML models, making the system robust, intelligent, and responsive for smart healthcare IoT applications. ### Complexity Analysis

The computational complexity of the proposed framework is primarily influenced by the iterative nature of Algorithms 2 and 3, which operate on per-node and per-link bases and rely on dynamic network conditions. Let \(n\) represent the number of services, \(m\) the number of network links, and \(k\) the average number of consumers per link. Algorithm 1 is responsible for initialization, constructs the weight and price matrices by processing all service-link combinations.