1 Introduction

According to global estimates of the World Health Organization (2021), the burden of sexually transmitted infections (STIs) remains high, counting over 350 million new infections annually with one of the four most common STIs—chlamydia, gonorrhea, syphilis, and trichomoniasis. Although the majority of these infections can be cured, when not treated, STIs might lead to serious health consequences. In 2020, the human papillomavirus (HPV) caused over 600,000 new cases of cervical cancer and 342,000 deaths (Sung et al. 2021). Mother-to-child transmission of syphilis, or congenital syphilis, leads to over 350,000 adverse birth outcomes such as early fetal and neonatal deaths, stillbirths, and preterm or low-birth-weight babies (Korenromp et al. 2019). Negative effects associated with untreated gonorrhea and chlamydia infections include reproductive tract morbidities, such as tubal factor infertility and pelvic inflammatory diseases among women (Tsevat et al. 2017). Gonorrhea, syphilis, or genital herpes simplex virus infection (HSV) are associated with an increased risk of acquiring or transmitting HIV (Unemo et al. 2017). Moreover, a recent observational trend study showed that the absolute incidence of STI cases increased in the last 30 years, especially in sub-Saharan Africa and Latin America (Zheng et al. 2022). In view of this, more attention should be given to the prevention and control of STIs, particularly in low- and middle-income countries, evaluating the benefits of implementing different public health control strategies.

The spread of STIs can be significantly reduced by a number of non-pharmaceutical interventions including sex abstinence, reduction in the number of sex partners, mutually monogamous relationships, and correct and consistent use of latex condoms (Workowski and Bolan 2015). Effective treatment is available for bacterial and parasitic STIs. For example, gonorrhea, syphilis, chlamydia, and trichomoniasis can be treated with antibiotics, often in a single dose (World Health Organization 2021; Workowski and Bolan 2015). Viral STIs including HIV, genital HSV, viral hepatitis B, and HPV have limited treatment options, but disease symptoms can be weakened or controlled with systematic treatment (World Health Organization 2021; Workowski and Bolan 2015). Antiviral drugs typically reduce the viral load limiting clinical symptoms, though virus eradication is difficult (World Health Organization 2021; Workowski and Bolan 2015). The spread of STIs can also be limited via vaccination, which is the main tool for the primary prevention of disease, and one of the most cost-effective public health measures. Therefore, the development of vaccines against STIs is essential to reduce the vast number of infections globally, and their adverse health outcomes (Gottlieb et al. 2016). Currently, there are vaccines for viral STIs that have been proven to be safe and effective, including vaccines against HPV and hepatitis B virus (Gottlieb et al. 2016). Major efforts continue in the development of vaccines against other STIs e.g. herpes and HIV, with several vaccine candidates in early clinical development (World Health Organization 2021). Nevertheless, as the COVID-19 pandemic has shown, even after successful vaccine development, vaccines usually come on a limited budget and the available stockpile is rarely enough to guarantee the immunization of the entire population (Yamey et al. 2022). Generally, in addition to non-pharmaceutical interventions, public health authorities rely on a fixed amount of vaccines to control an outbreak, and therefore, optimizing the allocation of scarce vaccines becomes an important problem.

For an effective vaccination program, it is extremely important to identify subgroups within the general population that should be prioritized to be vaccinated (Hansen and Day 2011). In the context of STIs, the key allocation problem is to investigate how to effectively distribute a limited vaccine stockpile among individuals, females and males, to minimize the prevalence of the infection in a population (Bogaards et al. 2015; Heffernan et al. 2014; Saldaña et al. 2019). Strategic mathematical modeling has already been directed to study resource allocation problems using different approaches such as mixed-integer linear programming models (Saif and Elhedhli 2016; Tavana et al. 2021), feedback control (Camacho et al. 2019), analytical insights from compartmental models (Bogaards et al. 2011; Duijzer et al. 2018; Heffernan et al. 2014; Gao et al. 2021; Vo et al. 2021), and optimal control (Estadilla et al. 2021; Malik et al. 2016; Saldaña et al. 2019). Here, we focus on optimizing time-dependent control interventions in an epidemiological model, using the optimal control theory (OCT) as a methodology for designing effective vaccination strategies. The OCT has been proven to be a powerful tool in the development and evaluation of intervention strategies to cope with the burden of infectious diseases (Bussell et al. 2019). Several studies have used Kermack–McKendrick-type models coupled with the optimal control theory to devise vaccine prioritization for specific diseases such as influenza (Matrajt et al. 2013; Shim 2013), dengue (Maier et al. 2017; Rodrigues et al. 2014), and COVID-19 (Estadilla et al. 2021; Libotte et al. 2020; Saldaña and Velasco-Hernández 2021). Nevertheless, to the best of the authors’ knowledge, the number of studies investigating vaccine allocation via optimal control theory for STIs is relatively low. For example, Brown and White (2011) used an optimal control model to investigate targeted immunization programs for HPV in the United Kingdom. They found that the inclusion of both males and females into vaccination programs would be cost-effective and that vaccinating older individuals is also relevant for controlling the infection. Malik et al. (2016), explored the optimal vaccination rates of the bivalent, quadrivalent and nonavalent HPV vaccines if all three vaccines are in use but only in the female population. Their main conclusion was that immunization programs can optimally administer the three vaccines simultaneously by administering the quadrivalent and nonavalent vaccines at the maximum rates and the bivalent vaccine at moderate rates. Camacho et al. (2019) used a compartmental pair model coupled with optimal and feedback control to explore different public health strategies for the control of trichomoniasis, gonorrhea, chlamydia, and HPV. Saldaña et al. (2019) used optimal control theory to investigate the best combination of vaccination and screening to reduce the spread of HPV infection, as well as the cost of the intervention strategy. The results in these previous studies are deduced by employing commonly used \(L_{2}\)-type objective functionals. The approach presented in this study differs from previous methodologies in the sense that we consider a limited but specific vaccine supply via an isoperimetric constraint.

In this work, we contribute to the vaccine allocation literature investigating how prophylactic vaccines are best distributed in a population. Assuming sex-specific differences in susceptibility and disease outcomes, the main focus of our study is to investigate under which conditions the inclusion of both sexes into vaccination programs adds to the population-level impact of one-sex-only interventions. Theoretically, high vaccination coverage for one sex might be enough to reach herd immunity and eradicate an STI in a heterosexual population (Bogaards et al. 2011). Yet, some complications can arise depending on many factors such as (i) the male-to-female sexual infectivity rate is generally higher than that of female-to-male (Low et al. 2006; Wong et al. 2004) (ii) the health risks associated with the infection are considerably higher for females e.g. pelvic inflammatory disease, chronic pelvic pain, ectopic pregnancy, infertility, and cervical cancers (Low et al. 2006; Wong et al. 2004). Further, in some cases, there can be a group who is reluctant towards the vaccination; thus, a high vaccination coverage can be difficult to achieve even when targeting one sex-specific group (Saldaña et al. 2019). Our approach to addressing these issues relies on an optimal control problem, where the cumulative level of infected individuals is minimized under a limited vaccine stockpile and subject to a two-sex epidemic model.

The rest of this paper is organized as follows. In Sect. 2, we propose a two-sex Kermack–McKendrick-type model to describe the spread of an STI in a heterosexual population. The model considers prophylactic vaccine strategies that might include both genders. The analysis of equilibria together with the basic and control reproduction numbers are also investigated in Sect. 2. In Sect. 3, we formulate an optimal control problem (OCP) to seek optimal sex-specific vaccination programs aiming to minimize the total number of infections in the population. In Sect. 4, we provide a numerical approximation to the solution of OCP for several realistic vaccine scenarios with budget constraints that mimic a scarce vaccine stockpile insufficient to immunize the total population. We conclude by discussing the implications of our findings for gender-specific vaccination programs against STIs.

