The **fundamental diagram of traffic flow** is a diagram that gives a relation between the traffic flux (vehicles/hour) and the traffic density (vehicles/km). A macroscopic traffic model involving traffic flux, traffic density and velocity forms the basis of the fundamental diagram. It can be used to predict the capability of a road system, or its behaviour when applying inflow regulation or speed limits.

There is a connection between traffic density and vehicle velocity: The more vehicles are on a road, the slower their velocity will be.
To prevent congestion and to keep traffic flow stable, the number of vehicles entering the control zone has to be smaller or equal to the number of vehicles leaving the zone in the same time.
At a critical traffic density and a corresponding critical velocity the state of flow will change from stable to unstable.
If one of the vehicles brakes in unstable flow regime the flow will collapse.
The primary tool for graphically displaying information in the study traffic flow is the fundamental diagram. Fundamental diagrams consist of three different graphs: flow-density, speed-flow, and speed-density. The graphs are two dimensional graphs. All the graphs are related by the equation “flow = speed * density”; this equation is the essential equation in traffic flow. The fundamental diagrams were derived by the plotting of field data points and giving these data points a best fit curve. With the fundamental diagrams researchers can explore the relationship between speed, flow, and density of traffic.

The speed-density relationship is linear with a negative slope; therefore, as the density increases the speed of the roadway decreases. The line crosses the speed axis, y, at the free flow speed, and the line crosses the density axis, x, at the jam density. Here the speed approaches free flow speed as the density approaches zero. As the density increases, the speed of the vehicles on the roadway decreases. The speed reaches zero when the density equals the jam density.

In the study of traffic flow theory, the flow-density diagram is used to determine the traffic state of a roadway. Currently, there are two types of flow density graphs. The first is the parabolic shaped flow-density curve, and the second is the triangular shaped flow-density curve. Academia views the triangular shaped flow-density curve as more the accurate representation of real world events. The triangular shaped curve consists of two vectors. The first vector is the freeflow side of the curve. This vector is created by placing the freeflow velocity vector of a roadway at the origin of the flow-density graph. The second vector is the congested branch, which is created by placing the vector of the shock wave speed at zero flow and jam density. The congested branch has a negative slope, which implies that the higher the density on the congested branch the lower the flow; therefore, even though there are more cars on the road, the number of cars passing a single point is less than if there were fewer cars on the road. The intersection of freeflow and congested vectors is the apex of the curve and is considered the capacity of the roadway, which is the traffic condition at which the maximum number of vehicles can pass by a point in a given time period. The flow and capacity at which this point occurs is the optimum flow and optimum density, respectively. The flow density diagram is used to give the traffic condition of a roadway. With the traffic conditions, time-space diagrams can be created to give travel time, delay, and queue lengths of a road segment.

Speed flow diagrams are used to determine the speed at which the optimum flow occurs. There are currently two shapes of the speed-flow curve. The speed-flow curve also consists of two branches, the freeflow and congested branches. The diagram is not a function, allowing the flow variable to exist at two different speeds. The flow variable existing at two different speeds occurs when the speed is higher and the density is lower or when the speed is lower and the density is higher, which allows for the same flow rate. In the first speed-flow diagram, the freeflow branch is a horizontal line, which shows that the roadway is at freeflow speed until the optimum flow is reached. Once the optimum flow is reached, the diagram switches to the congested branch, which is a parabolic shape. The second speed flow diagram is a parabola. The parabola suggests that the only time there is freeflow speed is when the density approaches zero; it also suggests that as the flow increases the speed decreases. This parabolic graph also contains an optimum flow. The optimum flow also divides the freeflow and congested branches on the parabolic graph.

A macroscopic fundamental diagram (MFD) is type of traffic flow fundamental diagram that relates space-mean flow, density and speed of an entire network with n number of links as shown in Figure 1. The MFD thus represents the capacity,
μ
(
n
)
, of the network in terms of vehicle density with
μ
1
being the maximum capacity of the network and
η
being the jam density of the network. The maximum capacity or “sweet spot” of the network is the region at the peak of the MFD function.

The space-mean flow,
q
¯
, across all the links of a given network can be expressed by:

q
¯
=
∑
k
=
1
n
d
i
(
B
)
n
T
L
, where B is the area in the time-space diagram shown in Figure 2.

The space-mean density,
k
¯
, across all the links of a given network can be expressed by:

k
¯
=
∑
k
=
1
n
t
i
(
B
)
n
T
L
, where B is the area in the time-space diagram shown in Figure 2.

The space-mean speed,
v
¯
, across all the links of a given network can be expressed by:

v
¯
=
q
¯
k
¯
, where B is the area in the space-time diagram shown in Figure 2.

The MFD function can be expressed in terms of the number of vehicles in the network such that:

n
=
k
¯
∑
k
=
1
n
l
i
=
k
¯
L
where
L
represents the total lane miles of the network.

Let
d
be the average distance driven by a user in the network. The average travel time (
τ
) is:

τ
=
d
v
¯
=
n
d
M
F
D
(
n
)
L

In 2008, the traffic flow data of the city street network of Yokohama, Japan was collected using 500 fixed sensors and 140 mobile sensors. The study revealed that city sectors with approximate area of 10 km^{2} are expected to have well-defined MFD functions. However, the observed MFD does not produce the full MFD function in the congested region of higher densities. Most beneficially though, the MFD function of a city network was shown to be independent of the traffic demand. Thus, through the continuous collection of traffic flow data the MFD for urban neighborhoods and cities can be obtained and used for analysis and traffic engineering purposes.

These MFD functions can aid agencies in improving network accessibility and help to reduce congestion by monitoring the number of vehicles in the network. In turn, using congestion pricing, perimeter control, and other various traffic control methods, agencies can maintain optimum network performance at the "sweet spot" peak capacity. Agencies can also use the MFD to estimate average trip times for public information and engineering purposes.

Keyvan-Ekbatani et al. have exploited the notion of MFD to improve mobility in saturated traffic conditions via application of gating measures, based on an appropriate simple feedback control structure. They developed a simple (nonlinear and linearized) control design model, incorporating the operational MFD, which allows for the gating problem to be cast in a proper feedback control design setting. This allows for application and comparison of a variety of linear or nonlinear, feedback or predictive (e.g. Smith predictor, internal model control and other) control design methods from the control engineering arsenal; among them, a simple but efficient PI controller was developed and successfully tested in a fairly realistic microscopic simulation environment.