# Software Portfolio Optimization: Access Rejection versus Underutilization
## 4 Floating vs. Network Named User Licenses  
We consider a special case of two types of license, \(I=2\) where \(i=1\) denotes NNU licenses and \(i=2\) denotes floating licenses and two clusters of users \(J=2,j=1\) heavy and \(j=2\) light users, to illustrate the approach to managing portfolios of software licenses using integer programming. Firms routinely encounter this type of portfolio management problem, and the integer program facilitates an efficient algorithm for solving it.  
As the firms must purchase a license for each customer who uses an NNU license and it purchases these licenses only for heavy users, then there are only two decision variables: \(S_{1}\) and \(S_{2}\); that is, \(S_{1}=\gamma_{11}K_{1}\) and \(\gamma_{21}=1-\gamma_{11}\), \(\gamma_{12}=0\) and \(\gamma_{22}=1\). Given the number of heavy users \(K_{1}\) and the arrival rate of heavy (\(\lambda_{1}\)) and light (\(\lambda_{2}\)) users, the total average arrival for floating license users is determined by:  
\[\overline{\lambda}=\frac{(K_{1}-S_{1})\lambda_{1}}{K_{1}}+\lambda_{2} \tag{8}\]  
where \(\frac{K_{1}-S_{1}}{K_{1}}\) is the proportion of heavy users who do not have personal licenses. The portfolio optimization problem, then, is to find the optimal number of NNU and floating licenses so that the total cost is minimized:  
\[\underset{S_{1},S_{2}}{\text{min}}C=\underset{S_{1},S_{2}}{\text{min}}\{c_{1} S_{1}+c_{2}S_{2}\} \tag{9}\]  
subject to  
\[B(S_{2},a_{2}\ )\leq b; \tag{10}\]  
\[U(S_{2},a_{2})\geq u; \tag{11}\]  
\[0\leq S_{1}\leq K_{1},\ S_{2}\geq 1; \tag{12}\]  
\[S_{1}\text{ and }S_{2}\text{ are integers}, \tag{13}\]  
where \(c_{1}\) is the cost of NNU licenses and \(c_{2}\) is the cost of network floating licenses.  
The solution for this system is based on the following simple algorithm, in which \({S_{1}}^{*}\) and \({S_{2}}^{*}\) denote the optimal number of NNU and floating licenses, respectively.  
Algorithm
1. Set \({S_{2}}^{*}=K_{2}\), \({S_{1}}^{*}=K_{1}\), \(S_{2}=1\), and \(S_{1}=0\).
2. For the current \(S_{1}\) find the minimal number \(\hat{S}_{2}\) that meets the blocking probability by calculating consecutively \(B\big{(}\hat{S}_{2},a_{2}\big{)}\) over all possible \(\hat{S}_{2}=S_{2},\ldots,K\) until (10) holds. Set \(S_{2}=\hat{S}_{2}\).
3. For the current \(S_{1}\), \(S_{2}\), check the utilization Constraint (11). If the constraint holds, then go to Step 4. Otherwise, check if \(S_{1}<K_{1}\) set \(S_{1}=S_{1}+1\) and go to Step 2. If \(S_{1}=K_{1}\), then stop; an optimal solution \(({S_{1}}^{*},{S_{2}}^{*})\) is found.
4. If \(c_{1}S_{1}+c_{2}S_{2}<c_{1}{S_{1}}^{*}+c_{2}{S_{2}}^{*}\), set \({S_{1}}^{*}=S_{1}\), \({S_{2}}^{*}=S_{2}\). If \(S_{1}<K_{1}\) set \(S_{1}=S_{1}+1\) and go to Step 2. Otherwise, stop; an optimal solution \(({S_{1}}^{*},{S_{2}}^{*})\) is found.  
The complexity of the algorithm lies in Step 2, which calculates the blocking probability with iterations by Equation (2); each step takes \(O(1)\) time, and there are at most \(K\) steps. Then, the complexity of step 2 is \(O(K)\). Calculations of the utilization in Step 3 and of the total cost at Step 4 are of \(O(1)\) complexity. Steps 2-4 are repeated at most \(K_{1}\) times, which in the worst case results in \(O(K_{1}K)\) time.