Traffic congestion is considered to be one of the most important problems of any urban city. A large number of possible routes to reach a particular destination makes it difficult for the user to choose the optimal path. Optimality of a path itself depends on the user’s perspective. Generally, a user would choose a path familiar to him/her. However, there may be situations when a user has to divert from his regular known path and is unable to choose the best path from the existing options. A user may also rely completely on the navigation system which can guide the user to his/her destination. The navigation strategy may be based on both, the individual or the social perspective. The individual perspective to decide a route would be to choose the least costly available path. This strategy may lead to an equilibrium which is the Nash equilibrium of corresponding congestion game and can be formed as an optimization problem using Wardrop’s equilibrium conditions . However, this strategy is not optimal from the perspective of the city government or the city planner (e.g. department of transportation) . The city planner would want the total travel cost in the city to be minimized, which is popularly also known as the social optimal situation.
The earlier traffic assignment problems have been primarily considered in two ways: The static traffic assignment problem and the dynamic traffic assignment problem . In static traffic assignment problem, the demands for various origin-destination pairs are considered to be constant in time. Such scenarios represent networks where the traffic would inherently be constant, like in railway networks. However, if demands are assumed as functions of time, the problem is known as a dynamic traffic assignment problem. These time varying demand situations arise during emergency evacuation in cases of natural hazards .
Static traffic assignment doesn’t consider variation in time which makes it difficult to tackle traffic issues , but it is still preferred because of its simplicity which makes it useful to determine optimal solutions for large networks in less time 
. On the other hand, dynamic traffic assignment estimates the traffic conditions based on the historical and real time data analysis. This utilization of available data provides support in critical conditions and gives better results than the static traffic assignment. The problem of traffic assignment belongs to the class of constrained convex optimization problem . Need for the dynamic traffic assignment can also arise in the scenario where the demands are fixed but the traffic network itself changes due to uncontrollable random congestion in the network. This random congestion can be due to users not following centralized directives, or an unexpected change in road conditions and may lead to a very different optimal solution. The past work has not considered such a dynamic network which is the main focus of this work.
To solve the problem in an iterative manner, one promising technique is to use the Frank-Wolfe Algorithm to determine the optimal flows . We consider stochastic optimization framework because stochastic algorithms operate on stochastic estimates of objective function gradients, decreasing the computational complexity . In literature, projected stochastic gradient (SGD)  and stochastic variants of Frank-Wolfe algorithm  have been used to minimize a stochastic convex function subject to a convex constraint. In SGD algorithm, iterations are performed by descending through the negative direction of stochastic gradient with a proper step size and projecting the resulted point onto the feasible set .
In this paper, we consider a stochastic version of the traffic assignment problem which takes care of the inherent randomness present on each link of the traffic network. This corresponds to the practical situation where there are always some travelers who either do not follow centeralized directives such as recommendation of navigation systems to attain the optimal solution or travelers who are unaccounted for in the system database like rickshaws and autos in a typical suburban city for example an indian city. We propose a traffic assignment algorithm based on the stochastic Frank-Wolfe algorithm  to solve the problem in an online manner by considering the current samples of random additional congestion. We further state that the assumptions required to apply the algorithm of  are satisfied. The simulation results describe the efficacy of the proposed algorithm.
Ii Problem Formulation
In this paper, we consider a traffic network in an area as a directed graph where is the ordered list of nodes and is the ordered list of edges or links on which the traffic flows. Each node of the network may serve as an origin or destination or both for the traffic flow. For simplicity, we assume that multiple edges in the same direction between any two nodes do not exist. For an edge , let denotes the flow on edge and
be the flow vector of length. Let denotes the set of all open loop paths from the node to the node. Let flow mean the flow wishing to move from node to node . For a path , let denotes the flow on this path . Let be a matrix whose element, , denotes the mean flow of commuters wishing to move from the node to the node . Now, the total traffic flow over all possible paths between two nodes and should be equal to the total demand between these nodes i.e.
Also, for any edge, the total flow in it is equal to the total flow over all paths which consists of this edge i.e.
Additionally, it is important to note that all flows are non-negative
There is an inherent traversal cost associated with each link which may be a function of travel time, distance, congestion, tension, fuel or a combination of these . For any commuter, let denote the cost to traverse link :
where denotes the cost function of link and denotes the total flow in this link. In particular,
where and are fixed parameters corresponding to the link . We can see that the cost function in (4) for each link is a convex function. It is remarked that although we have considered a particular type of cost function for simplicity, but the analysis and the proposed algorithm can be extended for other convex cost functions. Let be the cost vector of length .
In general, the objective function for a traffic assignment problem depends on the various strategies that travelers choose for themselves. In this paper, we consider a social optimal model , in which there is a central authority such as city planning or traffic department which can direct the flow of all commuters into various paths with the goal to minimize the total cost of all commuters. Mathematically, this corresponds to the following objective function
This model works in the deterministic scenario where each commuter follows the central directive. In reality, traffic flows are not so deterministic and there is always some inherent randomness to them. This can be due to the unexpected commuters or commuters not adhering to directive or some other unexpected reasons. In this paper, we model the unexpected commuters via including randomness to each link flow. This additional flow changes with time to account for the stochastic and dynamic nature of the traffic. The optimal flow vector in a stochastic environment would be different than the ones obtained using objective functions (5). In this case, it is of interest to talk about a best ’average’ flow. We aim to achieve this stochastic social optimal solution.
Let be a vector of length whose element,
, is a random variable which denotes the uncertain flow on link. The elements of vector
follows an unknown probability distribution. Without loss of generality, we assume thathas zero mean i.e.
Note that a non-zero mean implies that on average the mean number of travelers use that link and if this was the case, then the mean traffic can be included as a part of the deterministic flow itself.
Now the flow in each link can be written as the summation of the deterministic flow and the random flow :
Note that deterministic flow is also the average flow in the link as
Since, the central authority can only control the deterministic or the average flow to optimize the cost. The problem of the social optimum flow in a stochastic environment with fixed average demands can be formulated as
where expectation in (9) is taken with respect to z. Note that the demand constraints are only put on the average flow as the demand matrix is itself an average demand over time.
Iii Proposed Online Algorithm
We have a stochastic constrained optimization problem in (9) and seek to solve it in an online manner . From online we mean that the decisions are taken‘on the fly’ when the random variables are realized. It is emphasized that since the distributions of the random variables in (9) is not known, it is not possible to solve the problem in closed form. Hence, we are interested in developing an online solution to the problem in (9) which works when the random variables are realized iteratively one by one. In literature, there are different online approached which can be utilized to solve the problem such as dual ascent methods , saddle point methods . But in these algorithms, the constraints are not satisfied at every step of the algorithm which is crucial to the traffic assignment problem considered here. Therefore, we propose a stochastic version of the traffic assignment algorithm . This algorithm is based on the stochastic Frank-Wolfe algorithm recently proposed in the literature .
For implementation of the proposed stochastic Frank-Wolfe traffic assignment algorithm (SFWTA), we need to compute the gradient of the stochastic and expected objective function. Let the stochastic objective function be
then the gradient is given as
Let dependence of on is modelled as i.e. . Then
Let denote the average objective function i.e.
The average gradient is
Case 1: if where
is independent uniformly distributed between, then
Case 2: Let is independent to , then
Hence, the biased-gradient-estimate update step at iteration is given as
where is the biased-gradient-estimate at iteration . The descent direction is found using [2, Theorem] which is given as the step 6 in Algorithm 1. The complete proposed SFWTA algorithm is stated as Algorithm 1.
In order to utilize the algorithm of , it is important to satisfy the assumptions made by  for the problem of interest here. Hence, next we present the assumptions required and their proof of being satisfied for the traffic assignment considered in this paper.
Iii-a Assumptions Required
For the sake of completeness, we recite the assumptions mentioned in  and show that they hold for our case.
Assumption 1: The convex set is bounded with diameter , i.e., for allC, we can write
The set in our case is denoted by the feasible convex set of constraints in (10)-(12). For any edge , let denote the set of all source-destination pair containing atleast one path which contains this edge i.e.
Let . From constraints, it is evident that . Now, if then
Hence, the optimization problem satisfies Assumption 1 with
This proves the assumption 1.
Assumption 2: The expected function is convex. Moreover, its gradients are L-Lipschitz continuous over the set , i.e., for all
where . Here, we represents the Hadamard Product using symbol ’’ and hence we write
From equation (18), we can write
Further, each element of can be simplified as
In general, equation (19) can be written as
where is a vector with terms of the form . If we take norm both sides and utilize the result [12, Theorem 2.5], we get
where is the upper bound on the norm of , which can be calculated from result in Assumption 1 and from the fact that . Thus, Assumption 2 holds for our case.
The variance of the unbiased stochastic gradients(, ) is bounded above by . To prove this, note that
which implies that
From (18) we have,
If we take norm both sides and utilize [12, Theorem 2.5],
In order to prove the bounded variance, considering the randomness at each edge to be independent of other edges, it is sufficient to show that variance of random variable is finite. We will prove this for the special case where with mean and variance . This implies that with mean and variance
. The moment generating function ofis
Using this, the moment of is
Since, is always bounded, the variance of will be bounded. From the bounded variance of , we conclude that
where is a finite number.
With all the Assumptions 1-3 satisfied, for the iterates and produced by the proposed Algorithm 1, it holds that
where & denote the vectors & at the iteration and represents the sigma algebra associated with all sources of randomness up to iteration. From Lemma 1, it is clear that with every iteration, there is a decrease in the squared error of gradient approximation, provided the term is negligible and adhere to the step size requirements mentioned in Algorithm 1.
Iv Examples and Numerical Results
In this section, we provide numerical results for the proposed algorithm in terms of performance and the convergence of the algorithm. For this numerical evaluation, we consider a traffic network consisting of 4 nodes and single demand between and (refer Fig. 1). We have assumed that the unity flow of commuters wish to move from node (node 1) to node (node 4), i.e.,
Let and be the network parameter vectors whose elements, and , denote the travel cost parameters associated with link . We assume the network parameters to be:
The random traffic on link is assumed to have a uniform probability distribution between to with the understanding that that the number of random travelers on a link would not be more than the deterministic flow on that link at any point of time. In other words, we have
Here, is the spread parameter and . Note that denotes deterministic environment. Therefore, the total flow on a link can be represented as
where is uniform distributed random variable independent to .
Optimal Solution: The classic traffic assignment  without considering the uncertainty in the system results in the optimal deterministic flow given by:
which may also be found by the solution in the following problem:
Here, denotes the units of traffic moving in the upper path comprised of links 1 and 2 and (1-) units of traffic denotes the flow moving in the path comprised of links 3 and 4. In the stochastic environment (), the optimum flow strategy to which gives the least travel costs on average turns out to be:
which is very different than the solution in the deterministic environment. It shows that the stochastic nature of the flow affects the optimal flow significantly.
Comparison of Classical and Stochastic algorithm: Fig. 2 shows the running mean of the total travel cost of the system for the classical deterministic solution and the proposed stochastic solution in a stochastic environment with . It is evident that the proposed stochastic solution performs much better in a random environment.
Covergence of the proposed algorithm SFWTA: Fig. 3 shows the maximum relative change in elements of flow vector (i.e. ) as iterations progress for the stochastic environment with . It can be seen that the maximum relative change decreases as iterations progress implying convergence of the proposed algorithm in the stochastic setting. Although there are sharp increases at some iterations, the overall trend is decreasing.
Impact of randomness in the user flow: Fig. 4 shows the variation of cost with respect to spread parameter . Recall that higher values of represents higher randomness in the user flow. As increases, the cost of the network increases and the difference between the stochastic and deterministic solution is more evident.
V Conclusion and Future Work
In this paper, we developed a framework for determining social optimally flow in a stochastic environment and proposed an online stochastic Frank-Wolfe algorithm to compute optimal flow. It is motivated that there exists an element of randomness in the flow of every link in the network. The convergence of the algorithm is derived based on the proof developed in . We considered a simple example with the uniform uncertainty in the flow and a socially optimal strategy in a stochastic environment was found using the proposed algorithm. The simulation results showed that the maximum relative change in the elements of the deterministic-flow vector decreased as the iterations progressed implying convergence under the assumption of mutual independence of the random flows over different time instants. The solution obtained from the proposed model clearly performed better than the classical solution on average in a stochastic setting. Future works in this direction may include the study of determining optimum flows with stochastic network parameters which correspond to the realistic scenario of temporary road blockages and the effect of non-zero correlation between the random variables and the evaluation of computational time-complexity for various algorithms.
-  J. G. Wardrop, “Some theoretical aspects of road traffic research,” in Proc. Inst Civil Engineers, 1952.
-  L. J. LeBlanc, E. K. Morlok, and W. P. Pierskalla, “An efficient approach to solving the road network equilibrium traffic assignment problem,” Transportation Research, vol. 9, no. 5, pp. 309 – 318, 1975.
-  K. Saw, B. K. Katti, and G. Joshi, “Literature review of traffic assignment: Static and dynamic,” International Journal of Transportation Engineering, vol. 2, no. 4, pp. 339–347, 2015.
-  W. Y. Szeto and H. K. Lo, “Properties of dynamic traffic assignment with physical queues,” Journal of the Eastern Asia Society for Transportation Studies, vol. 6, pp. 2108–2123, 2005.
-  M. Zou, X. M. Chen, H. Yu, Y. Tong, Z. Huang, M. Li, and H. Zou, “dynamic transportation planning and operations: concept, framework and applications in china,” Procedia-Social and Behavioral Sciences, vol. 96, pp. 2332–2343, 2013.
-  S. Han, S. Fang, X. Wang, X. Chen, and Y. Cai, “A simulation-based dynamic traffic assignment model for emergency management on the hangzhou bay bridge,” in Proc. ICCTP : Integrated Transportation Systems: Green, Intelligent, Reliable, 2010, pp. 883–895.
-  A. Mokhtari, H. Hassani, and A. Karbasi, “Stochastic conditional gradient methods: From convex minimization to submodular maximization,” arXiv preprint arXiv:1804.09554, 2018.
-  H. Robbins and S. Monro, “A stochastic approximation method,” Annals of Mathematical Statistics, vol. 22, pp. 400–407, 1951.
-  E. Hazan et al., “Introduction to online convex optimization,” Foundations and Trends® in Optimization, vol. 2, no. 3-4, pp. 157–325, 2016.
-  A. Ribeiro, “Ergodic stochastic optimization algorithms for wireless communication and networking,” IEEE Transactions on Signal Processing, vol. 58, no. 12, pp. 6369–6386, 2010.
M. Mahdavi, R. Jin, and T. Yang, “Trading regret for efficiency: online convex
optimization with long term constraints,”
Journal of Machine Learning Research, vol. 13, no. Sep, pp. 2503–2528, 2012.
-  R. A. Horn and R. Mathias, “An analog of the cauchy–schwarz inequality for hadamard products and unitarily invariant norms,” SIAM Journal on Matrix Analysis and Applications, vol. 11, no. 4, pp. 481–498, 1990.