Lexicographically Maximum Contraflow Problem with Vertex Capacities

+e contraflow approach has been extensively considered in the literature for modeling evacuations and has been claimed, due to its lane-direction-reversal capability, as an efficient idea to speed up the evacuation process. +is paper considers the contraflow evacuation model on network with prioritized capacitated vertices that allows evacuees to be held at intermediate spots too, respecting their capacities and priority order. In particular, it studies the maximum flow evacuation planning problem and proposes polynomial and pseudo-polynomial time solution algorithms for static network and dynamic multinetwork, respectively. A real dataset of Kathmandu road network with evacuation spaces is considered to implement the algorithm designed for dynamic multinetwork and to observe its computational performance.


Introduction
e contraflow approach, which refers to the reversibility of direction of traffic flow in one or more lanes of roadways for fixed time period, re-configures the road network, identifying ideal direction and reallocating available capacity for each arc. e approach, due to its lane-direction-reversal capability, can be taken as a potential remedy to mitigate congestion during emergencies. It significantly reduces the total evacuation time and/or increases the number of evacuees sent from the risk zone to safety. Studies show that reversing one lane of a fourlane dual highway increases the evacuation road capacity by approximately 30%, and by reversing all the inbound lanes, it increases by 67% [1]. e contraflow approach is primarily important for emergency evacuations; nonetheless, its applications are not limited to these.
is is commonly used for accommodating directionally imbalanced traffic associated with daily commuter in big cities as well as consequences due to religious gathering, arrangement of concerts or tournaments, etc. However, there is limited implementation of it in real emergency evacuations due to difficulty in using commonly employed methods to duplicate traffic conditions of real contraflow lane during an emergency [1]. e first mathematical optimization model for the contraflow problem was proposed by Rebennack et al. [2] that relies on the basis of the network flow model in [3]. ey have investigated analytical solutions for the maximum static contraflow (MSCF) problem and maximum dynamic contraflow (MDCF) problem with polynomial time complexities. e solution idea is based on transformation of input network into a new network for which existing network flow algorithms are applicable. e authors in [4] studied the continuous time maximum dynamic contraflow evacuation problem and proposed a polynomial time solution using the notion of natural transformation of flows suggested in [5].
Other variants that are closely related to the MDCF problem are the quickest contraflow (QCF) problem and earliest arrival contraflow (EACF) problem. e QCF problem on single-source-single-sink network has been solved polynomially in [2]. e EACF problem for the two-terminal series-parallel (TTSP) network has been studied and a polynomial time solution for this has been proposed in [6]. Maximum as well as earliest version of evacuation contraflow problems in network with not necessarily equal transit time on anti-parallel lanes have been studied in [7]. Network reconstruction-based solution procedures have also been proposed for these problems modeled with discrete as well as continuous time setting. e authors in [8] studied these problems for multinetwork setup and proposed polynomial time solutions for both discrete as well as continuous time models. However, the solution procedures for earliest version of the problems work only for TTSP network. e contraflow approach has been incorporated in the network flow model to study facility location problem in [9], and the notion of abstract flow has been applied to network contraflow problems in [10]. e partial contraflow approach over the abstract network setting has been introduced in [11]. We refer to the survey articles [12,13] for broader insight into dynamic network flow problems and evacuation planning problems.
is paper introduces a new aspect of the evacuation model designed on network with capacitated vertices by imposing the contraflow approach on it. e new model has arc reversal capability and is capable of holding evacuees at temporary shelters at intermediate vertices of given priority. e flow model adopted here is based on weak-conservation constraints given in [14] (cf. [15]). Based on this aspect, the maximum static contraflow problem on ordinary network and maximum dynamic contraflow problem on multinetwork are studied, and solution algorithms for them are proposed. It is crucial, in case of uneven road architecture, for example, to take contraflow models on multinetwork into account for preparing evacuation tasks [8]. Multinetworks capture the situation of road topology with parallel lanes of different transit time and anti-parallel lanes of unequal to and fro transit time. It is considered that the transit time parameter behaves symmetrically during the reversal of arc direction in the case of the dynamic contraflow problem. e evacuation flow model introduced in [14] is revisited and the lexicographically maximum contraflow problem on network with capacitated vertices is introduced in Section 2.
e solution procedures to the problems for static and dynamic cases are proposed in Sections 3.1 and 3.2, respectively. A case illustration with a real dataset is made in Section 4. Section 5 concludes the paper.

