# Software Portfolio Optimization: Access Rejection versus Underutilization
## 3 Problem Formulation  
As in earlier studies of license portfolio selection, we consider the standard queuing model, namely, the Erlang loss system (\(M/M/S/S\)) in which \(S\) is the number of licenses and users who cannot obtain access because all licenses are checked out are blocked (these users do not wait in a queue but may attempt to access the software later). When a user stops using the software, the license is returned to the pool of available licenses. This specifies a model in which the number of users, \(K\) (source size), is large enough such that their arrivals may be described as a Poisson process with an average rate of \(\lambda\). Service times are exponentially distributed with an average required time of \(1/\mu\) per user.  
Let \(k\), the current number of software users logged into the system, be the status variable in which \(k=0\), \(1\), \(2\),..., \(S\). Then, the probability that an arriving user will be rejected by the system, \(B(S,a)\), which is the blocking probability, is given by the Erlang B formula:  
\[B(S,a)=\frac{\frac{a^{S}}{S!}}{\sum_{k=0}^{S}\frac{a^{k}}{k!}}, \tag{1}\]  
where \(a=\frac{\lambda}{\mu}\) represents the offered load (traffic intensity). A more convenient way of calculating the blocking probability is via recursion of its reciprocal, \(R(S,a)=\frac{1}{B(S,a)}\)[23]:  
\[R(k,a)=\frac{1}{a}kR(k-1,a)+1,\;k\geq 1\;\text{and}\;R(0,a)=1,\;k=0,\;1,\ldots,\;S. \tag{2}\]  
We use these basic results to formulate a general license-portfolio management problem by considering the time intervals that have the most pronounced effect on the quality of service; that is, \(\lambda\) is the average aggregate intensity of license use during the highest traffic hours.  
Let \(J\) be the number of homogeneous clusters of users, each characterized by software-use intensity \(\lambda_{j}\) and number of users \(K_{j}\) where \(j\) is a type of user, \(j=1,\,2,\,\ldots,\,J.\) Since arrivals are assumed to occur according to an independent Poisson process, they are given by \(\lambda=\sum_{j=1}^{J}\lambda_{j}\). Additionally, let there be \(I\) types of license for purchase that have average service times of \(\frac{1}{\mu_{i}}\). Let \(\gamma_{ij}\) be the percentage of users of cluster \(j\) who will use license type \(i\). Thus, for all \(j\sum_{i=1}^{I}\gamma_{ij}\leq 1\). Let \(S_{i}\) be the number of respective licenses purchased of each license type \(i\); user demand for them is thus \(\sum_{j=1}^{I}\lambda_{j}\gamma_{ij}\), \(i=1,\,\ldots,\,I.\) For each license type \(i\) the offered load is \(a_{i}=\frac{\sum_{j=1}^{J}\lambda_{j}\gamma_{ij}}{I_{1}\mu_{i}}\), the blocking probability is \(B(S_{i},a_{i})\), the active load is \(a_{i}(1-B(S_{i},a_{i}))\), and the corresponding license utilization is \(U(S_{i},a_{i})=\frac{a_{i}(1-B(S_{i},a_{i}))}{S_{i}}\). Denote the cost of purchase and maintenance for a fixed number of years for license type \(i\) as \(c_{i}\).  
The objective is to find the optimal number of licenses of each type so that the total cost, \(C\), of purchasing and maintaining the software licenses is minimized while ensuring that the probability of blocking does not exceed a given level, \(b\) (Constraint (5)), and utilization of each license type is at least at a given level, \(u\) (Constraint (6)):  
\[\min_{\gamma_{ij}S_{i},i=1,\ldots,I,\;j=1,\ldots,J}C=\min_{\gamma_{ij}S_{i},i= 1,\ldots,I,\;j=1,\ldots,J}\sum_{i=1}^{I}\;c_{i}\;S_{i}, \tag{3}\]  
subject to  
\[B(S_{i},a_{i})\leq b; \tag{4}\]  
\[U(S_{i},a_{i})\geq u; \tag{5}\]  
\[\sum_{i=1}^{N}\gamma_{ij}\leq 1,\;j=1,\ldots,\;J; \tag{6}\]  
\[S_{i}\in I,\;i=1,\;2,\ldots,\;I. \tag{7}\]