Skip to main content
Log in

On the optimization of pit stop strategies via dynamic programming

  • Published:
Central European Journal of Operations Research Aims and scope Submit manuscript

A Correction to this article was published on 09 August 2022

This article has been updated

Abstract

Pit stops are a key element of racing strategy in several motor sports. Typically, these stops involve decisions such as in which laps to stop, and which type of tire, of three possible compounds, to set at each of these stops. There are several factors that increase the complexity of the task: the impact of lap times depending on the tire compound, the wear of the tires, unexpected events on the track such as safety cars and the weather, among others. This work presents a Dynamic Programming formulation that addresses the pit-stop strategy problem in order to optimize the laps in which to stop, and the tire changes that minimize the total race time. We show the relative performance of the optimal strategies for starting with tires of different compounds with different yellow-flag scenarios. Then, we extend the Dynamic Program (DP) to a Stochastic Dynamic Programming (SDP) formulation that incorporates random events such as yellow flags or rainy weather. We are able to visualize and compare these optimal pit-stop strategies obtained with these models in different scenarios. We show that the SDP solution, compared to the DP solution, tends to delay pit stops in order to benefit from a possible yellow flag. Finally, we show that the SDP outperforms the DP, especially in races in which yellow flags are likely to be waved more frequently.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Change history

Notes

  1. Note that there are other reasons why the driver would choose to make a pit stop, such as changing the front wing of the car in case it were damaged. For simplicity, we are not going to consider this type of case.

  2. This rule was set in 2016.

  3. Since 2019, there have been a total of five tire compounds for dry weather, 3 of which are available during each race.

  4. In case of rain, when using any of the two wet tire compounds, the rule that states that tires of two different compounds should be used is no longer valid.

  5. A yellow flag indicates the period of time during the race when the cars have to slow down and no passing is allowed because an incident has taken place at some point on the track which obstructs the normal execution of the race. The two main events in Formula 1 that take place during a yellow flag are: (a) Safety Car (SC) or (b) Virtual Safety Car (VSC). In the former case, the safety car is deployed and all cars must follow with no overtaking (and therefore time differences between cars are dramatically shrunk), while in the latter (VSC) cars must decrease their speed (and so time differences between cars are maintained). For the sake of simplicity, throughout the rest of the paper we consider yellow flags to represent a VSC event.

  6. This and other decisions are made together by the driver and engineers of the team. In this paper, we will mention either the car, driver, or engineers, without distinction, to refer to the decision maker on the race strategy.

  7. We consider that it is not possible to do a pit stop in the last lap of the race. For simplicity, we omit the description of this constraint.

  8. In Formula 1, the pit lane is usually located in parallel to the finish line. The proposed model can be easily adapted to the real setting.

  9. Although we will assume that softer tires consume slightly more fuel than harder tires, this might no be the case for all motorsports.

  10. This deterministic model assumes that the weather is dry. If the weather should be rainy, there is no need to have this state variable since in this case cars are not required to use tires of two different compounds. We do not consider weather changes in the deterministic section, as this will be presented in the stochastic model in the next section.

  11. In Formula 1, only cars that start after the 10th position are allowed to choose the compound of the tires with which to start the race since the year 2016, whereas the rest of the cars are required to re-use a specific tire (with a particular compound) used in the qualifying event. The qualifying is an event that happens the day before the race, when drivers try to make the best lap times as these will decide the starting grid positions.

  12. The code used to carry out these and all subsequent numerical experiments is available at https://github.com/FCarrascoHeine/F1DP.

  13. We assume that the fuel consumption during a yellow flag is of 0.5 [Kg/lap] and that there is no tire wear (also during a yellow flag). In addition, we consider that the additional time lost to the pit stop in a lap with yellow flag is equal to \(\mu _1=10\) [s].

  14. Of course we can consider a more refined enumeration of the possible weather states, but, for the sake of simplicity we will show only a reduced set of weather states.

  15. The l laps include lap n.

