1 Introduction

The collective behavior of interacting autonomous vehicles is an interesting question in view of its impact on traffic conditions, such as security or reduced congestion. Our goal is to investigate the capability of autonomous cars, following each other, to reach a state of global maximum flow, by only interacting deterministically with the preceding car.

Our approach follows the work initiated in Nagel and Schreckenberg (1992) of modeling traffic using cellular automaton. Further references and comparisons with various models by the same authors may be found in Nagel et al. (2003), Nagel (2002). The road is seen as a collection of cells and cars are moving from one cell to another following some rules that we refer to as the speed regulator. Among the questions of interest is the determination of the maximum flow as a function of the number N of cars. This is described as the fundamental diagram, a relation between the car density \(\rho\) [cars per unit of length] and the traffic flow \(j=\rho {\bar{v}}\) [cars per time unit], where L is the length of the road section and \({{\bar{v}}}\) the average speed. This fundamental diagram usually shows two distinct dynamics, a first one where increasing the density increases the flow and a second one where, due to high density, the cars interact and traffic jams occur.

Classical analysis of traffic models amount to classifying the different dynamics and identifying the conditions for transition, for instance the existence of on/off-ramp (Karakhi et al. 2021; Jiang and Qing-Song 2006; Gupta and Katiyar 2006), traffic lights (Chacoma et al. 2021), lane changing (Naito and Nagatani 2012), mixed-traffic (Meng et al. 2007), and combinations (Hanumappa and Ramachandran 2021).

Real Traffic have been subject to empirical studies where sensors located on the road provide measurements of various parameters like speeds and head-tail distances between cars. These works lead to an understanding of the various dynamics depending on the traffic conditions. In particular to the three-phase traffic theory (Kerner 2004, 1999, 2021). Roughly, this theory distinguishes the free-flow phase where cars update their speeds independently, the synchronized flow where speeds and head-tail distances decrease and tend to synchronize and, lastly the jammed flow where we observe cars with null speed. Some empirical studies consider mixed traffic as well, for instance cars and pedestrians sharing some part of the road (Bandini et al. 2017).

The large amount of data collected from real traffic conditions and the accurate analysis, foster speed regulator designers to devise models that reproduce the observed dynamics (Kerner et al. 2002; Lee et al. 2004; Tian et al. 2009; Qian et al. 2017; Tian et al. 2021). These models introduce new parameters, such as probabilities, that are wisely tuned to reproduced the observed dynamics.

This paper follows a different approach. We consider a simple collision-free, deterministic speed regulator, that mimics the behaviour of an autonomous car. This speed regulator control the behaviour of each car. Collectively, it leads to various possible flow patterns that we want to compute rigorously and check whether the resulting traffic flow is maximum. We do not intend to reproduce real traffic patterns like those mentioned in the literature. Rather, our long-term goal is the search for an efficient speed regulator to equip autonomous car whose performance are better that human drivers.

We start here to consider the simplest speed regulator, which could be used by autonomous cars, ensuring that: (i) no collision occurs and, (ii) speed is maximized. We analyze the dynamic of a pool of cars obeying the speed regulator. We compute what are the observable traffic patterns in the long-term.

We find a bound for the maximum flow as a function of the density that leads to the ’envelope’ of the fundamental diagram. We identify the traffic patterns of maximum flow - reaching the bound as well as non optimal traffic patterns.

We show as well that in some non optimal traffic patterns the cars involved cannot increase their speed due to the no-collision constraint. In this situation, an external mechanism, that we do not consider in this paper, is required to allow the cars to switch to a more efficient traffic pattern.

In Sect. 2 we define the speed regulator. It maximizes the speed \(v_a\) of a car a according to the head-tail distance d with a leading car b and its speed \(v_b\), ensuring that no-collision occurs. We call viable a configuration where no-collision occurs and shows that the viability property is preserved by the speed regulator.

In Sect.  3, we analyze the traffic patterns occurring in the long term. In particular, we show that for viable configurations the property \(d<v_a\) is transient, see Proposition 2. Hence, the long-term traffic patterns show \(d\ge v_a\), see Proposition 3. Next, we show that the long term traffic patterns are composed of configurations that we identify, see Definitions 4 and 5 and Proposition 4.

In Sect. 4 we analyse various property of the traffic flow. Proposition 3 leads to bound the maximum flow, see Proposition 7.

The fundamental diagram and related maximum flow traffic patterns are presented in Sect. 5. We show on a toy example how each point of the fundamental diagram corresponds to identified configurations, see Fig. 3. Traffic patterns that we identify share similarities to the metastable traffic pattern in (Nishinari et al. 2004).

In Sect. 6, we compare our regulator to the classical Nagel–Schreckenberg and KKW models. It occurs that even if the formulation of our speed regulator is simple, the resulting dynamics is quite complex and share interesting properties with these classical models. For instance, the condition \(d\ge v_a\) plays a similar role as the synchronization distance in the KKW-model (Kerner et al. 2002; Tian et al. 2021).

Unsurprisingly, our speed regulator is similar to several CA traffic models proposed in the literature. For instance in Lee et al. (2004) it is complemented with parameters that are tuned to reproduce some traffic patterns and human behavior. Our use of the regulator is different. Again, we do not aim at reproducing observed traffic patterns but to generate traffic patterns that we understand in order to solve optimally complex problems (car following, changing lanes, behavior in roundabout) within a set of autonomous cars. We avoid random parameters that often lead to statistical physics analysis of traffic, see for instance (Kerner 2019; Lee et al. 2004). Notice to conclude that autonomous vehicles are insensitive to parameters external to the road conditions (the Landscape and Soundscape of Nagahama et al. 2022).

2 The speed regulator

