Epitope-based vaccines have revolutionized vaccine research in the last decades. Due to their complex nature, bioinformatics plays a pivotal role in their development. However, existing algorithms address only specific parts of the design process or are unable to provide formal guarantees on the quality of the solution. We present a unifying formalism of the general epitope vaccine design problem that tackles all phases of the design process simultaneously and combines all prevalent design principles. We then demonstrate how to formulate the developed formalism as an integer linear program, which guarantees optimality of the designs. This makes it possible to explore new regions of the vaccine design space, analyze the trade-offs between the design phases, and balance the many requirements of vaccines.Author summaryDiseases such as Cancer, AIDS, Hepatitis C, and Malaria, infect and kill millions of people every year. In spite of all our efforts, a cure for those disease remains elusive. Among all possible approaches, personalized vaccines have shown promising results in several clinical trials. These vaccines must be designed computationally in order to cover the enormous variations existing in the diseases and in the patients themselves. Current methods are lacking in one of several aspects, as they only focus on a specific part of the design problem, on a specific type of vaccine, or are unable to guarantee optimality of the solution. In this work, we present a new method to design vaccines that does not suffer from any of these limitations: through a holistic view on the design problem, it can find the best solution for the given design constraints. The flexibility of our method allows us to tune the balance of the different design criteria, perform accurate and reliable comparisons among different solutions, and properly evaluate the trade-offs involved.