2 Methods

2.1 Model formulation

The model stratifies the total population at time t, denoted N(t) according to gender, so \(N(t)=N_{f}(t) + N_{m}(t)\), where \(N_{f}\) and \(N_{m}\) represent the number of sexually active females and males, respectively. Both populations \(N_{k}\) (\(k=f,m\)) are subdivided into mutually exclusive compartments according to infection status as unvaccinated susceptible (\(S_{k}\)), vaccinated susceptible (\(V_{k}\)), and infectious individuals (\(I_{k}\)). Hence, \(N_{k}(t) = S_{k}(t) + V_{k}(t) + I_{k}(t)\), (\(k=f,m\)). The transmission dynamics of a sexually transmitted infection in a heterosexual population are described by the following system of differential equations:

$$\begin{aligned} \begin{aligned} {\dot{S}}_{k}&= b_{k}N_{k} - (\lambda _{j \rightarrow k} + u_{k} + d_{k}) S_{k} + \alpha _{k}I_{k} + \theta _{k}V_{k},\\ {\dot{V}}_{k}&= u_{k}S_{k} -(1-\epsilon _{k})\lambda _{j \rightarrow k}V_{k} - (d_{k}+\theta _{k})V_{k},\qquad \quad (k,j = f,m,\quad k\ne j)\\ {\dot{I}}_{k}&= \lambda _{j \rightarrow k}(S_{k}+(1-\epsilon _{k})V_{k}) - (\alpha _{k}+d_{k})I_{k},\\ \end{aligned} \end{aligned}$$
(1)

where all the parameters and initial conditions are non-negative.

We assume individuals are recruited into the sexually active population as unvaccinated susceptible at a constant rate \(b_{k}\) proportional to \(N_{k}\) and \(1/d_{k}\) is the average duration of the sexual life for sex \(k=f,m\). Prophylactic immunization occurs at a rate \(u_{k}\). The vaccine reduces the force of infection by a factor \(\epsilon _{k} \in [0,1]\); thus, \(\epsilon _{k}\) is the vaccine effectiveness and the vaccine is \(100\%\) effective when \(\epsilon _{k} = 1\). Vaccine-induced immunity wanes at a rate \(\theta _k\), thus if \(\theta _{k}=0\), protection is lifelong. Individuals recover naturally from the infection at a rate \(\alpha _{k}\). No immunity is assumed after recovery. The acquisition of infection occurs with a sex-specific force of infection given by

$$\begin{aligned} \lambda _{f \rightarrow m} = \dfrac{\beta _{f \rightarrow m}I_f}{N_f}, \quad \lambda _{m \rightarrow f} = \dfrac{\beta _{m \rightarrow f}I_m}{N_m}. \end{aligned}$$
(2)

Here, \(\beta _{f \rightarrow m}\) (\(\beta _{m \rightarrow f}\)) is the female-to-male (male-to-female) transmission rate. We remark that although system (1) is a minimalist model, it captures the core characteristics of sexually transmitted infections in a heterosexual population under vaccination. For a full description of model parameters, together with their ranges and baseline values see Sect. 4.1 and Table 1.

2.2 Mathematical analysis

From system (1) it is immediate that the total population for sex \(k=f,m\) satisfies \({\dot{N}}_{k} = (b_{k} - d_{k})N_{k}\). Since we are interested in studying model (1) over a finite time interval \([0,t_{f}]\), we assume that the population for both sexes is constant i.e. \(N_{k}(t) = N_{k}(0):= N_{k}^{*}\) for all \(t\in [0, t_f]\), so \(b_{k}=d_{k}\). We stress that the constant population size assumption is standard in epidemic modeling and is based on the fact the time scale of the epidemic process is considerably faster than that of the demographic one for a short time horizon. Therefore, the biologically feasible region for system (1) is given by \(\Omega = \Omega _{f}\cup \Omega _{m}\), where

$$\begin{aligned} \Omega _{k} = \left\{ (S_{k}, V_{k}, I_{k})\in {\textbf{R}}^{3}_{+}: N_{k}^{*} = S_{k}(t) + V_{k}(t) + I_{k}(t),\; t\in [0,t_{f}]\right\} \; (k=f,m) \end{aligned}$$

Let \(x_{i}\) be an state variable of model (1), then if \(x_i = 0\) then \({\dot{x}}_i \ge 0\). It follows that all solutions of the system (1) with an initial condition in \(\Omega \) remain in \(\Omega \) for all \(t\ge 0\) and \(\Omega \) is forward invariant. The basic existence, uniqueness, and continuation results for model (1) hold in \(\Omega \) (Wiggins et al. 2003). Therefore system (1) is epidemiologically well-posed (Hethcote 2000) and it is sufficient to study its dynamics in \(\Omega \).

The disease-free equilibrium (DFE) of model (1) is given by

$$\begin{aligned} \begin{aligned} E_{0}&= (S_{f}^{0}, V_{f}^{0}, I_{f}^{0}, S_{m}^{0}, V_{m}^{0}, I_{m}^{0})\\&=\left( \dfrac{(d_f + \theta _f)N_f^{*}}{u_f + d_f + \theta _f}, \dfrac{u_f N_f^{*}}{u_f + d_f + \theta _f}, 0, \dfrac{(d_m + \theta _m)N_m^{*}}{u_m + d_m + \theta _m}, \dfrac{u_m N_m^{*}}{u_m + d_m + \theta _m}, 0 \right) . \end{aligned} \end{aligned}$$

Therefore, the susceptible and vaccinated fractions at equilibrium are

$$\begin{aligned} s_{k}^{0}=\dfrac{S_{k}^{0}}{N_{k}^{*}} = \dfrac{d_k + \theta _k}{u_k + d_k + \theta _k},\quad v_{k}^{0}=\dfrac{V_{k}^{0}}{N_{k}^{*}} = \dfrac{u_k}{u_k + d_k + \theta _k},\quad (k=f,m). \end{aligned}$$
(3)

Observe that in the absence of vaccination, at the DFE, the whole population remains susceptible. Using the next-generation operator (Diekmann et al. 1990) and the method of Van den Driessche and Watmough (2002) we obtain the following next-generation matrix

$$\begin{aligned} {\textbf{K}} = \begin{bmatrix} 0 &{} \quad \dfrac{\beta _{m \rightarrow f}(S_{f}^{0} + (1-\epsilon _{f})V_{f}^{0})}{(\alpha _m + d_m)N_{m}^{*}} \\ \dfrac{\beta _{f \rightarrow m}(S_{m}^{0} + (1-\epsilon _{m})V_{m}^{0})}{(\alpha _f + d_f)N_{f}^{*}} &{} \quad 0 \end{bmatrix} \end{aligned}$$
(4)

The control reproduction number is defined as the spectral radius \(\rho ({\textbf{K}})\), that is, the largest eigenvalue of the next generation matrix. Therefore, the analytic expression for the control reproduction number is

$$\begin{aligned} R_c(u_f, u_m) = \sqrt{\dfrac{\beta _{f \rightarrow m}(s_{m}^{0} + (1-\epsilon _{m})v_{m}^{0})}{(\alpha _f + d_f)}\times \dfrac{\beta _{m \rightarrow f}(s_{f}^{0} + (1-\epsilon _{f})v_{f}^{0})}{(\alpha _m + d_m)} }. \end{aligned}$$
(5)

The notation \(R_c\) is used to emphasize that the reproduction number is derived under control measures, in this case, vaccination. The square root in (5) arises since it takes two generations for infected hosts to produce newly infected hosts of the same sex (Van den Driessche and Watmough 2008). For a biological intuition of \(R_c\) observe that an infectious individuals of sex j produces on average \(\beta _{j \rightarrow k}(s_{k}^{0} + (1-\epsilon _{k})v_{k}^{0})\) infections on the opposite sex k \((k,j = f,m,\; k\ne j)\), during his/her infectious period \(1/(\alpha _j + d_j)\).