References

  • Bekker J, Lotz W (2009) Planning formula one race strategies using discrete-event simulation. J Oper Res Soc 60(7):952–961

    Article  Google Scholar 

  • Beltman F (2008) Optimization of ideal racing line. BMI Paper

  • Bertsekas DP (1995) Dynamic programming and optimal control, vol 1. Athena scientific, Belmont, MA

    Google Scholar 

  • Bi F (2014) How formula one teams are using big data to get the inside edge. https://www.forbes.com/sites/frankbi/2014/11/13/how-formula-one-teams-are-using-big-data-to-get-the-inside-edge/, accessed April, 2021

  • Catchpole KR, De Leval MR, McEwan A, Pigott N, Elliott MJ, McQuillan A, Macdonald C, Goldman AJ (2007) Patient handover from surgery to intensive care: using formula 1 pit-stop and aviation models to improve safety and quality. Pediatr Anesth 17(5):470–478

    Article  Google Scholar 

  • Chain B (2017) Basics of f1 race strategy. https://youtu.be/wqf-dJyU_WA, accessed April, 2021

  • Chandra S, Lee A, Gorrell S, Jensen CG (2011) Cfd analysis of pace formula-1 car. Comput-Aided Design Appl, PACE 1:1–14

    Google Scholar 

  • Choo CLW (2015) Real-time decision making in motorsports: analytics for improving professional car race strategy. PhD thesis, Massachusetts Institute of Technology

  • Fallahnezhad MS (2014) A finite horizon dynamic programming model for production and repair decisions. Commun Stat-Theory Methods 43(15):3302–3313

    Article  Google Scholar 

  • Farroni F, Sakhnevych A, Timpone F (2017) Physical modelling of tire wear for the analysis of the influence of thermal and frictional effects on vehicle performance. Proc Inst Mech Eng, Part L: J Mater: Design Appl 231(1–2):151–161

    Google Scholar 

  • Forbes (2018) Revealed: the \$2.6 billion budget that fuels f1’s 10 teams. https://www.forbes.com/sites/csylt/2018/04/08/revealed-the-2-6-billion-budget-that-fuels-f1s-ten-teams/#391a66e65952, (accessed February, 2021)

  • Foxall GR, Johnston BR (1991) Innovation in grand prix motor racing: the evolution of technology, organization and strategy. Technovation 11(7):387–402

    Article  Google Scholar 

  • Heilmeier A, Graf M, Lienkamp M (2018) A race simulation for strategy decisions in circuit motorsports. In: 2018 21st international conference on intelligent transportation systems (ITSC), IEEE, pp 2986–2993

  • Heilmeier A, Thomaser A, Graf M, Betz J (2020) Virtual strategy engineer: using artificial neural networks for making race strategy decisions in circuit motorsport. Appl Sci 10(21):7805

    Article  Google Scholar 

  • Jain A, Morari M (2020) Computing the racing line using bayesian optimization. In: 2020 59th IEEE conference on decision and control (CDC), IEEE, pp 6192–6197

  • Jenkins M, Floyd S (2001) Trajectories in the evolution of technology: a multi-level study of competition in formula 1 racing. Organ Stud 22(6):945–969

    Article  Google Scholar 

  • McLaren racing limited (2019) Formula one race strategy. https://www.raeng.org.uk/publications/other/14-car-racing, accessed April, 2021

  • Phillips A (2014) Building a race simulator. https://f1metrics.wordpress.com/2014/10/03/building-a-race-simulator/, accessed April, 2021

  • Tagliaferri F, Philpott A, Viola I, Flay R (2014) On risk attitude and optimal yacht racing tactics. Ocean Eng 90:149–154

    Article  Google Scholar 

  • Terms (2019) A beginner’s guide to... f1 slang. https://www.formula1.com/en/latest/article.a-beginners-guide-to-f1-slang.1Pg6tvGZ2y7u4KAnc8WXGl.html, (accessed February, 2021)

  • Vergales BD, Dwyer EJ, Wilson SM, Nicholson EA, Nauman RC, Jin L, Sinkin RA, Kaufman DA (2015) Nascar pit-stop model improves delivery room and admission efficiency and outcomes for infants \(<\) 27 weeks’ gestation. Resuscitation 92:7–13

    Article  Google Scholar 

  • Vesel R (2015) Racing line optimization @ race optimal. ACM SIGEVOlution 7(2–3):12–20

    Article  Google Scholar 

  • Wright P, Matthews T (2001) Formula 1 technology. SAE

  • Xiong Y, et al. (2010) Racing line optimization. PhD thesis, Massachusetts institute of technology

  • Yang ZM, Djurdjanovic D, Ni J (2008) Maintenance scheduling in manufacturing systems based on predicted machine degradation. J Intell Manuf 19(1):87–98

    Article  Google Scholar 

