# Optimizing Rural Highway Maintenance Scheme with Mathematical Programming
## 2 A Bi-Level Mathematical Programming Model  
In this section, we delve into the intricacies of developing a bi-level mathematical programming model tailored specifically to rural highway maintenance management. Before presenting the model itself, we begin by defining a comprehensive set of notations that will be utilized throughout this work. These notations serve as the foundation upon which our model is built, ensuring clarity and consistency in our approach. \(A\) the set of all road segments within the rural road network;  
\(c_{p}^{w}\) the travel time of the route \(p\) between OD pair \(w\in W\);  
\(f_{p}^{w}\) the flow of the route \(p\) between OD pair \(w\in W\);  
\(\mathbf{f}\) the set of route flows, i.e., \(\mathbf{f}=[f_{p}^{w}],\ \forall p\in R_{w},\ w\in W\);  
\(q^{w}\) the travel demand between OD pair \(w\in W\);  
\(R_{w}\) the set of all routes between OD pair \(w\in W\);  
\(t_{a}\) the travel time on the road segment \(a\);  
\(\mathbf{u}\) the set of network design decision variables \(u_{a}\);  
\(u_{a}\) the binary variable that specifies whether the road segment must be preserved--if the road segment must be preserved, \(u_{a}=1\); otherwise, \(u_{a}=0\);  
\(N\) the set of all nodes in the rural road network;  
\(V\) the number of road segments that are maintained simultaneously;  
\(\mathbf{x}\) a vector that is defined as \(\mathbf{x}=[x_{a}],\ \forall a\in A\);  
\(\mathbf{\delta}\) the road route incidence matrix, \(\mathbf{\delta}=[\delta_{a,p}^{w}],\ \forall w\in W,\ a\in A,\ p\in R_{w}\), where \(\delta_{a,p}^{w}=1\) if road segment \(a\) belongs to route \(p\) between OD pair \(w\), and \(\delta_{a,p}^{w}=0\); otherwise, \(\delta_{a,p}^{w}=1\). \(x_{a}\) the traffic flow on the road segment \(a\in A\);  
Let us consider a rural transportation network \(G=(N,A)\), in which the sets of nodes and road segments are represented by \(N\) and \(A\), respectively. The Bureau of Public Road (BPR) function, a well-established model in transportation engineering, is utilized to determine the journey time on each road segment. We give the BPR function as follows:  
\[t_{a}=t_{a,0}[1+b(x_{a}/y_{a})^{m}]+u_{a}E,\ a\in A \tag{1}\]where \(x_{a}\) represents the flow on road segment \(a\); \(y_{a}\) denotes the capacity of road segment \(a\); \(E\) is the maintenance cost of the road segments, which is chosen to be a very large number, signifying that no vehicles are allowed to travel on sections of the road that are currently under maintenance; \(t_{a,0}\) is the free-flow travel time of road segment \(a\). The parameters \(b\) and \(m\) can be adjusted based on particular circumstances, although they are typically set to 1 and 4, respectively. In this section, we propose a bi-level approach to optimize the road maintenance scheme, balancing costs, congestion, fuel consumption, and environmental impacts. The bi-level model is structured as follows. Upper level:  
\[\min_{\textbf{u},\textbf{x}}\sum\limits_{a\in A}x_{a}t_{a} \tag{2}\]  
subject to  
\[\left\{ \begin{array}{c}\sum\limits_{a\in A^{\prime}}u_{a}\leq V\\ u_{a}=0,\ a\in A\smallsetminus A^{\prime}\\ u_{a}\in\{0,1\},\ a\in A^{\prime}\end{array} \right. \tag{3}\]  
The upper level determines the combination of road segments to be maintained, focusing on minimizing the overall travel time across the network. Equation (2) serves as the objective function, aiming to minimize the total travel time of the entire rural transportation network. This objective is subject to Constraint (3), which limits the number of road segments that can be maintained simultaneously. Constraint (3) ensures that the sum of the binary variables \(u_{a}\) does not exceed the maximum number of road segments that can be simultaneously maintained at any given time, i.e., \(V\).