The basic reproduction number in the absence of vaccination, \(R_0\), satisfies

$$\begin{aligned} R_0 = R_c(0, 0) = \sqrt{ \dfrac{\beta _{f \rightarrow m}}{(\alpha _f + d_f)} \dfrac{\beta _{m \rightarrow f}}{(\alpha _m + d_m)} }> R_c(u_f, u_m)\; \text {for}\; u_f, u_m>0. \end{aligned}$$
(6)

As a direct consequence of Theorem 2 in Van den Driessche and Watmough (2002), we obtain the local stability for the DFE. The result is formalized as follows.

Theorem 1

The disease-free equilibrium \(E_0\) for model (1) is locally asymptotically stable if \(R_c <1\) and unstable if \(R_c >1\).

We now investigate the existence of the endemic equilibria of the form \((S_{f}^{\dagger }, V_{f}^{\dagger }, I_{f}^{\dagger }, S_{m}^{\dagger }, V_{m}^{\dagger }, I_{m}^{\dagger })\) where \(0<I_{f}^{\dagger }<N_{f}^{*}\), and \(0<I_{m}^{\dagger }<N_{m}^{*}\) (a straightforward computation can show that \(I_{f}^{\dagger }=0\) implies \(I_{m}^{\dagger } = 0\), and vice-versa). Further, since we are dealing with constant population for both sexes, we can express the endemic equilibria for the susceptible as \(S_{k}^{\dagger } = N_{k}^{*} - V_{k}^{\dagger } -I_{k}^{\dagger }\) (\(k=f,m\)). Then we can solve the equilibrium equations for the vaccinated classes \(V_{f}^{\dagger }\) and \(V_{m}^{\dagger }\) in terms of the infected classes \(I_{f}^{\dagger }\) and \(I_{m}^{\dagger }\) as

$$\begin{aligned} V_{m}^{\dagger } = \frac{u_m (N_m^{*} - I_{m}^{\dagger }) }{d_m + u_m + \theta _m + (1 - \epsilon _m) \beta _{f \rightarrow m}I_{f}^{\dagger }/N_f^{*}}, \\ V_{f}^{\dagger } = \frac{u_f (N_f^{*} - I_{f}^{\dagger }) }{d_f + u_f + \theta _f + (1 - \epsilon _f) \beta _{m \rightarrow f}I_{m}^{\dagger }/N_m^{*}}. \end{aligned}$$

Next, defining

$$\begin{aligned} \begin{aligned} \delta&= d_m + \theta _m + ( 1 - \epsilon _m )u_m,\\ \zeta&= (\alpha _m + d_m )N_f^{*} \left( (d_m + u_m + \theta _m )N_f^{*} + (1 - \epsilon _m) \beta _{f \rightarrow m}I_f^{\dagger } \right) , \end{aligned} \end{aligned}$$

we can express the infected males as \(I_{m}^{\dagger }= I_{f}^{\dagger }F(I_{f}^{\dagger })\) where

$$\begin{aligned} F(I_f^{\dagger }) = \frac{\beta _{f\rightarrow m} N_m^{*} (\delta N_{f}^{*} + (1 - \epsilon _m) \beta _{f \rightarrow m} I_f^{\dagger })}{\beta _{f \rightarrow m}\delta N_{f}^{*}I_f^{\dagger } + (1 - \epsilon _m)(\beta _{f \rightarrow m}I_f^{\dagger })^2 + \zeta }. \end{aligned}$$
(7)

Finally, the infected females at the endemic equilibrium \(I_{f}^{\dagger }\) correspond to the zeros of the following four order polynomial

$$\begin{aligned} A I_{f}^{\dagger } (F(I_{f}^{\dagger }))^2 + B F(I_{f}^{\dagger }) + C = 0 \end{aligned}$$
(8)

where

$$\begin{aligned} A&= \beta _{m \rightarrow f}^{2} (1 - \epsilon _f) (N_f^{*} - I_f^{\dagger })\\ B&= \beta _{m \rightarrow f} N_{m}^{*} \left( - (\alpha _f + d_f ) (1 - \epsilon _f ) I_f^{\dagger } + (N_f^{*} - I_f^{\dagger }) (d_f +\theta _f + (1 - \epsilon _f) u_f ) \right) \\ C&= - (\alpha _f + d_f )(d_f + \theta _f + u_f)(N_{m}^{*})^2 \end{aligned}$$

In the particular case for which the vaccine efficacy is \(100\%\), that is, \(\epsilon _{f}=\epsilon _{m}=1\), we can find a unique endemic equilibrium given by

$$\begin{aligned} \dfrac{I_f^{\dagger }}{N_f^{*}}= & {} \frac{R_{0}^{2}(d_m + \theta _m)(d_f + \theta _f) - (d_m + \theta _m + u_m)(d_f + \theta _f + u_f) }{R_{0}^{2}(d_m + \theta _m)(d_f + \theta _f)+ \beta _{m\rightarrow f}(d_m + \theta _m )(d_f + \theta _f + u_f)/(\alpha _m + d_m)},\nonumber \\ \dfrac{I_m^{\dagger }}{N_m^{*}}= & {} \frac{ (\alpha _f + d_f )I_f ^{\dagger }}{\beta _{m \rightarrow f} s_{f}^{0} (N_f^{*} - I_f^{\dagger })}. \end{aligned}$$
(9)

Observe that the above equilibrium only exists if the condition

$$\begin{aligned} R_{0}^{2}(d_m + \theta _m)(d_f + \theta _f) > (d_m + \theta _m + u_m)(d_f + \theta _f + u_f) \end{aligned}$$

is fulfilled. This occurs if and only if \(R_{c}>1\), therefore the classical forward bifurcation occurs when the vaccine is \(100\%\) effective and the two-sex epidemic model (1) presents a unique endemic equilibrium. In the general case, it is not possible to obtain a closed-form solution for the endemic equilibria but numerical results indicate that the number of endemic equilibria is at most two. Furthermore, a backward bifurcation can occur if the vaccine effectiveness \(\epsilon _{k}\) (\(k=f,m\)) is below a certain threshold. Figure 1 depicts the typical dynamics for the endemic equilibria of the infected female class where the backward bifurcation is present. The equilibrium dynamics for the male infected class follow the same qualitative behavior (not shown).

Fig. 1
figure 1

Endemic equilibria for the infected female sub-population, \(I_f\), as a function of the expected number of sexual contacts that a typical man carries out per year \(c_f\). Vaccine effectiveness for both sexes is \(80\%\). Parameter values are shown in Table 1

3 Optimal vaccine allocation

In this section, we propose an optimal control problem with an isoperimetric constrain to investigate the best sex-specific vaccine deployment under a limited vaccine budget. For this, we consider time-dependent vaccination rates \(u_{f}(t)\) and \(u_{m}(t)\) per unit of time, thus the controlled model becomes

$$\begin{aligned} \begin{aligned} {\dot{S}}_{k}&= b_{k}N_{k} - (\lambda _{j \rightarrow k} + u_{k}(t) + d_{k}) S_{k} + \alpha _{k}I_{k} + \theta _{k}V_{k}, \\ {\dot{V}}_{k}&= u_{k}S_{k} -(1-\epsilon _{k})\lambda _{k}V_{k} - (d_{k}+\theta _{k})V_{k},\qquad (k,j = f,m,\quad k\ne j)\\ {\dot{I}}_{k}&= \lambda _{k}(S_{k}+(1-\epsilon _{k})V_{k}) - (\alpha _{k}+d_{k})I_{k}, \end{aligned} \end{aligned}$$
(10)

subject to non-negative initial conditions. The vaccination rates will be called controls and denoted by the vector \({\textbf{c}}(t)=(u_{f}(t),u_{m}(t))^{T}\).