A (one-lane) road section consists in L cells that can be occupied by only one car at a time. A car spans m cells. Time is discrete \(t\in {\mathbb {N}}\). We use letters \(a,b,\ldots\) to denote cars, \(v_a, v_b, \ldots\) to denote the speeds of the cars and \(x_a, x_b,\ldots\) to denote the positions of the cars along the section of the road. More precisely, \(x_a\) is the cell index of the front bumper of car a. If the speed of a, is \(v_a\) at time t the position update of the car a is \(x_a+v_a\) at time \(t+1\), we do not write the factor \(\Delta t=1\), i.e. \(x_a+v_a\Delta t\). In practice the value of \(\Delta t\) [time] must be smaller than the reaction time of the speed regulator and ensures that it makes possible to capture all communications between cars if any. The time unit is then chosen to be this \(\Delta t\) and hence, \(\Delta t=1\). Then the cell length \(\Delta x\) is fixed by considering a realistic acceleration \(a=\Delta x/\Delta t^2\). This leads to a speed \(\Delta x/\Delta t\) to cross one cell per time unit. We chose the distance unit as \(\Delta x\), a cell length, hence \(\Delta x=1\) and \(\Delta x/\Delta t=1\). The speed is bounded by \(v_{max}\). This means that in one time unit a car can cross a maximum of \(v_{max}\) cells. For our numerical experiments we use \(v_{max}=5\). Distances, positions and speeds are all natural numbers.

With these conventions for \(\Delta x\) and \(\Delta t\) a car spans m cells. Our speed regulator and our study of the dynamics consider the distance between cars from (front) bumper to (rear) bumper.i.e. the head-tail distance. The length of the cars does not enter the equations. However, the length of the cars has to be taken into account when we deal with the density in Sect. 4 and following.

The common agreement that the distance of a cell is 7.5 meters and \(\Delta t=1 [s]\) is subject to criticism (Wagner and Rummel 2018). In particular the corresponding acceleration is \(7.5m/s^2\) which is not realistic. This is why we introduced the parameter m.

Because the speed is bounded we use the following definition for the bounded operators (adding a dot on top of the plus and minus signs).

Definition 1

The bounded addition and subtraction are defined by:

$$\begin{aligned}&v\dot{+}1=\min (v+1,v_{max}),\\&v\dot{-}1=\max (0,v-1). \end{aligned}$$

To denote that the speed regulator updates the speed of a we use the notation \({{\tilde{v}}}_a\) and similarly for the updated head-tail distance \({{\tilde{d}}}\) (from the front bumper of the trailing car to the rear bumper of the leading car). This shorten the notation \(v_a=v_a(t)\) and \(v_a(t+1)={{\tilde{v}}}_a\).

We first focus on the dynamics of two cars a following b and the state of the dynamical system \((v_a,v_b,d)\), where d is the head-tail distance of cars a and b (i.e. the number of empty cells).

In one step (\(t\mapsto t+1\)) two operations are done: (1.) move the cars according to their speed, i.e. \({{\tilde{x}}}_a=x_a+v_a\), \(\tilde{x}_b=x_b+v_b\) hence \({{\tilde{d}}}=d-v_a+v_b\) and, (2.) cars revise their speed following the speed regulator. We consider the succession of configurations of the form

$$(v_{a} ,v_{b} ,d)\underbrace { \Rightarrow }_{{1.{\text{position}}\;{\text{updates}}}}(v_{a} ,v_{b} ,\tilde{d} = d - v_{a} + v_{b} )\underbrace { \Rightarrow }_{{2.{\text{speed}}\;{\text{updates}}}}(\tilde{v}_{a} ,\tilde{v}_{b} ,\tilde{d})$$

For the simulation where many cars are present the updates are done synchronously.

Definition 2

We define the function \(df:{\mathbb {N}}\rightarrow {\mathbb {N}}\) as \(df(v)=v+(v-1)+\ldots +1=\frac{v(v+1)}{2}\), \(~v\ge 0\).

The function df gives the braking distance for a car moving at speed v and decelerating constantly. The speed regulator shown in Algorithm 1 sets the speed \({{\tilde{v}}}_a\) in such a way that no-collision occurs even if the leading car b brakes constantly to 0.

figure a

For a configuration \((v_a,v_b,d)\) we define the viability condition ensuring that the traffic dynamic avoids collisions.

Definition 3

We say that a configuration \((v_a,v_b,d)\) is viable if

$$\begin{aligned} d\ge df(v_a)-df(v_b), \end{aligned}$$
(1)

or equivalently \({{\tilde{d}}}\ge df(v_a\dot{-}1)-df(v_b\dot{-} 1)\).

Next result shows that the regulator preserves the viability condition hence, the no-collision condition. In the next sections it is implicit that the viability property holds for the initial states and hence at any time. This ensures that the speed regulator chooses at any time the maximum reachable speed that avoids collision.

Proposition 1

The speed regulator shown in Figure 1 preserves the viability property.

Proof

We show that the equivalent property (1) is preserved by the regulator. Let us assume \(d\ge df(va)-df(vb)\) and by definition \({{\tilde{d}}}=d-va-vb\). In each case we use that \({{\tilde{v}}}b\ge vb\dot{-}1\) and df is increasing to conclude.

Case 1: \({{\tilde{v}}}a = va+1\). This happens if \(\tilde{d}\ge df(va+1)-df(vb\dot{-}1)=df({{\tilde{v}}}a)-df(vb \dot{-}1)\ge df({{\tilde{v}}}a)-df({{\tilde{v}}}b)\).

Case 2: \({{\tilde{v}}}a=va\). This happens if \({{\tilde{d}}}\ge df(va)-df(vb\dot{-}1)=df({{\tilde{v}}}a)-df(vb \dot{-}1)\ge df(\tilde{v}a)-df({{\tilde{v}}}b)\).

Case 3: \({{\tilde{v}}}a=va-1\). This happens if \({\tilde{d}}\ge df(va\dot{-} 1)- df(vb\dot{-} 1)\ge df({{\tilde{v}}}a)-df({{\tilde{v}}}b).\)

3 Long-term dynamic of the speed regulator

For the analysis of the long-term dynamic of the regulator we focus on the map \((v_a,v_b,d)\rightarrow ({{\tilde{v}}}_a,{{\tilde{v}}}_b,{{\tilde{d}}})\). This does not account for the dynamic of the entire system, composed of many cars but, anyway, this allows us to understand which traffic patterns occur in the long-term.

Propositions 2 and 3 show that in the long-term observable configurations \((v_a,v_b,d)\) always satisfy \(d\ge v_a\).