Model Description
Consider a directed multigraph G � (V, A) with vertex set V and arc set A, both to be finite, such that n: � |V| and m: � |A|. Represent the source and the sink by s and d, respectively, and assume a terminal set S ⊂ V with S: � v 1 , . . . , v r prioritized from higher to lower priority, i.e., d � v 1 ≻ · · · ≻v r , to be given. en, the corresponding two-terminal evacuation network for time horizon T is represented as N � (G, l(a), u(a), τ(a), k(v), s, d, T). Here, l: A ⟶ N 0 : � N ∪ 0 { } and u: A ⟶ N 0 represent the lower and upper arc capacity functions which bound the number of flow units on each arc a ∈ A at each time step from below and from above, respectively. Similarly, the vertex capacity function k: S ⟶ N 0 delimits the total number of flow units, which may be held in each of the vertices v ∈ S. Moreover, the transit time function τ: A ⟶ N specifies the time needed by a flow unit to traverse an arc. Treat time parameter in a discrete manner, i.e., T: � 0, 1, . . . , T { }. e non-negative flow variables f(a, t) defined by f: A × T ⟶ N 0 that specify the flow over time in the network N are the number of flow units entering arc a at time step t. e number of flow units entering arc a at time step t is assumed to be bounded by the capacity of an arc, i.e., f(a, t) satisfies the capacity constraints for all a ∈ A and for all t ∈ T. at is, (1) Moreover, f(a, t) has to be equal to zero for all t > T − τ(a) and for all a ∈ A. e excess flow at vertex v ∈ V at time t ∈ T, denoted by ex f (v, t), is defined as } denote the set of arcs entering and leaving vertex v ∈ V, respectively.
Further, we need to ensure that the excess flow at each vertex v ∈ S over time horizon T is to be bounded by the capacity k(v), i.e., Consequently, the total flow of evacuees leaving the source s is equal to the total flow of the evacuees held at vertices v ∈ S over the time horizon T, i.e., An arc a � (v, w) ∈ A in which the flow could travel from vertex v to vertex w is replaced by the arc (w, v) for contraflow purpose. e important feature of the considered dynamic network N is that the capacities and the transit time on anti-parallel arcs could be unequal, and it is allowed to have parallel arcs with different transit time only. us, the static network N, we consider here, is not a multinetwork. To this end, the objective of maximum contraflow evacuation planning problem is to lexicographically maxi- . . , r, if the direction of arcs on N is allowed to reverse. e network flow problem with this objective is termed as lexicographically maximum dynamic contraflow problem and abbreviated as LexMDCF problem. e maximum contraflow problem with above objective for static network N � (G, l(a), u(a), k(v), s, d) is termed as lexicographically maximum static contraflow problem and is abbreviated as LexMSCF problem.

Solution Discussion
Rebennack et al. [2] proposed polynomial time analytical solutions to the MSCF problem and the MDCF problem for the first time.
ey considered the problems in ordinary network that do not have capability of holding flows at intermediate vertices. eir solution idea is based on the reconstruction of input network into a new one, in which the existing network flow algorithms are applicable. is section discusses the solution procedures to LexMSCF problem for ordinary network and LexMDCF problem for multinetwork based on network reconstruction idea.