We conceptualize a limited vaccine supply assuming that the number of vaccines available under the time interval of interest \([0, t_f]\) is fixed with a value W and that all vaccines will be delivered to the population. We further assume that the vaccine stockpile is not enough to vaccinate the whole population i.e. \(W< N\) since in another case there is no need to optimize vaccine allocation.

This condition can be modeled by the following isoperimetric constraint (Kamien and Schwartz 2012; Lenhart and Workman 2007):

$$\begin{aligned} \int _{0}^{t_f} u_{f}(t) S_{f}(t) + u_{m}(t) S_{m}(t)dt = W. \end{aligned}$$
(11)

The problem for public health officers is to choose an optimal vaccine deployment to minimize the prevalence of the infection, as well as the overall costs of vaccine deployment. In mathematical terms, such a goal can be achieved by minimizing the following objective functional

$$\begin{aligned} J=\int _{0}^{t_f} A_1 I_{f}(t) + A_ 2 I_{m}(t) + A_3 u_{f}^{2}(t) + A_4 u_{m}^{2}(t) dt. \end{aligned}$$
(12)

The weight parameters \(A_i\) \((i=1,\ldots ,4)\) describe the relative impact of the control or state variables on the value of the objective functional (see Sect. 4.3). The dependence on the control in the objective functional (12) is assumed to be a quadratic function of the control itself. A reason for such a choice is that the quadratic terms penalize high levels of vaccine deployment in comparison with the cost of low levels (Saldaña et al. 2019). We follow this approach but we remark that this formulation offers important mathematical and numerical advantages, as for such \(L_{2}\)-type functionals, the application of Pontryagin’s Maximum Principle allows us to obtain a closed-form formula for the controls as a function of the states and adjoints that can be solved numerically as a boundary value problem (Lenhart and Workman 2007).

The control set is defined by

$$\begin{aligned} {\mathcal {U}} = \{ {\textbf{c}}(t): u_{k}(t)\; \text {bounded and Lebesgue measurable on}\; [0, t_f],\; k=f,m\}, \end{aligned}$$
(13)

with bounds

$$\begin{aligned} 0\le u_{f}(t), u_{m}(t) \le u_{max},\quad \forall t\in [0,t_f]. \end{aligned}$$
(14)

Observe that besides the budgetary constraint (11), the vaccination rates should be constrained (due to logistic limitations) under a maximum vaccination rate \(u_{max}\) per unit of time e.g. daily vaccination rate. As shown in Saldaña et al. (2022), a vaccination rate u can be approximated by

$$\begin{aligned} u = -\ln (1-V_{c}(t))/t \end{aligned}$$
(15)

where \(V_{c}(t)\) is the fraction of vaccinated individuals at time t, that is, the vaccination coverage. Considering a very optimistic case in which health authorities achieve a vaccination coverage \(V_{c}(t)=80\%\) of the population in \(t=1\) year, we obtain that the constant vaccination rate \(u\approx 1.60\) per year. Therefore, we choose a maximum daily vaccination rate as \(u_{max} = 1.60/365\).

Given the special structure of (11), we can convert the isoperimetric constraint (11) into a fixed endpoint constrain (Kamien and Schwartz 2012), by defining

$$\begin{aligned} Z(t) = \int _{0}^{t} u_{f}(s) S_{f}(s) + u_{m}(s) S_{m}(s)ds. \end{aligned}$$
(16)

The additional state variable, Z(t), represents the cumulative number of vaccines that have been given at time t, and satisfies

$$\begin{aligned} {\dot{Z}}(t) = u_{f}(t) S_{f}(t) + u_{m}(t) S_{m}(t), \quad Z(0) = 0, \quad Z(t_f) = W. \end{aligned}$$
(17)

The Optimal Control Problem (OCP) is stated as follows:

$$\begin{aligned} \min _{{\textbf{c}}\ \in \ {\mathcal {U}}} J({\textbf{c}}) \text { subject to model}\; (10)\; \text {coupled with constrain}\; (17). \end{aligned}$$
(18)

An application of the Fillipov-Cesari theorem (Fleming and Rishel 1975, Chapter III, Theorem 4.1) gives conditions to assert the existence of an optimal control pair

$$\begin{aligned} {\textbf{c}}^{*}(t)=(u_{f}^{*}(t),u_{m}^{*}(t))^{T} \end{aligned}$$

and corresponding optimal state solutions

$$\begin{aligned} {\textbf{X}}^{*}(t)=(S_{f}^{*}(t), V_{f}^{*}(t), I_{f}^{*}(t), S_{m}^{*}(t), V_{m}^{*}(t), I_{m}^{*}(t), Z^{*}(t))^{T} \end{aligned}$$

for the OCP (18). The proof is standard for \(L_2\)-type objective functionals and we omit it. Proofs of such statements can be found in Camacho et al. (2019); Saldaña et al. (2019); Sepulveda-Salcedo et al. (2020). We now use Pontryagin’s Maximum Principle to state the necessary criterion satisfied by an optimal control (Fleming and Rishel 1975; Kamien and Schwartz 2012).

Theorem 2

If \({\textbf{X}}^{*}(t)\) and \({\textbf{c}}^{*}(t)\) are optimal for the OCP (18), then there exist a constant \(\lambda _0\) and piecewise differentiable functions \({\lambda }(t) = (\lambda _1, \ldots , \lambda _7)\), where for all \(t\in [0, t_f]\) we have \((\lambda _0, {\lambda }(t)) \ne (0, {\textbf{0}})\), such that for every \(t\in [0, t_f]\)

$$\begin{aligned} H(t, {\textbf{X}}^{*}(t), {\textbf{c}}^{*}(t), {\lambda }(t)) \le H(t, {\textbf{X}}^{*}(t), {\textbf{c}}(t), {\lambda }(t)) \end{aligned}$$
(19)

for all admissible controls \({\textbf{c}} \in \ {\mathcal {U}}\), where the Hamiltonian function H is defined by

$$\begin{aligned} \begin{aligned} H(t, {\textbf{X}}, {\textbf{c}}, {\lambda })&= \lambda _0 \left[ A_1 I_{f} + A_ 2 I_{m} + A_3 u_{f}^{2} + A_4 u_{m}^{2}\right] \\&\quad + \lambda _1 \left[ b_{f}N_{f} - (\lambda _{m \rightarrow f} + u_{f} + d_{f}) S_{f} + \alpha _{f}I_{f} + \theta _{f}V_{f}\right] \\&\quad + \lambda _2 \left[ u_{f}S_{f} -(1-\epsilon _{f})\lambda _{m \rightarrow f} V_{f} - (d_{f}+\theta _{f})V_{f}\right] \\&\quad + \lambda _3 \left[ \lambda _{m \rightarrow f}(S_{f}+(1-\epsilon _{f})V_{f}) - (\alpha _{f}+d_{f})I_{f}\right] \\&\quad + \lambda _4 \left[ b_{m}N_{m} - (\lambda _{f \rightarrow m} + u_{m} + d_{m}) S_{m} + \alpha _{m}I_{m} + \theta _{m}V_{m}\right] \\&\quad + \lambda _5 \left[ u_{m}S_{m} -(1-\epsilon _{m})\lambda _{f \rightarrow m}V_{m} - (d_{m}+\theta _{m})V_{m}\right] \\&\quad + \lambda _6 \left[ \lambda _{f \rightarrow m}(S_{m}+(1-\epsilon _{m})V_{m}) - (\alpha _{m}+d_{m})I_{m}\right] \\&\quad + \lambda _7 \left[ u_f S_f + u_m S_m\right] . \end{aligned} \end{aligned}$$
(20)

Except at points of discontinuity of \({\textbf{c}}^{*}(t)\), the adjoint variable \({\lambda }(t)\) satisfies