Download references

Acknowledgements

The authors gratefully acknowledge financial support from CONICYT PIA/BASAL AFB180003. This research was partially supported by the supercomputing infrastructure of the NLHPC (ECM-02). The authors additionally acknowledge the support from the Research Centre for Operations Management, KU Leuven.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Oscar F. Carrasco Heine.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix

A Deterministic dynamic programming model

  • Parameters and functions:

    N: number of laps.

    \(\mathcal {T}\): set of tire compounds.

    \(c_{t}\): fuel usage per lap when using tires of compound \(t\in \mathcal {T}\).

    \(\mu (t,w,f,x)\): function that returns the lap time as a function of the tire compound \(t\in \mathcal {T}\) in use, the tire wear \(w\in [0,1]\), the fuel level f, and whether a pit stop has been made (\(x\in \mathcal {T}\)) or not (\(x=0\)).

  • Stages:

    Lap \(n \in \{ 1,\ldots ,N \}\)

  • Decision (control) variables:

    \(x_n \in \{0\}\cup \mathcal {T}\): Tire compound chosen to be changed at the end of lap n. If there is no pit stop (and, thus, no change of tires), \(x_n = 0\).

    B: Initial fuel level.

  • State variables:

    \(s_n=(t_n,w_n,f_n,m_n)\): state at lap n.

    \(t_n\): Tire compound used during lap n.

    \(w_n\): Tire wear at the beginning of lap n.

    \(f_n\): Fuel level at the beginning of lap n.

    \(m_n\): Equals 0 if the car has used only one type of tire compound until the beginning of lap n. Otherwise \(m_n=1\) if the car has already used more than one type of tire.

  • State transition:

    \(t_{n+1} = t_n \cdot \mathbbm {1}_{\{x_n = 0\}} + x_n \cdot \mathbbm {1}_{\{x_n \ne 0\}}\)

    \(w_{n+1} = (w_n+\gamma (t_{n},f_{n})) \cdot \mathbbm {1}_{\{x_n = 0\}}\)

    \(f_{n+1} = \max \{f_{n}-c_{t_{n}},0\}\)

    \(m_{n+1}= \min \{m_n+\mathbbm {1}_{\{x_n\ne 0,x_n\ne t_{n}\}},1\}\)

  • Bellman equation:

    $$\begin{aligned} V_n(s_n, x_n)= & {} \mu \left( t_{n},w_n,f_n,x_n\right) + V_{n+1}^*(s_{n+1}(s_n,x_n)) \end{aligned}$$

    where

    $$\begin{aligned} V_{n}^*(s_{n}) = \min _{x_n\in \{0\}\cup \mathcal {T}} V_n(s_n, x_n) \end{aligned}$$
  • Border conditions:

    $$\begin{aligned} V_{N+1}^*(s_{N+1}) = \left\{ \begin{array}{ll} +\infty \qquad \qquad &{} m_{N+1}=0\\ 0 \qquad \qquad &{} \text {otherwise}\\ \end{array} \right. \end{aligned}$$

B Lap time vs tire wear

The precise way we build the \(\beta \) function is by considering a finite set of points, i.e. tire wear-extra time tuples, and interpolate a cubic spline forced with null second derivatives at the extreme points of the [0, 1]. Fig. 6 depicts an example of the \(\beta \) function in which the filled marker points are the input tuples, and the line corresponds to the interpolated values. According to Fig. 6, if the wear of the set of tires is at \(70\%\), then the car will take 1.2 seconds more to do a lap with respect to having a new set of tires (of the same type). Note that the function \(\beta \) grows slowly in the first part of the unit interval, but the slope becomes steeper as the tires become more worn (see the right side of Fig. 6). In the latter case, lap times have a significant increase, also known as falling from the cliff. Note that the \(\beta \) function is quite flexible, since it allows the user to pick any arbitrary set of (tire wear, extra time)-tuples from which the function can be generated.

Fig. 6
figure 6

Additional lap time for each level of tire wear. The filled red dots are input time-wear tuples, while the continuous blue line shows the interpolated points using a cubic spline

C Lap segments

A lap is depicted in Fig. 7, where points ��A” and “B” represent the exit from and entrance to the pits, respectively.

Fig. 7
figure 7

Illustration of a lap, with the actual track being represented by the continuous line, while the pit lane is represented by the dashed line

Fig. 8
figure 8

Race with yellow flags in laps 31 and 32. For each initial tire compound’s best strategy: Top left Lap times. Top right Partial race time difference with respect to the best partial time. Bottom left Fuel level for each initial strategy. Bottom right Tire wear for each lap. Filled circles represent tire changes where the letter “S”, “M”, and “H” represent the soft, medium, and hard tire compound respectively

D Case (ii)

Figure 8 illustrates the case in which yellow flags occur in laps 31 and 32. In this case, we can see that both the strategies benefiting from this are the ones starting with soft and hard tires. However, in the former strategy, there had been a stop during lap 19 already, whereas in the latter strategy just a single stop takes place. As a result, the strategy starting with hard tires ends up being the winning strategy, (see top-right panel of Fig. 8). Note that the strategy starting with the medium tires does not stop during the yellow flag since it had made a pit stop just one lap earlier, changing to a soft tire compound. Thus, making a stop during the yellow flag is not convenient.

E Stochastic dynamic programming model

  • Parameters and functions:

    N: number of laps.

    \(\mathcal {T}\): set of tire compounds.

    \(\mathcal {T}_{w}\): set of wet tire compounds.

    \(c_{t, a}\): fuel usage per lap when using tires of compound \(t\in \mathcal {T}\), given that there is no yellow flag (\(a=0\)), or if there is a yellow flag, \(a=1\).

    \(\mu ''(t,w,f,x,a,r)\): function that returns the lap time as a function of the tire compound \(t\in \mathcal {T}\) in use, the tire wear \(w\in [0,1]\), the fuel level f, the existence of a pit stop during the lap (\(x\in \mathcal {T}\)), or not (\(x=0\)), the presence of a yellow flag (\(a=1\) if there is one, and \(a=0\) otherwise), and under the weather condition \(r\in \mathcal {R}\).

  • Stages:

    Lap \(n \in \{ 1,\ldots ,N \}\)

  • Decision (control) variables:

    \(x_n \in \{0\}\cup \mathcal {T}\): Tire compound chosen to change to at the end of lap n. If there is no pit stop (and, thus, no change of tires), \(x_n = 0\).

    B: Initial fuel level.

  • State variables:

    \(s_n=(t_n,w_n,f_n,m_n,r_n,y_n)\): state at lap n.

    \(t_n\): Tire compound used during lap n.

    \(w_n\): Tire wear at the beginning of lap n.

    \(f_n\): Fuel level at the beginning of lap n.

    \(m_n\): Equals 0 if the car has used only one type of tire compound until the beginning of lap n (and no rainy weather has occurred). Otherwise \(m_n=1\) if the car has used more than one type of tire compound (or rainy weather has occurred).

    \(r_n\): Weather during lap n, where \(r_n\in \mathcal {R}\).

    \(y_n\): Number of laps left under yellow flag. \(y_n\in \{0,1,\dots ,L\}\), where L is the maximum number of laps a yellow flag can last (due to the same event).

  • Random variables:

    \(R_n\): Weather during lap n, \(R_n\in \mathcal {R}\). The weather transition is given by \(P_{ij}(n)\) so that

    $$\begin{aligned} P_{ij}(n)=\mathbb {P}(R_{n}=j|R_{n-1}=i) \end{aligned}$$

    where \(i,j\in \mathcal {R}\).

    \(Y_n\): Number of laps with yellow flag remaining, from lap n, so that the probability of a yellow flag of length l laps is defined as

    $$\begin{aligned} q_{l}(n)=\mathbb {P}(Y_{n}=l|Y_{n-1}\le 1), \end{aligned}$$

    where \(l\in \{0,1,\dots ,L\}\), and n is the lap, and

    $$\begin{aligned} Y_{n}=Y_{n-1}-1 \end{aligned}$$

    for the cases where \(Y_{n-1}>1\).

  • State transition:

    \(t_{n+1} = t_n \cdot \mathbbm {1}_{\{x_n = 0\}} + x_n \cdot \mathbbm {1}_{\{x_n \ne 0\}}\)

    \(w_{n+1} = (w_n+\gamma '(t_n,f_n,a)) \cdot \mathbbm {1}_{\{x_n = 0\}}\), where \(a=\mathbbm {1}_{\{y_{n}\ge 1\}}\)

    \(f_{n+1} = \max \{f_{n}-c_{t_{n}, a},0\}\), where \(a=\mathbbm {1}_{\{y_{n}\ge 1\}}\)

    \(m_{n+1} = \min \{m_n+\mathbbm {1}_{\{x_n\ne 0,x_n\ne t_{n}\}}+\mathbbm {1}_{\{x_{n}\in \mathcal {T}_w\}},1\}\), where \(\mathcal {T}_w\subset \mathcal {T}\) is the set of wet tire compounds, suspending the condition of needing to use at least two tire compounds.

    \(r_{n+1} = R_{n+1}\)

    \(y_{n+1} = Y_{n+1}\)

  • Bellman equation:

    $$\begin{aligned} V_n(s_n, x_n)= & {} \mu ''\left( t_{n},w_n,f_n,x_n,\mathbbm {1}_{\{y_n\ge 1\}},r_n\right) \\&+ \mathbb {E}\left[ V_{n+1}^*(s_{n+1}(s_n,x_n,R_{n+1},Y_{n+1}))\right] , \end{aligned}$$

    where

    $$\begin{aligned} V_{n}^*(s_{n}) = \min _{x_n\in \{0\}\cup \mathcal {T}} V_n(s_n, x_n) \end{aligned}$$
  • Border conditions:

    $$\begin{aligned} V_{N+1}^*(s_{N+1}) = \left\{ \begin{array}{ll} +\infty \qquad \qquad &{} \text {if } m_{N+1}=0\\ 0 \qquad \qquad &{} \text {otherwise}\\ \end{array} \right. \end{aligned}$$

F Probability of yellow flag

Let \(\pi \) denote the probability that at least one yellow flag occurs during the race, and let \(\phi \) denote the probability that a yellow flag occurs on a lap. We assume that this probability is independent of the specific lap. Then, it must hold that \(1-\pi =(1-\phi )^{N}\), where N is the total number of laps. Thus, we have that \(\phi =1-\left( 1-\pi \right) ^{1/N}\).

G Running times

The algorithms were run in Julia 1.7.2, using 6-CPU of an Apple M1 Pro with 16 GB RAM. Table 2 shows running-time statistics for the DP and SDP and average number of states for each stage (lap). The number of runs for the DP are 53 since there is one run for the case with no yellow flags, and one run for each lap in which a yellow flag starts (and lasts for two laps). The runs of the SDP are the ones considering different probability of yellow flag during the race. In order to have a finite number of states, we discretize the fuel and tire wear. In particular, the instances run use a grid refinement with a width of \(1/1995(\approx 0.0010)\) and \(1.01\cdot 1.92\cdot 966/52(\approx 0.0505)\) for tire wear and fuel, respectively.

Table 2 Running times

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Heine, O.F.C., Thraves, C. On the optimization of pit stop strategies via dynamic programming. Cent Eur J Oper Res 31, 239–268 (2023). https://doi.org/10.1007/s10100-022-00806-4

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10100-022-00806-4

Keywords

Navigation