Proposition 4 shows that the sets \(C_k\), see Definition 4 are stable in the sense that there exist traffic patterns made of infinite sequences of configurations in \(C_k\). The term stable has to be taken cautiously because its use is not the conventional one in dynamical system theory. To specify the meaning, we build a directed graph whose vertices are configurations \((v_a,v_b,d)\). For each configuration we draw a directed edge to the next configurations \(({{\tilde{v}}}_a, {{\tilde{v}}}_b, {{\tilde{d}}})\), where \({{\tilde{v}}}_a\) is given by the speed regulator, \({{\tilde{d}}}=d-v_a+v_b\) is the distance after the cars ab have updated their positions, and \({{\tilde{v}}}_b\in \{v_b\dot{-}1,v_b,v_b\dot{+}1\}\) is the new speed of the leading car b. There are two or three edges leaving \((v_a,v_b,d)\). The sets \(C_k\) of Definition 4 are the strongly connected components of the directed graph. These components are relevant because we can build infinite sequence of configurations belonging to a given \(C_k\), and thus build long-term traffic patterns. Notice, that our use of this observation departs from the usual application to dynamical system theory (Hsu 1995) where they are also called self-cycling sets. What differs in our use is that we have no control on \(\tilde{v}_b\) since we only consider a configuration \((v_a,v_b,d)\) and \({{\tilde{v}}}_b\) depends on the speed and head-tail distance of the car in front of b which is not included in \((v_a,v_b,d)\). The description of the directed graph is relevant because it says precisely what we mean with stable and why the \(C_k\) are important. Efficient algorithms exist to compute the strongly connected component (Tarjan 1972; Tarjan and Zwick 2022).

In propositions 5 and 6 we show that the configurations are driven by the speed regulator to \(\bigcup _{k=0}^{v_{max}} C_k~\bigcup ~C_{max}^+\), see Definitions 4 and 5. This identifies the long-term traffic patterns. From \(C_{max}^+\) are built long-term traffic patterns corresponding to free flow. While from \(\bigcup _{k=0}^{v_{max}} C_k\) are built the long-term traffic patterns corresponding to congested state, where synchronisation between cars is observed.

The configurations with \(d<v_a\) are transient and the speed regulator eventually leads to \(d\ge v_a\) which is then preserved. Hence, in the long term we always assume that condition \(d\ge v_a\) holds. This is formalized in Proposition 2.

Proposition 2

If \((v_a,v_b,d)\) is viable and \(d<v_a\) then \(v_b\ge v_a\). Moreover, such configuration is transient in the sense that eventually \(d\ge v_a\) holds.

Proof

\(v_a+df(v_b)>d+df(v_b)\ge df(v_a)\) results from viability (1) and \(d<v_a\). Hence, \(df(v_b)>df(v_a)-v_a=df(v_a\dot{-}1)\), which implies \(v_b\ge v_a\). The first statement implies that \({{\tilde{d}}}=d-v_a+v_b\ge d\).

For proving the second statement, we distinguish two types of transitions: Type I transition when \(v_b=v_a\) hence \({{\tilde{d}}}=d\), and Type II transition when \(v_b>v_a\) hence \({{\tilde{d}}}>d\). Observe that \(v_a>d\ge 0\), hence \(v_a\dot{-}1=v_a-1\), as well as \(v_b\dot{-}1 =v_b-1\) for Type I transitions.

For Type I transitions we show that \({{\tilde{v}}}_a=v_a-1\), i.e. conditions \({{\tilde{d}}}+df(vb\dot{-}1)\ge df(v_a+1)\) (\(\tilde{v}_a=v_a+1\)) and \({{\tilde{d}}}+df(vb\dot{-}1)\ge df(v_a)\) (\(\tilde{v}_a=v_a\)) are never fulfilled. Indeed,

$$\begin{aligned} v_a>d={{\tilde{d}}}\ge df(v_a+1)-df(vb - 1)\ge v_a+1 \end{aligned}$$

is a contradiction. As well as

$$\begin{aligned} v_a>d={{\tilde{d}}}\ge df(v_a)-df(vb - 1)\ge v_a. \end{aligned}$$

However,

$$\begin{aligned} v_a>d={{\tilde{d}}}\ge df(v_a\dot{-}1)-df(vb\dot{-} 1)=0, \end{aligned}$$

holds. Hence, \({{\tilde{v}}}_a=v_a-1\).

This shows that Type I transitions ensure \({{\tilde{v}}}_a<v_a\) while Type II transitions ensure \({{\tilde{d}}}>d\).

If the configurations follow Type I transitions a sufficiently large number of time then, \(v_a=0\) eventually and \(v_a=0\le d\). To keep condition \(v_a<d\) the system has to switch to transitions of Type II to increase \(v_a\). However, Type II transitions ensure that \(\tilde{d}>d\) and because speed \(v_a\) is bounded only a finite number of Type II transitions are allowed before \(d\ge v_a\).

To exemplify Proposition 2 consider a configuration (3, 3, 2) where \(d<v_a\), the two cars move at speed 3 and distance 2. This condition is viable (no-collision occurs in the future). Indeed, after updating the position, the trailing car reduces its speed to 2 and then, \(d\ge 2 \ge v_a\). In the long term the configuration (3, 3, 2) cannot be observed since it is transient and the property \(d\ge v_a\) is preserved by the speed regulator as shown in Proposition 3. Such a configuration could only be observed because of the initial conditions.

Proposition 3

\(d\ge v_a \Longrightarrow {{\tilde{d}}} \ge {{\tilde{v}}}_a.\)

Proof

If \(d\ge v_a\) then \({{\tilde{d}}}=d-v_a+v_b\ge v_b\) and the result is true if \(v_b\ge {{\tilde{v}}}_a\). Let us assume that \(v_b < {{\tilde{v}}}_a\).

Case 1. We assume that \({{\tilde{v}}}_a=v_a+1\) which occurs if \({{\tilde{d}}}\ge df(v_a+1)-df(v_b\dot{-}1)\) from which we deduce \({{\tilde{d}}}\ge {{\tilde{v}}}_a\).

Case 2. We assume that \({{\tilde{v}}}_a=v_a\) which occurs if \({{\tilde{d}}}\ge df(v_a)-df(v_b\dot{-}1)\) from which we deduce \({{\tilde{d}}}\ge {{\tilde{v}}}_a\).