$$\begin{aligned} \begin{aligned} {\dot{\lambda }}_1&= \lambda _1 \left( \dfrac{\beta _{m \rightarrow f}I_m^{*}}{N_{m}^{*}} + u_f^{*} + d_f\right) - \lambda _2 u_f^{*} - \lambda _3 \dfrac{\beta _{m \rightarrow f}I_m^{*}}{N_{m}^{*}} - \lambda _7 u_f^{*},\\ {\dot{\lambda }}_2&= -\lambda _1 \theta _f + \lambda _2 \left[ (1-\epsilon _f)\dfrac{\beta _{m \rightarrow f}I_m^{*}}{N_{m}^{*}} + (d_f + \theta _f)\right] - \lambda _3 (1-\epsilon _f)\dfrac{\beta _{m \rightarrow f}I_m^{*}}{N_{m}^{*}},\\ {\dot{\lambda }}_3&= -\lambda _0 A_1 -\lambda _1 \alpha _f + \lambda _3 (\alpha _f + d_f) + \lambda _4 \dfrac{\beta _{f \rightarrow m}}{N_f^{*}}S_m^{*} + \lambda _5 (1-\epsilon _m)\dfrac{\beta _{f \rightarrow m}}{N_f^{*}}V_m^{*}\\&\quad - \lambda _6 \dfrac{\beta _{f \rightarrow m}}{N_f^{*}}(S_m^{*} + (1-\epsilon _m)V_m^{*}),\\ {\dot{\lambda }}_4&= \lambda _4 \left( \dfrac{\beta _{f \rightarrow m}I_f^{*}}{N_{f}^{*}} + u_m^{*} + d_m\right) - \lambda _5 u_m^{*} - \lambda _6 \dfrac{\beta _{f \rightarrow m}I_f^{*}}{N_{f}^{*}} - \lambda _7 u_m^{*},\\ {\dot{\lambda }}_5&= -\lambda _4 \theta _m + \lambda _5 \left[ (1-\epsilon _m)\dfrac{\beta _{f \rightarrow m}I_f^{*}}{N_{f}^{*}} + (d_m + \theta _m)\right] - \lambda _6 (1-\epsilon _m)\dfrac{\beta _{f \rightarrow m}I_f^{*}}{N_{f}^{*}},\\ {\dot{\lambda }}_6&= -\lambda _0 A_2 + \lambda _1 \dfrac{\beta _{m \rightarrow f}}{N_m^{*}}S_f^{*} + \lambda _2 (1-\epsilon _f)\dfrac{\beta _{m \rightarrow f}}{N_m^{*}}V_f^{*} - \lambda _3 \dfrac{\beta _{m \rightarrow f}}{N_m^{*}}(S_f^{*} + (1-\epsilon _f)V_f^{*})\\&\quad -\lambda _4 \alpha _m + \lambda _6 (\alpha _m + d_m),\\ {\dot{\lambda }}_7&= 0. \end{aligned} \end{aligned}$$
(21)

Furthermore,

$$\begin{aligned} \lambda _0 = 1\quad \text {or}\quad \lambda _0 = 0. \end{aligned}$$
(22)

Last, the following transversality conditions are satisfied:

$$\begin{aligned} \lambda _i(t_f) = 0\quad i = 1,\ldots , 6,\quad \lambda _7(t_f) = \text {free}. \end{aligned}$$
(23)

The adjoint variables \(\lambda _i(t)\) (\(i = 1,\ldots , 6\)) have a classical interpretation in OCP as the marginal valuation of the associated state variable at time t (Kamien and Schwartz 2012). The value of the constant \(\lambda _0\) in the Hamiltonian (20) is either 0 or 1. If \(\lambda _0 =1\), then the OCP (18) would have a solution in which the objective matters (Kamien and Schwartz 2012). In this scenario, the Hamiltonian function has the standard form, and minimization of the objective functional (12) is equivalent to minimization of H as a function of \({\textbf{c}}(t)\) along the optimal path. This is not always possible for OCPs that include an isoperimetric constraint (Fleming and Rishel 1975). This results from the fact that the controlled system (10) coupled with (17), has more endpoint conditions than differential equations. Hence, the system is over-determined and the optimization problem may become unfeasible. If \(\lambda _0 = 0\), one can handle the OCP finding an admissible control \({\textbf{c}}^{*}(t)\) that satisfies the isoperimetric constrain (11). However, such control will neglect the value of the objective functional (Sepulveda-Salcedo et al. 2020). Problems in which \(\lambda _0 = 0\) are called abnormal (Fleming and Rishel 1975) and the optimal control usually presents a bang-bang structure since H is a linear function in the control. A feasible control, in this case, is to start vaccinating with the maximal effort at the initial phase and to continue vaccinating with a maximal effort to deploy all the vaccines at a time \({\hat{t}} \in (0, t_f)\) (Hansen and Day 2011; Sepulveda-Salcedo et al. 2020).

In our context, we cannot disregard the value of the objective functional since is essential to find the optimal vaccine deployment. Hence, hereafter we assume \(\lambda _0 = 1\). From the first-order optimality conditions we have

$$\begin{aligned} \dfrac{\partial H(t, {\textbf{X}}^{*}(t), {\textbf{c}}^{*}(t), {\lambda }(t))}{\partial u_{f}} = 2A_{3}u_f^{*}(t) - (\lambda _{1}(t) - \lambda _{2}(t) - K)S_{f}^{*}(t) = 0, \end{aligned}$$
(24)
$$\begin{aligned} \dfrac{\partial H(t, {\textbf{X}}^{*}(t), {\textbf{c}}^{*}(t), {\lambda }(t))}{\partial u_{m}} = 2A_{4}u_{m}^{*}(t) - (\lambda _{4}(t) - \lambda _{5}(t) - K)S_{m}^{*}(t) = 0. \end{aligned}$$
(25)

Considering the lower and upper bounds for the controls and the optimality conditions (24)–(25), we obtain the following characterization of the optimal controls:

$$\begin{aligned} u_f^{*}(t) = \min \left\{ \max \left\{ 0, \dfrac{(\lambda _{1}(t) - \lambda _{2}(t) - K)S_{f}^{*}(t)}{2A_3} \right\} , u_{max}\right\} , \end{aligned}$$
(26)
$$\begin{aligned} u_m^{*}(t) = \min \left\{ \max \left\{ 0, \dfrac{(\lambda _{4}(t) - \lambda _{5}(t) - K)S_{m}^{*}(t)}{2A_4} \right\} , u_{max}\right\} . \end{aligned}$$
(27)

The constant \(K\in {\textbf{R}}\) comes from the solution of the last equation in the adjoint system (21), which implies \(\lambda _7 = K\), where K should be chosen to fulfill the condition \(Z(t_f) = W\).

4 Numerical results

Here, we complement the analytical results in the previous sections with the numerical computation of the optimal control. To obtain the optimal control solutions we must solve the optimality system which is a boundary value problem involving the state equations (10), coupled with the fixed endpoint constrain (17), and the adjoint system (21). The characterization of the optimal control (26)–(27) has to be substituted in the latter equations to get a system that only depends on the state and adjoint variables. Observe that although the model variables for the controlled system (10) have free end conditions, the additional state variable Z(t) has a specified endpoint (17). Therefore, the forward–backward sweep method (FBSM) cannot be applied directly to solve the optimality system (Lenhart and Workman 2007). Instead, we need to find the value K for the adjoint variable \(\lambda _7 = K\) such that \(Z(t_f) = W\). To this end, we consider an adapted FBSM that takes as an input a guess for K, and solves the corresponding OCP. The solution obtained by the implementation of FBSM is denoted as \(\varphi (K)\), and the corresponding final value for the auxiliary function Z that computes the number of cumulative vaccinated individuals is denoted \(Z_{K}(t_f)\). The adapted FBSM is an iterative process that seeks the value of K that minimizes the difference \(Z_{K}(t_f) - W\). We use the classical secant method to solve this outer iterative process which usually involves several iterations of the FBSM.