Lexicographically Maximum Static Contraflow
e lexicographically maximum static flow (LexMSF) problem that lexicographically maximizes the amount of flow entering a set of terminals in S with respect to a given prioritization and given vertex capacities has been solved polynomially in [14]. Here, the objective of the LexMSCF problem is to solve the LexMSF problem on N, if direction of arcs on N can be reversed.
We modify the solution idea of Rebennack et al. [2] that solves MSCF problem to solve the LexMSCF problem. eir idea is based on modification of input network into a new network by summing the capacities on arcs (v, w) and (w, v) such that MSCF problem reduces to MSF problem on it. In particular, the procedure has following steps. At first, given static network N � (V, A, u(a)) is transformed into its auxiliary network N � (V, A, u(a)) where the arc set A contains undirected arc (v, w), if (v, w) and/or (w, v) belong to original arc set A with capacity u(v, w) � u(v, w)+ u(w, v). Secondly, a maximum static s − d flow is computed on so-formed undirected network N by using any known algorithm. In our case, to ensure the intermediate holding capability in the solution and to respect the vertex capacities, the lexicographically maximum flow is computed by using LexMSF flow computation idea given in [14] instead of computing ordinary maximum flow. e modified procedure that solves LexMSCF problem is given in Algorithm 1.
We state the following lemma that shows equivalence between the optimal flow on N and the optimal contraflow on input network N, which turns out to be useful in optimality proof of algorithms designed for contraflow problems in this paper.
Lemma 1 (see [2]). e maximum static contraflow on a static network N is equivalent to the maximum static flow on the corresponding transformed network N.

Theorem 1. Given a static network N � (V, A, l(a), u(a), k(v), s, d), source s and terminal set
≻v r , and l(a) � 0 for all a ∈ A. en, Algorithm 1 computes a lexicographically maximum static contraflow on N optimally in strongly polynomial time. Proof.
e LexMSF Algorithm optimally computes a static flow for each terminals v ∈ S as sinks on reduced network N (see [14]). Moreover, Lemma 1 shows that these flows are equivalent to the maximum static contraflows on the input network N.
e computational complexity of the algorithm depends on time complexity of the solution procedure on the reduced network N. is is dominated by the time complexity of the solution procedure of LexMSF problem on N since the flow decomposition in each iteration and network transformation can be done only in O(mn), see [16], and O(m) time, respectively. Note that the LexMSF problem can be solved in strongly polynomial time [14].

Lexicographically Maximum Dynamic Contraflow
Problem for Multinetwork. Multinetworks capture the evacuation situation with anti-parallel lanes of unequal to and fro transit time as well as parallel lanes of unequal transit time. Maximum dynamic contraflow problems modeled on these class of network without capacitated vertices have been studied in [8]. For given dynamic multinetwork N � (V, A, l(a), u(a), τ(a), k(a), s, d, T) and terminal set S: � v 1 , . . . , v r of capacitated vertices with d � v 1 ≻ · · · ≻v r , the aim is to solve the LexMDCF problem, if the arc reversibility is permitted only once at time zero. In the following, the solution procedure (Algorithm 2) that solves the MDCF problem for multinetwork is modified to solve LexMDCF problem.
Solving MDCF problem, the arc (w, v) ∈ A is reversed, if the flow along arc (v, w) exceeds u(v, w) for w). is can be viewed, alternatively, as follows: for (v, w), (w, v) ∈ A such that τ(v, w) � τ(w, v), the flow value at arc a � (v, w) ∈ A greater than the capacity u(v, w) of the corresponding arc e parallel arcs (v, w) ∈ N have been labeled as (v, w) i such that τ(v, w) i < τ(v, w) i+1 , for i � 1, 2, . . . , q; q ≤ m, to avoid obstruction on the multinetwork while applying MCF algorithm.
Following theorems ( eorems 2 and 3) show that the Algorithm 2 solves maximum dynamic contraflow problem for multinetwork optimally in strongly polynomial time.  , u(a), τ(a), s, d, T) with integer inputs. en, maximum dynamic flow on N is equivalent to a maximum dynamic contraflow on N. Proof.
e auxiliary network N of the original network N obtained in step 2 is an undirected multinetwork. e maximum dynamic contraflow problem on N can be viewed as a maximum dynamic flow problem on N. While solving the latter problem on N, the network is to be further transformed by replacing each undirected arc by two oppositely directed arcs with capacities and transit times of both arcs equal to that of original arc. is allows us to send flow on either direction of the arc. However, the flow direction, once chosen, remains fixed throughout the procedure. at is, there is only a flow on one direction of any arc, and never in both directions at the same time as well as at different time periods. However, there could be a flow along arc (v, w) and (w, v) such that τ(v, w) ≠ τ(w, v) for (v, w), (w, v) ∈ A at the same time or at different time periods. e latter situation does not make the flow on N an infeasible since, in fact, arcs (v, w) and (w, v) are physically different arcs for τ(v, w) ≠ τ(w, v), due to the labeling of arcs in step 3.
us, the flow constructed by Algorithm 2 is feasible.
Since every feasible flow of the maximum dynamic flow problem on the transformed network N is feasible to the maximum dynamic contraflow problem on network N, the maximum dynamic flow on N is not greater than the maximum dynamic contraflow on N. On the other hand, since maximum dynamic flow on network N does not exceed maximum flow for the corresponding time expanded network N T [3], the maximum dynamic contraflow on N is not greater than the maximum static contraflow in time expanded network N T . is static contraflow is equivalent to the optimal static flow in N T due to the fact that any maximum static contraflow on network N has equivalent maximum flow in the corresponding transformed network N [2]. Again, since there exists a temporally repeated flow which is maximal over the time horizon T [3], the optimal static flow in N T is equivalent to the temporally repeated flow on N. us, the optimal dynamic contraflow on N is not greater than the optimal dynamic flow on N.