Case 3. We assume that \({{\tilde{v}}}_a=v_a-1\) which occurs if \({{\tilde{d}}}\ge df(v_a-1)-df(v_b\dot{-}1)\) from which we deduce \({{\tilde{d}}}\ge {{\tilde{v}}}_a\).

We can further refine the description of observable configurations in the long-term. Some sets of configurations, denoted \(C_k\), preserve the invariant \(d=v_a+k\) with \(k\in [0,v_{max}]\) as shown in the next proposition. Observe that in such sets the trailing car copies the speed of the leading car. This behavior is referred to lag synchronization in the literature (Brown and Kocarev 2000). Appropriately, the configurations with \(k=0\) are flow optimal, see Proposition 7.

Proposition 4

\(\mid v_a-v_b\mid \le 1\) and \(d=v_a+k\) with \(k\ge 1\) and \(v_a,v_b\ge k\) then \(\mid {{\tilde{v}}}_a-{{\tilde{v}}}_b\mid \le 1\) and \({{\tilde{d}}}={{\tilde{v}}}_a+k\), in particular \({{\tilde{v}}}_a=v_b\).

Proof

\({{\tilde{d}}}=d-v_a+v_b\), hence \(d=v_a+k\Longrightarrow {{\tilde{d}}} =v_b+k\), it remains to see that \({{\tilde{v}}}_a=v_b\).

$$\begin{aligned} \mid v_a-v_b\mid \le 1\Longrightarrow v_a=v_b-1\text { or }v_a=v_b\text { or }v_a=v_b+1. \end{aligned}$$

Case 1: \({v_a=v_b+1}\), \(1\le k\le v_a,v_b\), \({{\tilde{d}}}+df(v_b -1) = df(v_b)+k=df(v_a-1)+k\), the regulator follows line 6 and \({{\tilde{v}}}_a=v_a-1=vb\). Condition \(\tilde{d}+df(v_b\dot{-}1)\ge df(v_a+1)\) is not fulfilled since \(k\le v_a\). Condition \({{\tilde{d}}}+df(v_b\dot{-}1)\ge df(v_a)\) is not fulfilled since \({{\tilde{d}}}+df(v_b -1) = df(v_b)+k\le df(v_b)+v_b=df(v_b+1)-1=df(v_a)-1\)

Case 2: \({v_a=v_b}\), \({{\tilde{d}}}+df(v_b\dot{-}1) = df(v_b)+k=df(v_a)+k\). The speed regulator follows line 3 and not line 1 since \(k\le v_a\), then \({{\tilde{v}}}_a=v_a=v_b\) (condition \({{\tilde{d}}}+df(v_b\dot{-}1)\ge df(v_a+1)\) is not fulfilled).

Case 3: \({v_a=v_b-1}\), (in particular \(v_b\not = 0\)) \({{\tilde{d}}}+df(v_b-1)=df(v_b)+k=df(v_a+1)+k\). The speed regulator follows line 1 \({{\tilde{v}}}_a=v_a+1=v_b\).

Definition 4

With \(k\in [0,v_{max}]\) we denote

$$\begin{aligned} C_k=\biggl \{(v_a,v_b,d)~\bigl \vert ~ \mid v_a-v_b\mid \le 1 \text { and } d=v_a+k \text { with } k\ge 1 \text { and } v_a,v_b\ge k\biggr \}. \end{aligned}$$

Given a particular \(k\in [0,v_{max}]\) the set \(C_k\) is invariant for the dynamic generated by the speed regulator provided that \(v_b\ge k\), i.e

$$\begin{aligned} (v_a,v_b,d)\in C_k\text { and } {{\tilde{v}}}_b\ge k \Longrightarrow ({{\tilde{v}}}_a, {{\tilde{v}}}_b,{{\tilde{d}}})\in C_k. \end{aligned}$$

The condition on \(v_b\) must be enforced in the statement since our description does not provide any clue about how \(v_b\) evolves (what is the value of \({{\tilde{v}}}_b\)). Given \((v_a,v_b,d)\in C_k\), \(\tilde{d}\) is given by \({{\tilde{d}}}=d-v_a+v_b\) and \({{\tilde{v}}}_a\) is given by the speed regulator. However at this stage, \({{\tilde{v}}}_b\) may be \(v_b-1\), \(v_b\) or \(v_b+1\). If \({{\tilde{v}}}_b=v_b-1\) it may well happen that \({{\tilde{v}}}_b\) becomes smaller than k, and the new configuration \(({{\tilde{v}}}_a, {{\tilde{v}}}_b, {{\tilde{d}}})\) no longer belongs to \(C_k\). Nevertheless, this result proves to be useful to understand long-term traffic patterns since by design we can keep the control on what is the value of \({{\tilde{v}}}_b\) and in particular enforce that \({{\tilde{v}}}_b \ge k\).

Ideally, we would like to show that the speed regulator leads any configuration to configurations in \(C_k\). This is generally not true. For instance, the configuration \((v_a=v_{max}, v_b=v_{max}, d)\) never changes for any d, as long as \({{\tilde{v}}}_b=v_{max}\). This corresponds to the free flow of Kerner (2004), Kerner (1999), Kerner (2021) where cars do not interact. We give a name to this set of configurations

Definition 5

We call \(C^+_{max}\) the set of configurations.

$$\begin{aligned} C_{max}^+=\biggl \{(v_a,v_b,d)~\bigl \vert ~ v_a=v_b=v_{max},~d\ge v_{max}\biggr \}. \end{aligned}$$

We show now that in the long term the traffic patterns are composed of configurations belonging to

$$\begin{aligned} \bigcup _{k=0}^{v_{max}} C_k \bigcup C_{max}^+. \end{aligned}$$

Definition 4 of the sets \(C_k\) uses the condition \(\mid v_a-v_b\mid \le 1\). Actually, half of this condition (\(v_b-v_a\le 1\)) appears naturally. In the long-term the regulator ensures that this condition holds, see Proposition 5. This is due to the fact that \(v_a\) increases if \(v_b>v_a\), the trailing car follows the leading car speed increase. Hence, once \(v_b-v_a\ge 1\) holds at one time, it holds thereafter.