The algorithm for the inner FBSM obtains a control update \(\hat{{\textbf{c}}}^{(m)}\) for step m solving the optimality system. Often, a direct update of the control \({\textbf{c}}^{(m)} = \hat{{\textbf{c}}}^{(m)}\), \(k=1,2,\ldots \) is sufficient for convergence. Nevertheless, a weighted update such that

$$\begin{aligned} {\textbf{c}}^{(m)} = (1-\mu )\hat{{\textbf{c}}}^{(m)} + \mu {\textbf{c}}^{(m-1)},\quad \mu \in [0,1),\quad k=1,2,\ldots \end{aligned}$$
(28)

is commonly used to improve convergence properties (Lenhart and Workman 2007). The choice of \(\mu \) significantly accelerates convergence relative to the direct update (Sharp et al. 2021), particularly if \(\mu \) is updated between iterations. However, since the optimal choice for \(\mu \) is problem-dependent, here we use a constant \(\mu =0.9\) for all iterations. Convergence properties for the FBSM for this case are discussed in Lenhart and Workman (2007); Sharp et al. (2021). As a convergence criterion, we require the relative error to be negligibly small so that

$$\begin{aligned} \delta \Vert {\textbf{c}}^{(m)} \Vert - \Vert {\textbf{c}}^{(m)}-{\textbf{c}}^{(m-1)}\Vert \ge 0, \end{aligned}$$
(29)

is satisfied. Here, \(\Vert \cdot \Vert \) is the Euclidean norm and \(\delta \) is the accepted tolerance (fixed as \(\delta =0.0001\)). The equivalent convergence criteria should be satisfied by the state and adjoint variables. For the outer FBSM we seek that \(Z_{K}(t_f) = W\) is satisfied with a desired tolerance using \(\Vert Z_{K}(t_f) - W\Vert <10^{-4}W\).

4.1 Model parameters

We retrieved the baseline values for some of our model parameters using sexual behavior data from the United States of America (USA) and estimations from previous studies on STIs. Rather than studying a single disease, our approach is to investigate a set of scenarios of interest that might be plausible for the most common STIs. The selection of parameters is outlined as follows.

The sexually active life expectancy has been estimated to be on average higher for males than for females (Lindau and Gavrilova 2010). In particular, the sexually active life expectancy for males is 34.7 years with a \(95\%\) confidence interval (34.1, 35.3). Thus, \(1/d_m \in (34.1, 35.3)\) years. The sexually active life expectancy for females is 30.7 years with a \(95\%\) confidence interval (30, 31.4). Thus, \(1/d_f \in (30, 31.4)\) years. In 2020, it was estimated in the USA that the percentage of the female population is \(50.52\%\) compared to \(49.48\%\) in the male population (United Nations 2020). Therefore, \(N_f^{*} = 0.5052 N\) and \(N_m^{*} = 0.4948 N\). For simplicity, we assume that the total population is \(N=100,000\).

The parameter \(\beta _{m \rightarrow f} = c_m p_{m \rightarrow f}\) is the transmission rate from males to females, where \(c_m\) is the expected number of sexual contacts with men that a typical woman carries out per unit of time and \(p_{m \rightarrow f}\) is the probability of female infection given contact with an infectious male. Likewise, the transmission rate from females to males \(\beta _{f \rightarrow m} = c_f p_{f \rightarrow m}\), is the product of the expected number of sexual contacts with women that a typical man carries out per unit of time \(c_f\) and the probability of male infection given contact with an infectious female \(p_{f \rightarrow m}\). To obtain the conservation of total sex contacts, the mixing function should satisfy the following condition (Busenberg and Castillo-Chavez 1991):

$$\begin{aligned} c_{f}N_{m}^{*} = c_{m}N_{f}^{*}. \end{aligned}$$
(30)

Observe that if \(N_f^{*} \ne N_m^{*}\) then the parameters \(c_f\) and \(c_m\) can differ substantially. Under our conditions, if we assume that \(c_f\) is fixed, we can obtain \(c_m = 0.4948 c_f/ 0.5052 = 0.9794 c_f\). Men and women in good health report frequent sex (once or more weekly) (Lindau and Gavrilova 2010). In our study, we assume that the expected number of sexual contacts that a typical man carries out follows a triangular distribution \(c_f \sim Tri(0, 100, 52)\) per year (Lindau and Gavrilova 2010). Furthermore, there is evidence that the male-to-female sexual infectivity rate is generally greater than that for female-to-male (Low et al. 2006; Wong et al. 2004). For example, for genital herpes HSV-2, estimations indicate that \(p_{m \rightarrow f} \approx 4p_{f \rightarrow m}\) (Heffernan et al. 2014). Therefore, we set \(p_{m \rightarrow f} > p_{f \rightarrow m}\), and we propose \(p_{m \rightarrow f}\sim Tri(0, 1, 0.70)\), and \(p_{f \rightarrow m}\sim Tri(0, 1, 0.40)\).

According to the WHO, to be approved, vaccines are required to have a high efficacy rate of at least 50% (World Health Organization 2021). Current vaccines against STIs have been proven to be highly effective to prevent infection e.g. vaccines against HPV, and hepatitis B virus (Gottlieb et al. 2016). In this study, we consider vaccine efficacy between \(60\%\)-\(95\%\) for both sexes (\(\epsilon _{f}, \epsilon _{m}\in [0.60, 0.95]\)). The average infectious period might vary substantially in STIs, depending on the disease, ranging from a few days up to several months (Workowski and Bolan 2015). As a consequence, we assume \(1/\alpha _{k} \in [10, 100]\) days (\(k=f,m\)). Regarding the duration of vaccine-induced immunity, we assume that the protection last from at least one year and can be maintained up to 30 years, hence \(1/\theta _{k} \in [1, 30]\) years (\(k=f,m\)). Model parameters are summarized in Table 1.

Table 1 Baseline model (1) parameters (\(k=f,m\)). References for the parameter values are given in the main text. The total population is assumed to be \(N=100{,}000\) with a gender distribution \(N_f^{*} = 0.5052 N\) and \(N_m^{*} = 0.4948 N\)

4.2 Global sensitivity analysis for the reproduction numbers

Here, a global sensitivity analysis is performed to provide a quantitative measure of the contributions of the model parameters on the reproduction numbers \(R_0\) and \(R_c\). We use a variance-based sensitivity analysis classically referred as the Sobol method which is, so far, one of the most powerful techniques among current global sensitivity analysis methods (Zhang et al. 2015). Sobol sensitivity analysis determines the contribution of input parameters to the overall variance of a model outcome of interest, in our case, the reproduction numbers. In particular, the so-called first-order Sobol indices measure the contribution to the output variance by a single model input alone. Whereas, the total-order index measures the contribution to the output variance caused by a model input, including both its first-order effects and all higher-order interactions (Saltelli et al. 2008). We perform numerical experiments (100,000 samples) using SALib, an open-source library written in Python for performing sensitivity analyses (Herman and Usher 2017). The ranges used for the parameters are listed in Table 1.

Fig. 2
figure 2

a First (blue) and total (red) Sobol’s indices for the basic reproduction number \(R_0\). The ranges for the parameters are listed in Table 1. The vertical black lines in the indices represent 95% confidence intervals. b Histogram for the distribution of \(R_0\). The solid line represents a kernel density estimation for the continuous distribution (color figure online)

