1 Introduction

Problems of traffic flow have attracted the interest of statistical physicists during these decades. There are many theoretical and numerical studies about freeway traffic, using cellular automata (the Rule 184, the Nagel–Schreckenberg model, etc.) and follow-the-leader models (the car-following model, the optimal velocity model, etc.) [1, 2].

Urban traffic is also studied extensively [13] although the number of studies is less than that of freeway traffic. Most famous study was done by Biham and his co-workers [3]. Their model and its variants are extensions of the Rule 184 cellular automaton to two-dimensional systems, and it is found that there are three phases in these models, that is, free-flowing, jammed, and intermediate phases. However, these models are too simplified to compare observations with actual urban traffic. On the other hand, there are many studies using agent-based simulations [2, 4]. Although these agent-based simulations are promising tools for predictions and controls of real urban traffic, it is too complicated to understand macroscopic behavior of traffic very well from a theoretical point of view.

Recently, the so-called macroscopic fundamental diagram (MFD) draws great attention in studies of urban traffic [5]. MFD is a reproducible unimodal relation between vehicle density and vehicle flow rate averaged over a total urban traffic network. It is very interesting because it might enable rough predictions of large-scale urban traffic. Although some observations [5] and simulations [5, 6] argued the existence of MFD, a mechanism of obtaining MFD is not well understood.

For this purpose, we propose a simple graph-based model of urban traffic. The model is explained in Sect. 2. Then, we show results of simulations of our urban traffic model in Sect. 3. Finally, we discuss about our results in Sect. 4.

2 Method

2.1 Model

As a model of urban traffic, we consider strongly connected directed graphs with N vertices and \(N_\mathrm {street}\) edges as shown in Fig. 1.

Fig. 1
figure 1

Schematic picture of our traffic network. Here, we draw the case \(n_i^\mathrm {out} = 3\) and \(n_i^\mathrm {full} = 1\) as an example. Dashed arrows represent completely jammed streets \(\rho = 1\)

 We interpret vertices \(i = 1, \ldots , N\) and edges \({i \rightarrow j}, \ldots\) as intersections and streets with the same length L, respectively. By ignoring spatial structures of vehicle groups, traffic on each street \({i \rightarrow j}\) may be characterized only by two scalar quantities between 0 and 1, that is, vehicle density \(\rho _{{i j}}\) and flow rate \(q_{{i j}} \equiv q_{{i j}}(\rho _{{i j}})\). Here, \(q_{{i j}}(\rho )\) is a so-called fundamental diagram (FD) defined on every street \({i \rightarrow j}\) as:

$$\begin{aligned} q_{{i j}}(\rho ) = {\left\{ \begin{array}{ll} v_{{i j}} \, \rho &{}\quad {\text {if }} \rho < \rho _{\mathrm {p}, {i j}}, \\ w_{{i j}}(1-\rho ) + q^*_{{i j}} &{}\quad \text {otherwise} \end{array}\right. } \end{aligned}$$
(1)

as shown in Fig. 2, where \(\rho _{\mathrm {p}, {i j}} = 1/v_{{i j}}\), \(w_{{i j}} = (1-q^*_{{i j}})/(1-\rho _{\mathrm {p}, {i j}}) = (1-q^*_{{i j}})v_{{i j}}/(v_{{i j}}-1)\), and \(q^*\) is flow rate when a street is completely jammed. Note that we assume values of maximum density and maximum flow are the same for all streets and, therefore, all of \(\rho _{{i j}}\) and \(q_{{i j}}\) in this paper are normalized.

Fig. 2
figure 2

Schematic picture of fundamental diagram on each street. See text and especially Eq. (1) for details

Dynamical equation of vehicle density is given as:

$$\begin{aligned} \dfrac{\mathrm {d} \rho _{{i j}}}{\mathrm {d} t}&= \dfrac{1}{n^\mathrm {out}_i-n^\mathrm {full}_i} \sum _k \dfrac{q_{{k i}}(\rho _{{k i}})}{L} \nonumber \\&\quad - \dfrac{q_{{i j}}(\rho _{{i j}})}{L}, \end{aligned}$$
(2)

assuming equal distribution of vehicle density to outgoing streets at each intersection. Here, the first term and the second one in the r.h.s. of Eq. (2) represent incoming vehicle density from an intersection i to a street \({i \rightarrow j}\) and outgoing density from an intersection j of a street \({i \rightarrow j}\), respectively.

Regarding Eq. (2), we should mention that vehicle density is distributed to outgoing streets except for completely jammed ones (\(\rho _{{i j}} = 1\)). Therefore, the coefficient of the first term in r.h.s. of Eq. (2) is \((n^\mathrm {out}_i-n^\mathrm {full}_i)^{-1}\), where \(n^\mathrm {out}_i\) is the number of outgoing streets at an intersection i, and \(n^\mathrm {full}_i\) is the number of completely jammed streets among them (see Fig. 1).

2.2 Implementation of simulation

We use the Euler method to simulate our model:

$$\begin{aligned} \rho _{{i j}}(t+\delta t)&= \rho _{{i j}}(t) - \dfrac{q_{{i j}}\bigl (\rho _{{i j}}(t)\bigr )}{L} \delta t \nonumber \\&\quad + \dfrac{1}{n^\mathrm {out}_i-n^\mathrm {full}_i(t)} \sum _k \dfrac{q_{{k i}}\bigl (\rho _{{k i}}(t)\bigr )}{L} \delta t, \end{aligned}$$
(3)

where \(\delta t\) is a time step in our simulations. However, it is not sufficient just to use Eq.  (3), because we have to keep the condition \(0 \le \rho _{{i j}} \le 1\) throughout each simulation.

We have to consider a few necessary conditions for investigating new algorithm. When all outgoing streets from an intersection have space enough to accept vehicles, we decided that vehicles are equally distributed to those streets as shown in Eq. (2). We have to keep this equal distribution rule even in the case there is an outgoing street with \(\rho \simeq 1\). Meanwhile, if all of the incoming vehicles cannot enter outgoing streets due to the complete jam of at least one of them, actual flow rate of an incoming street \({i \rightarrow j}\) must be less than \(q_{{i j}}(\rho _{{i j}})\). Because there is no unique rule for such a situation, it is good to select the most natural one.

Therefore, in our actual simulations, we choose a method as summarized in Fig. 3. In short, basically we put vehicles only up to the limit of the capacity of that road. In more detail, we discretize Eq. (2) as follows: First, we put \(\tilde{\rho }_{{i j}}(t+\delta t) \Leftarrow \rho _{{i j}}(t)\) for all streets \(({i \rightarrow j})\), where \(\Leftarrow\) means an assignment operation of a variable.

  1. 1.

    \(i \Leftarrow 1\).

  2. 2.

    Define the following quantities:

    $$\begin{aligned} \rho ^\mathrm {cap}_{{i l}}(t)&= 1-\rho _{{i l}}(t),\end{aligned}$$
    (4)
    $$\begin{aligned} \rho ^\mathrm {inc}_{{k i}}(t; \delta t)&= \min \Biggl \{\dfrac{q_{{k i}}\bigl (\rho _{{k i}}(t)\bigr )}{L}\delta t, \rho _{{k i}}(t)\Biggr \},\end{aligned}$$
    (5)
    $$\begin{aligned} \rho ^\mathrm {cap}_i(t)&= \sum _l \rho ^\mathrm {cap}_{{i l}}(t),\end{aligned}$$
    (6)
    $$\begin{aligned} \rho ^\mathrm {inc}_i(t; \delta t)&= \sum _k \rho ^\mathrm {inc}_{{k i}}(t; \delta t). \end{aligned}$$
    (7)

    Here, \(\rho ^\mathrm {cap}_i(t)\) and \(\rho ^\mathrm {inc}_i(t; \delta t)\) mean total vehicle density to be able to enter outgoing streets from the intersection i and possible total vehicle density from incoming streets to the intersection i, respectively.

  3. 3.

    Go to 4 if \(\rho ^\mathrm {cap}_i(t) > \rho ^\mathrm {inc}_i(t; \delta t)\). Otherwise, go to 5.

  4. 4.

    For all incoming streets \(({k \rightarrow i})_k\), put

    $$\begin{aligned} \tilde{\rho }_{{k i}}(t+\delta t) \Leftarrow \tilde{\rho }_{{k i}}(t+\delta t) - \rho ^\mathrm {inc}_{{k i}}(t; \delta t). \end{aligned}$$
    (8)

    Then, go to 6 after performing the following procedure for all outgoing streets \(({i \rightarrow l})_l\):

    1. (a)

      Define \(l_0\) as \(\{{i \rightarrow l_0}\} = \emptyset\) and put \(\tilde{\rho }^\mathrm {inc}_i(t; \delta t) \Leftarrow \rho ^\mathrm {inc}_i(t; \delta t)\) and \(n \Leftarrow 1\).

    2. (b)

      Define \(l_n\) as \({i \rightarrow l_n}\) so that \(\rho ^\mathrm {cap}_{{i l_n}}(t)\) becomes smallest of any other streets \(({i \rightarrow l})_l \backslash ({i \rightarrow l_m})_{m < n}\).

    3. (c)

      If a condition

      $$\begin{aligned} \rho ^\mathrm {cap}_{{i l_n}}(t) > \dfrac{\tilde{\rho }^\mathrm {inc}_i(t; \delta t)}{n^\mathrm {out}_i - n+1} \end{aligned}$$
      (9)

      holds, put as

      $$\begin{aligned}&\tilde{\rho }_{{i l}}(t+\delta t) \nonumber \\&\Leftarrow \tilde{\rho }_{{i l}}(t+\delta t) + \dfrac{\tilde{\rho }^\mathrm {inc}_i(t; \delta t)}{n^\mathrm {out}_i - n+1}, \end{aligned}$$
      (10)

      for streets \(({i \rightarrow l})_l \backslash ({i \rightarrow l_m})_{m < n}\) and end this procedure. Otherwise, just go to 4d.

    4. (d)

      Put as

      $$\begin{aligned}&\tilde{\rho }_{{i l_n}}(t+\delta t) \Leftarrow 1,\end{aligned}$$
      (11)
      $$\begin{aligned}&\tilde{\rho }^\mathrm {inc}_i(t; \delta t) \Leftarrow \tilde{\rho }^\mathrm {inc}_i(t; \delta t) - \rho ^\mathrm {cap}_{{i l_n}}(t), \end{aligned}$$
      (12)

      and \(n \Leftarrow n+1\). Then, go to 4b.

  5. 5.

    For all incoming streets \(({k \rightarrow i})_k\), put as

    $$\begin{aligned}&\tilde{\rho }_{{k i}}(t+\delta t) \nonumber \\&\Leftarrow \tilde{\rho }_{{k i}}(t+\delta t) - \dfrac{\rho ^\mathrm {cap}_i(t)}{\rho ^\mathrm {inc}_i(t; \delta t)} \rho ^\mathrm {inc}_{{k i}}(t; \delta t). \end{aligned}$$
    (13)

    Meanwhile, put \(\tilde{\rho }_{{i l}}(t+\delta t) \Leftarrow 1\) for outgoing streets \(({i \rightarrow l})_l\). Then, go to 6.

  6. 6.

    \(i \Leftarrow i + 1\).

  7. 7.

    End this procedure if \(i > N\). Otherwise, go to 2.

Fig. 3
figure 3

Flowchart used in our actual simulations. Here, \(\Leftarrow\) is an assignment operation of a variable. See text for details

Finally, we define \(\rho _{{i j}}(t+\delta t) = \tilde{\rho }_{{i j}}(t+\delta t)\) for all streets \({i \rightarrow j}\).

The necessary conditions to keep the density within 0 and 1 are implemented in the processes 4 and 5.

3 Results

We simulate on \(N_x \times N_y\) grid networks to study MFD in our model. Here, \(N_x \times N_y\) grid networks are defined as networks that consist of northward or eastward unidirectional streets with \(N_x \times N_y\) intersections, as shown in Fig. 4.

Fig. 4
figure 4

Schematic diagram of \(N_x \times N_y\) grid network. Here, \(2 \times 2\) grid is drawn as an example. Periodic boundary condition is assumed for this network

Note that a periodic boundary condition is assumed in this study. A uniform distribution between \(\rho _0-\Delta \rho _0\) and \(\rho _0+\Delta \rho _0\) is considered as an initial condition of vehicle density on each street.

In Fig. 5, we show results for the simplest case, that is, MFDs obtained from simulations with a homogeneous FD condition \(\rho _{\mathrm {p}, {i j}}=\rho _\mathrm {p} = 0.3\) and \(q^*_{{i j}} = 0\) for every street \({i \rightarrow j}\).

Fig. 5
figure 5

Macroscopic fundamental diagrams of \(40 \times 40\) grid network in the case of a homogeneous FD condition (\(\rho _{\mathrm {p}, {i j}}=\rho _\mathrm {p}=0.3\)) and \(q^*_{{i j}}=0\) for every street \({i \rightarrow j}\). Solid lines are the results for various \(\Delta \rho _0\). Bold line is the original FD (Eq. 1) on each street. Dashed lines are sample means of \(q'_\mathrm {st}\) as shown in Eq. (17)

For the half-width of initial density distribution \(\Delta \rho _0\), four values \(\Delta \rho _0 = 0.01\), 0.05, 0.1, 0.15 are considered. Solid lines in Fig. 5 are the results from our simulations. It is noted that we define \(\langle A \rangle\) as a sample mean of a quantity A over at least 10 samples and

$$\begin{aligned} \rho _\mathrm {st}&= \rho _0,\end{aligned}$$
(14)
$$\begin{aligned} q_\mathrm {st}&= \dfrac{1}{\Delta T} \int _{T}^{T+\Delta T} \dfrac{1}{N_\mathrm {street}} \sum _{{i \rightarrow j}} \check{q}_{{i j}}(t) \, \mathrm {d}t,\end{aligned}$$
(15)
$$\begin{aligned} \check{q}_{{i j}}(t)&= {\left\{ \begin{array}{ll} 0 &{} \text {if }\forall k s.t.\ \rho _{{j k}} = 1,\\ q_{{i j}}\bigl (\rho _{{i j}}(t)\bigr ) &{} \text {otherwise}, \end{array}\right. } \end{aligned}$$
(16)

where we take T and \(\Delta T\) large enough to be able to regard a system in a steady state, \(N_\mathrm {street} \equiv 2N_x N_y\) is the number of streets in a \(N_x \times N_y\) grid network, and \(\sum _{{i \rightarrow j}}\) means taking sum over all streets on the graph.

Fig. 6
figure 6

Snapshot of a steady state of a traffic simulation on \(10 \times 10\) grid network in the case of \(\rho _0 = 0.4\) and \(\Delta \rho _0 = 0.01\) . Width of each line shows density on each street. Dashed line is drawn if the density of the street is equal to 0 or 1

It is shown that our MFDs are discontinuous at \(\langle \rho _\mathrm {st} \rangle = \rho _\mathrm {c}\) and mean flow rate becomes 0 for \(\langle \rho _\mathrm {st} \rangle \gtrsim \rho _\mathrm {c}\). The transition density \(\rho _\mathrm {c}\) depends on the half-width of initial density distribution \(\Delta \rho _0\). This transition density \(\rho _\mathrm {c}\) goes to \(\rho _\mathrm {p}\) as \(\Delta \rho _0 \rightarrow 0\).

We also plot dashed lines in Fig. 5, which are sample means of values

$$\begin{aligned} q'_\mathrm {st} = \dfrac{1}{\Delta T} \int _{T}^{T+\Delta T} \dfrac{1}{N_\mathrm {street}} \sum _{{i \rightarrow j}} q_{{i j}}\bigl (\rho _{{i j}}(t)\bigr ) \, \mathrm {d}t, \end{aligned}$$
(17)

or averaged “flow rate”. It is shown in Fig. 5 that \(q'_\mathrm {st} > 0 = q_\mathrm {st}\) for \(\langle \rho _\mathrm {st} \rangle > \rho _\mathrm {c}\), though this naïvely looks a correct definition of averaged flow rate. This difference is caused by local traffic jam due to the lockout of vehicles from outgoing streets, not by instability of density dynamics. To clarify it, we show a snapshot of a jammed state in Fig. 6. It is shown that there are some streets satisfying \(0< \rho _{{i j}} < 1\). Because all streets are directed to eastward or northward as shown in Fig. 4, it is readily found that outgoing streets connecting to the tail of such a street are always completely jammed.

Then, what happens if completely jammed streets do not avoid traffic flow? To answer this question, we show MFDs with the same conditions in Fig. 5 except for \(q^*_{{i j}} = q^* = 0.1\) for every street \({i \rightarrow j}\) in Fig. 7.

Fig. 7
figure 7

Macroscopic fundamental diagrams of \(40 \times 40\) grid network in the case of a homogeneous FD condition (see text). Solid and dashed lines are the results for \(q^*=0.1\) and 0.0, respectively. Bold lines are the original FDs (Eq. 1) on each street

 It is shown that mean flow rate becomes \(q^*=0.1\) for \(\langle \rho _\mathrm {st} \rangle \gtrsim \rho _\mathrm {c}\). It is also shown that the transition density \(\rho _\mathrm {c}\) is independent of \(q^*\).

Simulations of the disordered systems are also carried out. Uniform distribution between \(\rho _\mathrm {p}-\Delta \rho _\mathrm {p}\) and \(\rho _\mathrm {p}+\Delta \rho _\mathrm {p}\) is considered for the peak density \(\rho _{\mathrm {p}, {i j}}\) in FD of each street \({i \rightarrow j}\). The same initial conditions as the homogeneous case are considered. Moreover, for the half-width of peak density distribution \(\Delta \rho _\mathrm {p}\), four values \(\Delta \rho _\mathrm {p} = 0.0\), 0.05, 0.1, 0.2 are considered. Results for \(\Delta \rho _0 = 0.05\), \(\rho _\mathrm {p} = 0.3\), and \(q^* = 0.0\) are shown in Fig. 8.

Fig. 8
figure 8

Macroscopic fundamental diagrams of \(40 \times 40\) grid network in the case of disordered systems. A peak density distribution is given as a uniform distribution between \(\rho _\mathrm {p} - \Delta \rho _\mathrm {p}\) and \(\rho _\mathrm {p} + \Delta \rho _\mathrm {p}\). A half-width of an initial density distribution, an average peak density, and flow rate of a completely jammed street are \(\Delta \rho _0 = 0.05\), \(\rho _\mathrm {p} = 0.3\), and \(q^* = 0.0\), respectively. Bold line is an FD for \(\rho _\mathrm {p} = 0.3\)

 It is shown that even in the presence of disorders MFD decreases discontinuously at \(\langle \rho _\mathrm {st} \rangle = \rho _\mathrm {c}\), and the transition density \(\rho _\mathrm {c}\) depends both on \(\Delta \rho _0\) and \(\Delta \rho _\mathrm {p}\).

4 Discussion

In this paper, macroscopic behavior of urban traffic is studied using a simple graph-based model. Performing computer simulations of our model, we show that our model cannot produce continuous MFD as far as we studied. It is known that, on the other hand, the actual MFDs from the observations of Yokohama city are continuous [5]. Therefore, we conclude that our model is still inappropriate for a model of urban traffic.

One can find many possible reasons for that. Most probable one is the lack of any control of traffic in our model. In our model, outflow rate of vehicles is determined only by the density of the street where they are. However, this is not true in real traffic system: Traffic lights control local traffic and drivers get traffic information from variable-message signs, automotive navigation systems, etc.

Another possibility is our system conserves vehicle density. Because vehicles in the real system have their origins and destinations, urban traffic system is by definition an open system. It is known that such a boundary condition affects the property of steady states in one-dimensional stochastic processes [2, 7]. Therefore, it is expected that a boundary condition also affects urban traffic models.

To clarify the problem, we believe that we have to study stability of our model analytically, inspired by some previous studies for models related to ours [810]. We will discuss this problem elsewhere, for example, Refs. [11, 12] and another paper in preparation.