Theorem 3. For dynamic multinetwork N � (V, A, u(a), τ(a), s, d, T) with integer inputs, Algorithm 2 runs in strongly polynomial time.
Proof. Construction of auxiliary network in step 2 and labeling parallel arcs in step 3 require only linear time on m. e running time of Algorithm 2 is dominated by computation of a maximum dynamic flow in step 3. It is computed with the help of temporally repeated flow on N. Finding a temporally repeated flow is equivalent to solving a minimum cost flow problem. e minimum mean cycle-canceling algorithm of [17], for instance, requires O(n 2 m 3 log n) time for solving this problem. Next effort is to decompose the maximum static flow which requires O(mn) time [16]. us, Algorithm 2 runs in a strongly polynomial time for dynamic multinetwork N.
For given dynamic network N and terminal set S as described in Section 2, a lexicographically maximum dynamic flow (LexMDF) problem that lexicographically maximizes the amount of flow entering a set of terminals in S with respect to a given prioritization and given vertex capacities has been studied in [14]. e solution procedure to solve this problem is based on the notion of time expanded network introduced in [3]. Since the objective of LexMDCF problem is to respect the vertex capacities on the prioritized terminals, it is not sufficient to compute a maximum dynamic flow by the means of ordinary temporally repeated flows as in Algorithm 2. Instead, to solve the LexMDCF problem, a lexicographically maximum dynamic flow computation technique proposed in [14] can be applied. e solution procedure to solve LexMDCF problem for multinetwork has been summarized in Algorithm 3. Proof.
e LexMDF algorithm of [14] is applied in Algorithm 3 that computes dynamic flows on transformed network N iteratively for each vertex v ∈ S in priority order optimally. ese flows have equivalent maximum dynamic contraflows on input network N for each iteration due to eorem 2. Also, the application of LexMDF algorithm is dominating step with run time depending upon parameter T. Rest of the steps can be performed in strongly polynomial time. us, Algorithm 3 computes a lexicographically maximum dynamic contraflow on multinetwork N in pseudo-polynomial time.