Figure 2a shows the first (blue) and total (red) Sobol’s indices for the basic reproduction number \(R_0\). The dark marks on top of the bars in Fig. 2a represent 95% confidence intervals for the sensitivity indices. Notice that they are very small. Observe that the expected number of sexual contacts \(c_{k}\) together with the recovery rates \(\alpha _{k}\) (\(k=f,m\)) are the parameters that contribute the most to the variability of \(R_0\). Whereas, the contribution to the variability of \(R_0\) given by the mortality rates \(d_k\) (\(k=f,m\)) is practically zero. Figure 2b shows a histogram for the distribution of \(R_0\). The solid line represents a kernel density estimation for the continuous distribution. Observe that although in most cases \(R_0\) value is below 1, in some extreme scenarios \(R_0\) can be as high as 3.

Figure 3a shows the first (blue) and total (red) Sobol’s indices for the control reproduction number \(R_c\). As in the case for \(R_0\), the parameters \(c_{k}\) and \(\alpha _{k}\) (\(k=f,m\)) contribute the most to the variance of \(R_c\). Figure 3b shows a histogram for the distribution of \(R_c\). Observe that the distribution for \(R_c\) is closer to low values in comparison with the \(R_0\) distribution (see Fig. 2b). Hence, even though the vaccine parameters (\(\epsilon _{k}\), \(u_{k}\), \(\theta _{k}\)) are not the most influential parameters on \(R_c\), they still can significantly reduce the value of \(R_c\).

Fig. 3
figure 3

a First (blue) and total (red) Sobol’s indices for the control reproduction number \(R_c\). The ranges for the parameters are listed in Table 1. The vertical black lines in the indices represent 95% confidence intervals. b Histogram for the distribution of \(R_c\). The solid line represents a kernel density estimation for the continuous distribution (color figure online)

4.3 Vaccination scenarios

We investigate several vaccination scenarios to evaluate the optimal sex-specific vaccine deployment among the population. The time horizon for our simulations is 365 days, that is, \(t_f = 365\) days and \(t\in [0, t_f]\). In the objective functional (12), the parameters \(A_1\) and \(A_2\) balance the cost of the reduction in health and well-being of infected females and males, respectively. These costs related to pain and suffering are sometimes referred to as morbidity costs (Muennig and Bounthavong 2016). On the other hand, \(A_3\) and \(A_4\) represent the costs of vaccine deployment in females and males, respectively. In real-life scenarios, the monetary costs and side effects of a vaccination program are typically small compared with the potential losses that an outbreak can inflict. Hence, we assume \(A_1, A_2 > A_3, A_4\). Furthermore, females are more severely affected by STIs because of anatomical physiological characteristics. So in a heterosexual setting, women bear the largest burden (Workowski and Bolan 2015). The classical example is HPV infection. While HPV infection can lead to cervical cancer and death in women, the infection in men rarely leads to severe health problems (penile cancer from HPV might happen but the rate is far lower than the rate for cervical cancer) (Sung et al. 2021). Therefore, \(A_1 > A_2\). In particular, for the numerical simulations, we assume \(A_1 = 10\), \(A_2 =1\). The cost of vaccine deployment is assumed to be the same for both sexes and is fixed as \(A_3 = A_4 = A_{2}/2\).

To better quantify the gender-specific optimal vaccine deployment we define

$$\begin{aligned} Z_{f}(t)=\int _{0}^{t}u_{f}(s)S_{f}(s)ds,\quad Z_{m}(t)=\int _{0}^{t}u_{m}(s)S_{m}(s)ds. \end{aligned}$$
(31)

Observe that \(Z_{f}(t)\) and \(Z_{m}(t)\) represent the cumulative number of vaccinated females and males, respectively, at time t, and \(Z(t) = Z_{f}(t) + Z_{m}(t)\) for all \(t\in [0, t_{f}]\). Furthermore, since vaccinated individuals can still get infected, it follows that \(Z_{f}(t)\ge V_{f}(t)\), \(Z_{m}(t)\ge V_{m}(t)\) for all \(t\in [0, t_{f}]\).

4.3.1 A starting vaccination roll-out program

As a first scenario, we consider a starting vaccination roll-out program where no individuals in the population have been vaccinated. Initial conditions are set as follows: \(I_{f}(0) = I_{m}(0)= 10\), \(V_{f}(0) = V_{m}(0)= 0\), and \(S_{f}(0) = N_{f}^{*} - I_{f}(0) - V_{f}(0)\), \(S_{m}(0) = N_{m}^{*} - I_{m}(0) - V_{m}(0)\). Regarding the vaccine stockpile, we consider three cases corresponding to the supply of vaccines for 20% (\(W = 0.2N\)), 30% (\(W = 0.3N\)), and 40% (\(W = 0.4N\)) of the total population.

Fig. 4
figure 4

First column: Optimal time-dependent vaccination rates for females \(u_{f}^{*}(t)\) (blue) and males \(u_{f}^{*}(t)\) (red). Second column: Cumulative number of vaccinated females (blue) and vaccinated males (red) computed from the optimal states corresponding to the optimal controls on the first column. The total cumulative number of vaccines administered, Z(t), is shown in yellow. For both columns, the supply of vaccines corresponds to 20% (a, b) (first row), 30% (c, d) (second row), and 40% (e, f) (third row) of the total population. Baseline parameter values are listed in Table 1. Initial conditions are \(I_{f}(0) = I_{m}(0)= 10\), \(V_{f}(0) = V_{m}(0)= 0\), and \(S_{f}(0) = N_{f}^{*} - I_{f}(0) - V_{f}(0)\), \(S_{m}(0) = N_{m}^{*} - I_{m}(0) - V_{m}(0)\) (color figure online)

The first column in Fig. 4 shows the optimal control solutions, that is, the optimal time-dependent vaccination rates for females \(u_{f}^{*}(t)\) (blue) and males \(u_{m}^{*}(t)\) (red). The second column shows the sex-specific optimal vaccine deployment using cumulative vaccinated individuals. The cumulative number of vaccinated females \(Z_{f}(t)\) (blue), and males \(Z_{m}(t)\) (red) are obtained from the optimal states corresponding to the optimal controls on the first column. The variable Z(t) that represents the total cumulative number of vaccines administered is also shown. Observe that \(Z(t_f) = W\) for each of the cases investigated: \(W = 0.2N^{*}\) (first row), \(W = 0.3N^{*}\) (second row) and \(W = 0.4N^{*}\) (third row). For all cases (see Fig. 4a, c, e), the optimal control solutions suggest that health officers must use all the vaccines available as soon as possible at the early phase of the outbreak.

One important result from Fig. 4a, c, d is that although the vaccination rate for females should be higher than the one for males, this difference is relatively small. Hence, under these conditions, men should be included in vaccination programs together with females. The right column in Fig. 4 shows, as expected from the optimal controls, that the cumulative number of vaccinated females is above the one for males. Nevertheless, the key point to notice is that the difference in the sex-specific cumulative vaccination increases as the vaccine stockpile reduces (note that the difference is bigger in Fig. 4b in comparison with Fig. 4f).

Fig. 5
figure 5

(Left column) Number of infected females as a function of time without control (red line) and with optimal vaccination rates (blue line) for the three cases a \(W=0.2N\), c \(W=0.3N\), e \(W=0.4N\). (Right column) The number of infected males as a function of time without control (red line) and with optimal control (blue line) for the three cases b \(W=0.2N\), d \(W=0.3N\), f \(W=0.4N\). For all plots, the integral of the shaded area represents the number of infections averted by the optimal vaccination strategies (color figure online)

We remark that for all the scenarios explored, the implementation of the vaccination program manages to significantly reduce the prevalence of the infection in comparison with the no-control case. Figure 5 deploys the number of infected individuals without control (solid red line) and under the application of the optimal vaccination rates (solid blue line) corresponding to the three cases \(W=0.2N\), \(W=0.3N\), and \(W=0.4N\). Females and males are presented in the left and right columns in Fig. 5, respectively. The integral of the shaded area corresponds to the number of infections averted by the vaccination programs.

Fig. 6
figure 6