Definition 4 makes use of the condition \(d=v_a+k\) which is preserved if \(v_a,v_b\ge k\) and \(\mid v_a-v_b\mid \le 1\), see Proposition 4. In the next Proposition 5 we show that \(d-v_a\) is decreasing, i.e. \(\tilde{d}-{{\tilde{v}}}_a\le d-v_a\), and identify conditions ensuring that it strictly decreases, i.e. \({{\tilde{d}}}-{{\tilde{v}}}_a < d-v_a\). This sets us on the way to prove that the regulator speed drives the dynamic to the sets \(C_k\) if not in \(C_{max}^+\).

A simple picture of the dynamics, which proves to be erroneous, would be that it is captured in a set \(C_k\) and stays in it until the condition \(v_b\ge k\) is violated which leads the dynamic to \(C_{k'}\) with \(k'<k\). Unfortunately, the real picture is more involved since in going from \(C_k\) to \(C_{k'}\) configurations outside of \(\bigcup _{k=0}^{v_{max}} C_k\) occur. For instance, from configuration \((5,5,10) \in C_{5}\) (\(k=5\)) and \({{\tilde{v}}}_b=4<k\), we have the sequence

$$\begin{aligned} \underbrace{(5,5,10)}_{C_5}\rightarrow (5,4,10)\rightarrow \underbrace{(5,4,9)}_{C_4}, \end{aligned}$$

where the intermediate configuration (5, 4, 10) does not belong to \(\bigcup _{k=0}^{v_{max}} C_k\).

The condition \(\mid v_b-v_a\mid \le 1\) can also be lost. For instance, if from configuration (5, 5, 10) the speed \(v_b\) of the leading car decreases twice we get the sequence

$$\begin{aligned} \underbrace{(5,5,10)}_{C_5}\rightarrow (5,4,10)\rightarrow \underbrace{(5,3,9)}_{\mid v_b-v_a\mid =2}\rightarrow \underbrace{(4,3,7)}_{C_3}\rightarrow \underbrace{(3,3,6)}_{C_3}. \end{aligned}$$

We see that configurations with \(\mid v_b-v_a\mid >1\) are transient, and transitions from \(C_k\) to \(C_{k'}\) with \(k'>k\) are not possible.

Proposition 5

We consider the configuration \((v_a,v_b,d)\) then

$$\begin{aligned}&\text {If } v_b>v_a \text { then } {{\tilde{v}}}_a=v_a+1, \end{aligned}$$
(2)
$$\begin{aligned}&\text {If } v_a-v_b\ge 2 \text { then } {{\tilde{d}}}-\tilde{v}_a<d-v_a. \end{aligned}$$
(3)

In the long-term,

$$\begin{aligned} \text {the condition } v_b-v_a\le 1 \text { holds and } d-va\ge {{\tilde{d}}}-{{\tilde{v}}}_a, \end{aligned}$$
(4)

and if we assume as well that \(d> 2v_a\) then

$$\begin{aligned}&\text {if } v_b>v_a\text { then }{{\tilde{d}}}-{{\tilde{v}}}_a=d-v_a \end{aligned}$$
(5)
$$\begin{aligned}&\text {else }{{\tilde{d}}}-{{\tilde{v}}}_a<d-v_a. \end{aligned}$$
(6)

Proof

From the given configuration we have the transition

$$\begin{aligned} (v_a,v_b,d)\rightarrow ({{\tilde{v}}}_a,{{\tilde{v}}}_b, {{\tilde{d}}}) \end{aligned}$$

where \({{\tilde{d}}}=d-v_a+v_b\) and because \(d\ge v_a\) it holds \(\tilde{d}\ge v_b\ge v_a+1\). Hence, \({{\tilde{d}}}+df(v_b-1)\ge v_a+1+df(v_a)=df(v_a+1)\) which shows that \({{\tilde{v}}}_a=v_a+1\).

Consider any viable configuration \((v_a,v_b,d)\). If \(v_b\le v_a\) then \(v_b-v_a\le 1\) holds. If \(v_b>v_a\) then \({{\tilde{v}}}_a=v_a+1\) as we have seen. There are two possibilities. Either \(v_b\) increases until reaching \(v_{max}\) and then a configuration with \(v_a=v_b=v_{max}\) ends up. Or, \(v_a\) comes close to \(v_b\) and satisfies \(v_a+1\ge v_b\) before \(v_b=v_{max}\). Once the condition \(v_b-v_a\le 1\) holds it subsequently holds always. For, in the worst case \(v_b=v_a+1\) and \({{\tilde{v}}}_a=v_b\) by the first statement of this proposition and \({{\tilde{v}}}_b\le v_b+1={{\tilde{v}}}_a+1\).

Finally, we prove that on the long-term \(d-v_a\ge {{\tilde{d}}}-\tilde{v}_a\). If \(v_b>v_a\), \({{\tilde{d}}}>d\) we have seen that in the long-term this amounts to \(v_b=v_a+1\). Hence, \({{\tilde{d}}}=d+1\) and because \({{\tilde{v}}}_a=v_a+1\) by the first statement of the proposition we get \(d-v_a={{\tilde{d}}}-{{\tilde{v}}}_a\).

If \(v_b=v_a\), \({{\tilde{d}}}=d\). If the regulator decreases the speed of a, i.e. \({{\tilde{v}}}_a=v_a-1\), it means that \({{\tilde{d}}} + df(v_b-1)<df(v_a)\) which leads to \({{\tilde{d}}}=d<v_a\) which is not possible in the long term. Hence, \({{\tilde{v}}}_a\ge v_a\) and, \(d-v_a={{\tilde{d}}}-v_a\ge {{\tilde{d}}}-{{\tilde{v}}}_a\). If we assume that \(d> 2v_a\) then \({{\tilde{d}}} +df(v_b-1)\ge df(v_a+1)\) and \({{\tilde{v}}}_a=v_1+1\) and \({{\tilde{d}}}-{{\tilde{v}}}_a=d-{{\tilde{v}}}_a<d-v_a\).

If \(v_b<v_a\), \({{\tilde{d}}}<d\). Actually, \({{\tilde{d}}}\le d-1\) and because \({{\tilde{v}}}_a\ge v_a-1\) we get \({{\tilde{d}}}-{{\tilde{v}}}_a\le d-1-\tilde{v}_a\le d-1-v_a+1=d-v_a\). If we assume that \(d>2v_a\) then \(v_b+1=v_a\) implies that \({{\tilde{v}}}_a=v_a\). Indeed, the condition \(\tilde{d}+df(v_b-1)\ge df(v_a)\) holds

$$\begin{aligned}&{{\tilde{d}}}+df(v_b-1)\ge df(v_a)\Leftrightarrow d-v_a+v_b+df(v_a-2)\ge df(v_a)\\&\quad \Leftrightarrow d\ge v_a+v_a-1-1. \end{aligned}$$

Hence, \({{\tilde{d}}}-{{\tilde{v}}}_a\le d-1-{{\tilde{v}}}_a<d-v_a\). If \(v_b+1<v_a\) then \({{\tilde{d}}}=d-v_a+v_b<d-1\) and using \({{\tilde{v}}}_a\ge v_a-1\) we get

$$\begin{aligned} {{\tilde{d}}}-{{\tilde{v}}}_a<d-1-{{\tilde{v}}}_a\le d-a-v_a+1=d-v_a. \end{aligned}$$

The next Proposition 6 establishes what are the long-term traffic patterns. In Fig. 1 we show how the \(C_k\) sets communicate. The figure is simplified, the intermediate transient configurations are ignored.

Proposition 6

In the long term the configurations \((v_a,v_b,d)\) belong to \(\bigcup _{k=0}^{v_{max}} C_k~\bigcup ~C_{max}^+\).

Proof

If we assume that \(d>2v_a\), and \(v_b>v_a\) then (2) implies that the dynamics ends up in \(C_{max}^+\) or \(v_b\le v_a\) happens, in which case \({{\tilde{d}}}-{{\tilde{v}}}_a<d-v_a\). Hence, the configurations are driven to satisfy \(v_a\le d\le 2v_a\), i.e. there exists \(k\le v_a\) such that \(d=v_a+k\). Next, by (3), (4) and \(d-v_a\) is bounded we see that conditions \(\mid v_b-v_a\mid \le 1\) is eventually satisfied and the configuration belong to \(\bigcup _{k=0}^{v_{max}} C_k\).

Fig. 1
figure 1

The invariant sets \(C_k\) for \(v_{max}=5\), and a simplified version of the transitions between them

We have seen that the long term dynamic of cars belong to \(\bigcup C_k \bigcup C_{max}^+\). If the speed of the cars are heterogeneous, a car with a lesser maximal speed will constraint the dynamic to sets \(C_k\) where the speed is restricted. In the long term higher speed won’t be observed.

4 Analysis of the flow

In the previous sections we analyzed the speed regulator by considering configurations of the form \((v_a,v_b,d)\). Here, we consider a flow of cars. Recall that if N cars are on a road section of length L, we define the density \(\rho =N/L\) [car per distance unit] and the flow \(j=\rho {\bar{v}}\) [car per unit time] where \({{\bar{v}}}\) is the average speed of the N cars.

Proposition 7

In the long term, for N cars on a road of length L the maximum flow j is bounded by

$$\begin{aligned} j\le 1-\frac{Nm}{L}=1-m\rho . \end{aligned}$$

In particular, the flow is maximal if all the cars configurations \((v_a,v_b,d)\) belong to the invariant set defined by Definition 4 with \(k=0\), i.e. \(C_0\).

Proof

Because in the long term configurations satisfy \(d\ge v\) by Propositions 2 and 3, we have \(Nm+\sum _{i=1}^N v_i\le Nm+\sum _{i=1}^N d_i=L\), from which we get \(\frac{\sum v_i}{L}\le 1-\frac{Nm}{L}\). Finally, from \(\bar{v}=\frac{\sum v_i}{N}\) we get \(j=\rho {{\bar{v}}}=\frac{N}{L} \frac{\sum v_i}{N}\le 1-\frac{Nm}{L}\). Proposition 4 with \(k=0\) defines a flow-optimal invariant set since the condition \(v=d\) (\(v_a=d\) in the notation of the proposition) is fulfilled.

It is common to express the flow as a function of the density \(\rho\), i.e. \(j=j(\rho )\).

We represent traffic configuration with a typewriter style using . to denote an empty cell of the road and a number to indicate the speed of the car that occupies the cell. For instance a configuration \((v_a=3,v_b=4,d=3)\) is represented as \(\underbrace{\texttt {3}}_{v_a}\underbrace{\texttt {...}}_{d}\underbrace{\texttt {4}}_{v_b}\). In all the following examples \(m=1\) is assumed for convenience.

We start with a seemingly counterexample of Proposition 7. The traffic pattern 3..3..3.. etc. is viable (does not lead to collision), of density \(\frac{1}{3}\) and of flow \(j=1\), hence it seems to contradict the statement of Proposition 7. However, this traffic pattern is transient (notice \(d<v_a\)) because at the next step cars decrease their speed to 2 and we get the traffic pattern 2..2..2..etc. which satisfies the bound of Proposition 7 and \(d\ge v_a\). In general, our analysis of the flow is in the long term and transient traffic patterns are ignored. It is not stated systematically that only long term traffic patterns are considered although everywhere assumed in the following.

A (long term) traffic pattern of maximal flow is

$$\begin{aligned} \texttt {.....5.....5.....5.....5.....5.....5..... etc.} \end{aligned}$$
(7)

This flow is maximal because the head-tail distance d equals the speed as proved in Proposition 7. Notice, that the flow is regular if measured on a road section of length L with \(L=6N\) where N is the number of cars, i.e. the configuration maximizes the function \(j(N,L)=j(N,6N)\). Hence for density \(\rho = 0.16{\bar{6}}\). The reader can imagine the same pattern repeating infinitely often.

Another example of maximal flow is

$$\begin{aligned} \texttt {...3...3...3...3...3...3...3...3... etc.} \end{aligned}$$
(8)

which is maximal for \(L=4N\) hence for density \(\rho =0.25\).

Maximal flow can be obtained by other regular patterns for different values of N and L. For instance, the flow of .1.2..3...2..1 etc. is maximal for \(N=5k\) and \(L=14k\) for any \(k>1\), hence for density \(\rho =5/14=0.36\).

The following traffic patterns are not optimal and of same density than (7):

.....4.....4.....4.....4..... etc. and

.....3.....3.....3.....3..... etc..

Indeed, in both configurations the density is \(\rho =0.16{\bar{6}}\) and no car changes his speed due to the speed regulator of Algorithm 1. Indeed, for the traffic pattern 4.....4..... to increase the speed to 5 the condition \(df(5)\le d + df(3)\) (the trailing car pays attention to the fact that the leading car can break) must be satisfied which is not the case, i.e. \(25 \not \le 5+6\). The same argument holds for the second traffic pattern, i.e. \(10\not \le 5 + 3\).

Another non flow-optimal traffic pattern is given by

$$\begin{aligned} \texttt {3....4.....5......4.....3....4.....5...... etc.} \end{aligned}$$
(9)

This configuration is not optimal since the following one with same density has a higher flow 5.....5.....5.....5.....5..... etc. Indeed, both configuration have density \(\rho =1/6\) but the flows are 16/24 and 20/24 respectively.

In summary, all these examples show that some traffic patterns are permanent in the long term but not optimal. This means that the flow of cars can be trapped in a sub-optimal configurations. Escaping such configuration requires coordination. For instance, all the cars must agree to accelerate at the same time. Otherwise, an accelerating car would violate the viability condition.

Traffic flows patterns with constant flow. In general, for traffic patterns with \(v=d\) and \(N_i\) cars at speed i satisfy

$$\begin{aligned} \sum _{i=0}^{v_{max}} (i+m) N_i = L,\text { and } \sum _{i=0}^{v_{max}}N_i=N. \end{aligned}$$
(10)

Equations (10) are useful to generate flow-equivalent traffic patterns. For instance, if we assume that there exists a configuration with \(N_2, N_3, N_4>0\) we can find a traffic pattern with one less car in \(N_2\) and \(N_4\) and two more in \(N_3\). Consider a car \(a\in N_4\) at speed 4, it can be turned to speed 3. To ensure flow-optimality (\(v_a=d\)) the next cars are moved one cell back until the speed of the car moved back is 2. The speed of this last car is turned to 3. We obtain a new configuration still satisfying (10). Actually this process can be repeated until \(N_2\) or \(N_4\) is empty. For instance, .1.2..3...2..1. etc. can be turned to .1.2..2..2..2.. etc. without modifying the flow-optimality of the traffic pattern.

Equations similar to Eq. (10) are used in Nishinari et al. (2004) to identify metastable branches. Each branch is determined by a number \(N_f\) of car following a free-flow pattern and \(N_j\) cars following a jammed traffic pattern. Moreover, head-tail distances and speeds are characteristics of the traffic pattern, \(d_f\) and \(v_f\) in the free flow, \(d_j\) and \(v_j\) in the jammed. Metastable branches are characterized by \((v_f,v_j,d_f,d_j)\). In general, our decomposition identifies the speed of all cars. Our reasoning in the previous paragraph shows that it is possible to build flow equivalent traffic patterns with less class of different speed, eventually 2 as in Nishinari et al. (2004) in some cases.

Jam formation. A classical traffic pattern is the appearance of a jam without bottleneck, see (Sugiyama et al. 2008) for real traffic experiment and Chou et al. (2022) for a recent review. For instance, cars are following a traffic pattern of the form of 3...3...3...etc. Let us assume that, for some reason, a car slows down to speed 2 then speed 1 at some time and for a given period. The trailing cars are following the speed changes and the cars are platooning at speed 1. When the braking car restarts following the speed regulator we observe that the flow increases. The relevant observation is that no trailing car is slowing down below speed 1. Notice that the constant speed pattern seems hard to restore and we observe a regular pattern of the form of (9).

The point is that, this is not what may be observed in real traffic conditions where some cars are observed to stop (at speed zero) (Sugiyama et al. 2008). Such a situation is not compatible with the viability condition guaranteed by the speed regulator.

To observe a trailing car with a speed lower than the speed of the leading car, the driver must depart from the safe regulator speed, for instance by missing an opportunity to decrease its speed. This can be exemplified by the pattern 3.. 2.1......3...etc. where the car at speed 2 must slows down to 1. If this car delays this update for one step it leads to 1.01..........3, forcing a trailing car to stop although the leading car \({ 1}\) did not.

To conclude this section we observe that if the cars are arranged at distance 0 and speed 0, like if waiting for a traffic light to turn green, they will reach the stable and optimal traffic pattern (7). However, if for a reason a car starts with a delay of one time unit, this delay cannot be recovered without violating the viability condition and hence, a non-optimal stable traffic pattern is observed.

5 Fundamental diagrams

In Fig. 2 we show the fundamental diagram restricted to maximal flow traffic patterns.

Fig. 2
figure 2

Left: Fundamental diagram with maximal flow patterns. Right: Complete fundamental diagram. Both Figures assume \(m=1\)

These traffic patterns are composed of configurations in

$$\begin{aligned} \bigcup _{k=0}^{v_{max}} C_k\bigcup C_{max}^+, \end{aligned}$$

see Definitions 4 and 5. As the density increases the cars follow a free flow traffic pattern. The configurations composing the traffic patterns are of the form \((5,5,d)\in C_{max}^+\) where \(d=\lfloor \frac{L-N}{N}\rfloor\) with N the number of cars and L the cyclic road length.Footnote 1 Some distances d may be larger than \(\lfloor \frac{L-N}{N}\rfloor\) to accommodate to the constraintFootnote 2\(N+\sum _{i=1}^N d_i=L\). The flow j as a function of the density \(\rho\) is given by \(j=\rho \times v_{max}\).

When the density passes the point where the flow is maximal, \((\rho _{crit},j_{max})\), the flow is given by \(j=1-m\cdot \rho\) which is the maximum flow as stated in Proposition 7. To obtain maximal flow traffic patterns, it is enough to start with all the cars lined up at distance and speed 0. The reason is that initial traffic pattern belongs to \(C_0\) cannot escape. The flow then increases and after some iterations it reaches a maximal value which is maintained.

We observe in Fig. 2 that the points are not exactly aligned on a line. This is due to the fact that the road length L is fixed and the divisibility of L by N as N changes is not guaranteed. This is discussed in detail in the proceedings version of this paper (Cohen et al. 2022).

The density corresponding to maximum flow \(\rho _{crit}\) and the maximal flow are given by

$$\begin{aligned} \rho _{crit}=\frac{1}{m+v_{max}}~~~\text { and }~~~j_{max}=\frac{ v_{max}}{m+v_{max}}. \end{aligned}$$

If we include random initial traffic patterns, a large region corresponding to congested traffic patterns appears in the fundamental diagram. This region is filled with traffic patterns composed of configuration in \(\bigcup _{v=0}^{v_{max}} C_k\). Figure 3 illustrates this situation for a road of length \(L=10\) units.

Fig. 3
figure 3

Left: Fundamental diagram with road length \(L=10\). Right: Same, but with each traffic pattern identified. Both panels assume \(m=1\)

In this figure, we can identify all traffic patterns and check they belong to \(\bigcup _{v=0}^{v_{max}} C_k\).

6 Comparison with classical traffic models

In this Section, we assume \(m=1\) to make comparisons of our model with previous works.

Among the first traffic model using Celullar Automata we consider the Nagel–Schreckenberg model (Nagel and Schreckenberg 1992) shown in Algorithm 2. One major difference is the probabilistic decrease of the speed. The purpose is to lead to probabilistic analysis of the flow for comparison with real traffic conditions.

figure b

Apart from that, we see that the Nagel–Schreckenberg speed regulator tries to maximize the speed, with a bounded increases of 1 and tries to regulate the speed such that \(d(a,b)\ge v_a\). Something very similar to what our regulator does.

It is mentioned in Kerner et al. (2002) that it is not observed in real traffic conditions that drivers regulate their speed and distance. Actually, it is mentioned that given that the distance is reasonable, drivers tend to keep the same speed as the leading car, hence maintaining the distance constant. Interestingly, this behavior is observed with our regulator and corresponds to the decomposition of the traffic flow with configuration in \(\bigcup _{k=0}^{v_{max}} C_k\). Indeed, for a configuration in \(C_k\) the distance between the trailing and leading cars d satisfy \(d=V_a+k\) and k is constant. It is relevant that real drivers tend to adopt the safe driving style of our regulator.

figure c

To mimic the real drivers behavior the KKW model is introduced in Kerner et al. (2002), see Algorithm 3.Footnote 3 A synchronization distance \(D=v_a+1\) is introduced and if the distance is smaller than this synchronization distance, the driver tends to copy the speed of the leading car. This is a similar behavior of our regulator for configurations in \(C_k\) except that the synchronization distance \(2v_a\) depends on the speed to ensure viability and no braking larger than 1.

figure d
figure e

Actually, for \(v_a\le d\le 2v_a-1\) our regulator can be rewritten as shown in Algorithm 5. We see that the behavior is exactly the same as the KKW regulator if \(v_a\ge v_b\). When \(v_a>v_b\) the deceleration is less systematic than in the KKW model and this is what reduces the distance between the leading and trailing cars. This realizes the transition \(C_k\rightarrow C_{k-1}\), and eventually to optimal flow traffic patterns composed of configurations on \(C_0\).

Contrary to our model, the Nagel–Schreckenberg and the KKW models make possible a deceleration of more than 1 unit. Our model never makes use of such high decelerations. See, for instance, how the regulator can be rewritten for \(d<v_a\) in Algorithm 4. In this case, the regulator targets the speed \(v_b-1\) in order to keep a decreasing (or constant) head-tail distance, eventually reaching the condition \(d\ge v_a\). It would be relevant to analyse the relevance of the strategy of our regulator from different point of views, fuel/energy consumption, comfort, emission of pollutants (Xue Wang et al. 2020), etc. Generally, such studies concerned the design of adaptive cruise control (Vasebi 2023).

We show in this section that although our regulator is formulated in simple terms, its behavior is diverse given the conditions, see for illustration Algorithms 4 and 5.

7 Conclusions and future works

In this paper we analyzed the traffic patterns that are accessible for autonomous vehicles equipped with a simple, local and deterministic speed regulator. We consider a simple traffic situations (cars following each other) and identified the potential strength and weakness of an automatic driving system, such as the presence of stop and go waves or non-optimal flow conditions. An interesting further work would be to ponder how much our model is robust to modeling changes. For instance, we make use of properties of the braking function df of Definition 2. It is relevant to wonder whether weakening these properties lead to the same results. For instance we use the property that \(df(v+1)=v+1+df(v)\). How could we weaken this property?

Of course, more complex situations need to be investigated, such as junctions, merging or lane changing to better understand the emergent collective behavior of autonomous cars.

In particular, leveraging communication capabilities of the cars, these more complex situations can be comprehended with the goal of establishing optimal traffic patterns. In the car-following pattern that we consider in this paper, this means coordinate the cars’ maneuver to reach an optimal traffic pattern that is not reachable without coordination.

Further work will encompass the analysis of the two lanes traffic patterns following the same approach as here. Using deterministic speed regulator we can look whether the long term traffic patterns of this paper can be generalized. Notice that using a different model, the one-lane metastable traffic patterns of Nishinari et al. (2004) can be found as well in a two-lane model (Fukui et al. 2002).

Two-lanes traffic patterns can be particularize to special problems like lane-merging, see for instance (Roncoli et al. 2016; Tajdari et al. 2020; Petig et al. 2018).

Fuel or more generally energy consumption is an important parameter to be included in the design of optimal traffic patterns. Comparison with such analysis on different models, for instance the KKW model (Xue et al. 2020) or CA model (Xue Wang et al. 2020), would help to ponder how much automated vehicles can help the energy consumption problem. In the literature the study of (Adaptive) Cruise Control algorithms aims at lowering the energy consumption, mostly fuel consumption, is an active area of research (Vasebi 2023).

Finally, we have shown in Sect. 6 that although our regulator is formulated in very simple terms, its behavior is diverse given the conditions, see for illustration Figs. 4 and 5. Our regulator mimics behaviors that others are explicitly designed to follow. For further work it would be relevant to extend such analysis to regulators beyond the Nagel–Scheckenberg and KKW regulators, in particular Adaptive Cruise Control that encompass the environmental impact (Vasebi 2023). In any case it is likely that direct computations, as we do in this paper, will not be possible and a formal framework should be developed or used, see for instance (Kamali et al. 2017; Hilscher et al. 2011; D’Antonio and Delzanno 2004).