Case Illustration
A case illustration is made by considering Kathmandu road network within and on the Ring Road (see Figure 1). Two scenarios: Scenario I with 38 vertices, 118 arcs, and 13 intermediate shelters and Scenario II (including minor road segments) with 52 vertices, 180 arcs, and 14 intermediate shelters, are examined. New Road area, a highly congested business hub with narrow streets, is taken as the source. Evacuation spaces identified in [18] are taken as the sink (Tribhuvan University (TU) area and Bagmati Corridor near Balkhu) and other intermediate shelters. Standard area (population per 45 square meters sphere) has been considered for the holding capacity of each intermediate evacuation space. However, the sink is assumed to have sufficient capacity. Tables 1 and 2 show the name of evacuation spaces together with their corresponding holding capacities and priority order. For this case illustration, shelters (except sink) are prioritized in random selection (however, it can be done with respect to their capacities, distance from the source or available facilities, and so on). Being a discrete time auto-based evacuation planning model, it followed the "two second rule," considering each minute as a unit of time. It is considered that the average speed of cars is 550 meters per minute that highly matches with the transit time to travel the segment provided by Google Maps data during normal traffic. Considering the time horizon of 60, 90, and 100 minutes and sufficient sink capacity, the results for Scenario I (Table 1) and Scenario II ( Table 2) before and after the application of the contraflow approach are demonstrated. e results show that the total maximum flow could be increased, while the contraflow approach is applied, by up to approximately 109%, justifying the importance of the approach in the evacuation planning problem. For the real-world problem, it is necessary to restrict the sink also by its actual evacuation space capacity (24090 evacuees [18]). In this case, evacuees that cannot reach sink due to its capacity are distributed among intermediate shelters respecting corresponding capacities, and more than 58 thousand (only nearly 4 thousand less) evacuees in total can be evacuated in 100 minutes for Scenario II, if contraflow is applied. Additional evacuees, about 34 thousand in number for Scenario II with actual sink capacity, can be saved due to consideration of intermediate holding of flows in the evacuation model. Detailed result discussion for this case has been omitted here. e algorithm has been coded into Python with version 3.9.1 and was run on the computer having Windows 10 operating system with 64 GB RAM and 3.60 GHZ Intel Core i9-9900k processor. It took around 1.5, 6, and 9 minutes to run the program while computing lexicographically maximum flows for T � 60, T � 90, and T � 100, respectively, for Scenario I. Similarly, for Scenario II, it took around 4, 16, and 22 minutes for T � 60, T � 90, and T � 100, respectively. ese significantly different running times for different values of parameter T and network input size justify the assertion about time complexity (pseudo-polynomial) of Algorithm 3 made in eorem 4. e finer discretization of time (controlling parameter in algorithm), instead of considering a

Conclusion
Importance and applicability of the idea of contraflow especially in the evacuation planning problem has been increasing. Existing network contraflow models fail to capture the situation where it is possible to send evacuees out from the risk zone to even an intermediate capacitated spot if they cannot reach the destination. is paper considered contraflow evacuation planning problems adopting the weak-conservation constraints that allow holding of flow units at prioritized intermediate vertices of given capacities. In particular, it proposed solution algorithms for lexicographically maximum static contraflow problem and lexicographically maximum (discrete) dynamic contraflow problem for multinetwork.
(3) Label each parallel arcs (v, w) ∈ N as (v, w) i such that τ(v, w) i < τ(v, w) i+1 for i � 1, 2, . . . , q; q < m. (4) Compute LexMDF on network N using algorithm in [14].    International Journal of Mathematics and Mathematical Sciences e continuous time dynamic flow model with weak-conservation constraint can also be defined in similar way as given in Section 2 by integrating the flow units at each time point t ∈ [0, T) instead of adding flow over time for each time step t ∈ T. Dynamic version of lexicographically contraflow problems studied in this paper can be extended to one with continuous time setting too. ese problems can be solved with computational time complexity equal to that of discrete time setting by applying notion of natural transformation of flows suggested in [5]. e limitation of the solution algorithm proposed for dynamic version of the problem is that it leads to a pseudo-polynomial time complexity since the size of underlying network strongly depends on T. Searching of polynomial time solution algorithm for this problem as well as studying the quickest and earliest versions of the problem would be future research areas. One could incorporate the idea of intermediate holding of flows in the multicommodity flow model that better reflects the realworld vehicle distribution scenario of most underdeveloped cities.
Data Availability e data used for the case illustration are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.