First column: Optimal time-dependent vaccination rates for females \(u_{f}^{*}(t)\) (blue) and males \(u_{f}^{*}(t)\) (red). Second column: Cumulative number of vaccinated females (blue), and males (red) computed from the optimal states corresponding to the optimal controls on the first column. The total cumulative number of vaccines administered, Z(t), is shown in yellow. For both columns, the supply of vaccines corresponds to 20% (first row), 30% (second row), and 40% (third row) of the total population but 10000 vaccines have already been directed to females. Baseline parameter values are listed in Table 1. Initial conditions \(I_{f}(0) = 1537\), \(I_{m}(0)= 1157\), \(V_{f}(0) = 10000\), \(V_{m}(0)= 0\), and \(S_{f}(0) = N_{f}^{*} - I_{f}(0) - V_{f}(0)\), \(S_{m}(0) = N_{m}^{*} - I_{m}(0) - V_{m}(0)\) (color figure online)

4.3.2 The case of an already existing single-sex vaccination program

The results in Fig. 4 were derived for a starting vaccination roll-out program. Another scenario of interest is when a single-sex vaccination strategy is already established. In this context, public health authorities would like to evaluate if it is better to increase coverage in the existing single-sex program or to vaccinate both sexes simultaneously (Bogaards et al. 2011). To simulate this scenario, we assume that \(u_{f}(t)=u_{max}\) and \(u_{m}(t)=0\) over an initial period such that at the end of the period 10000 females have been vaccinated. Hence, a substantial number of females have already been vaccinated, but no males have been vaccinated. Then, the optimal vaccine allocation begins. This scenario mimics HPV vaccination programs in several countries currently directed at females only (Bruni et al. 2021). Other model parameters are fixed as shown in Table 1, except the total vaccine stockpile W that now counts 10000 vaccines less (the ones that are already delivered for females).

The optimal control profiles and cumulative vaccinated individuals for these conditions are shown in Fig. 6. The resulting optimal control profiles for the cases \(W=0.2N\) and \(W=0.3N\) (see Fig. 6a, c), are significantly different in comparison with the corresponding cases (see Fig. 4a, c). The first difference is that now the control profiles no longer suggest that health authorities should deploy as many vaccines as possible at the beginning of the outbreak. Instead, immunization should be delayed by at least 60 days. Second, the optimal vaccination rate for males is now strictly zero i.e. \(u_{m}^{*}(t)=0\). As a consequence, the total number of vaccinated individuals is equal to the number of vaccinated females, \(Z(t)=Z_{f}(t)\) (see Fig. 6b, d). For the case of a starting vaccination roll-out program (see Fig. 4), results showed that females should be vaccinated at a higher rate than males. However, even in the scenario with the lowest vaccine supply, the optimal vaccination rate for males was greater than zero. Finally, observe that for the case \(W=0.4N\) (see Fig. 6e, f), the control profiles present again the same qualitative behavior as the ones in the starting vaccination roll-out program. To summarize, for a scenario of very limited vaccine stockpile, i.e. \(W < 0.3 N\), vaccine administration should continue prioritizing the female-only target population. However, if the stockpile is relatively large, i.e. \(W > 0.4 N\), the inclusion of males in the vaccination program is the optimal strategy to effectively eliminate the epidemic in the population.

5 Discussion

The prevention and control of sexually transmitted infections have extensive public health benefits including the reduction of preventable deaths of newborns, and improved sexual and reproductive health (World Health Organization 2021). Vaccine development and successful implementation of effective immunization programs are critical actions to progress in the control of STIs (Gottlieb et al. 2019). Nevertheless, due to cost and logistical challenges, vaccine stockpile is typically limited and not enough to achieve high-immunization coverage, particularly in low-middle-income settings (Yamey et al. 2022). Data reports significant sex-specific differences in biological risks for STI acquisition, the clinical manifestation of the infection, and their potential for transmission to the opposite sex (Hook 2012; Wong et al. 2004). Hence, determining optimal sex-specific vaccination programs against STIs is a challenging task that deserves more attention. A major example are HPV vaccination programs which were introduced in several countries for young girls. These early female-only HPV immunization programs have been found to be cost-effective when cervical cancer prevention is the main objective (see Brisson et al. (2020) and the references therein). Yet, a number of studies (Elfström et al. 2016; Stanley 2012) have suggested that if rather than preventing cervical cancer alone, the aim is to reduce all HPV-associated diseases, then the inclusion of males can be cost-effective. Currently, more than 30% of the HPV programs are gender-neutral (GN), i.e. with both females and males receiving the vaccine. However, 79% of GN programs are from high-income countries whereas only 21% are from upper-middle-income countries (Bruni et al. 2021).

In this study, we investigate under which conditions the inclusion of both males and females into vaccination programs adds to the population-level impact of female-only interventions. Considering sex-specific differences in transmissibility and severity in disease outcomes, we compare vaccination strategies against STI transmission for different realistic settings described by distinct budget constraints associated with the vaccine supply. The vaccination strategies are obtained as solutions to an optimal control problem aiming to reduce the total prevalence of the infection subject to a minimalist two-sex Kermack–McKendrick-type model. The control variables are the daily vaccination rates for females and males, respectively, that mimic a prophylactic vaccine with effectiveness not necessarily equal to \(100\%\). One important aspect of our approach relies upon modeling a limited but specific vaccine stockpile via an isoperimetric constraint (Kamien and Schwartz 2012). We solve the optimal control problem via Pontryagin’s Maximum Principle and obtain a numerical approximation for the solution using a modified version of the FBSM which handles the isoperimetric budget constraint in our formulation.

We considered two main scenarios regarding the current immunization coverage in the population (i) a starting vaccination roll-out program where no individuals in the population have been vaccinated (see Fig. 4) and (ii) a female-only vaccination strategy which is already established and has reached around 20% coverage in females (see Fig. 6). The second scenario is relevant for public health authorities who would like to evaluate if it is better to increase coverage in the existing female-only program or to vaccinate both sexes simultaneously. Each of these scenarios is further subdivided according to the total vaccine supply available which is incorporated via the isoperimetric constraint (11). The simulations for the first scenario show that although the vaccination rate for females should be higher than the one for males. Hence, under these conditions, vaccinating both sexes, with a slightly higher rate for females, is optimal and provides an effective and faster approach to reducing the prevalence of the infection. These results agree with the HPV immunization program currently used in Spain (Linertová et al. 2022). However, the difference in sex-specific vaccine distribution increases as the vaccine stockpile reduces. For the case in which a female-only program is already ongoing, vaccine administration should continue prioritizing the female-only target population and males should only be included if the vaccine stockpile is large (enough to reach at least \(40\%\) total coverage). In other words, for a very limited vaccine supply (\(30\%\) coverage or less), female-only vaccination can be more beneficial than the inclusion of both sexes into the vaccination program. Since the male-to-female sexual infectivity rate is generally higher than that of female-to-male, prioritizing female vaccination might seem counterintuitive, because vaccinating super-spreaders (in this case males) is usually effective to reduce the prevalence of the infection. Yet, this may be due to the fact that the health risks associated with STIs are considerably higher for females in comparison with men. This is considered in the solution of our optimal control problem using the weight parameters in the objective functional.

As with the majority of studies, we considered some simplifying modeling assumptions that can be improved in further studies. First, we assumed that single-dose vaccination is enough to reach full immunity. Nevertheless, a two-dose series is often needed and there might be a delay of some days (or weeks) to achieve full immunity. Second, we assumed that susceptible individuals are easily identified for a prophylactic vaccine that lacks therapeutic effects and is therefore not effective in already infected individuals. On the contrary case, some vaccines can be misdirected in the infected population. Finally, we have considered a heterosexual population but the inclusion of individuals with another sexual orientation can play a key role in disease dynamics. Future investigations are necessary to validate if the principal properties of the optimal vaccination policies drawn from this study are affected when these assumptions are relaxed.