One of the main points when implementing the Information Technology Infrastructure Library (ITIL) is which order the processes must be implemented. In the systematic literature review (SLR) developed, it is possible to find references about strategies and factors that ease the implementation of the ITIL, static sequences for the processes to be implemented, and recommendations about the first process to implement, but it is rather complicated to find references that explicitly define the order (adapted to a specific company) of the processes to be implemented. Thus, once it is shown that there is no methodology/algorithm providing a sequence of ITIL processes specifically adapted for each company, an algorithm to solve this problem is presented: The algorithm has a deep mathematical basis and returns a sequence of ITIL processes to optimize the efforts during implementation, so the company implementing the ITIL gets the closest to the competitors. The optimization is made considering parameters such as staff, age of the company, IT size, industry, etc. Thus, the sequence proposed is specific for each company. Finally, a comparative of the sequence obtained (from the proposed algorithm) with sequences discovered in the SLR is presented and applied to a real case.