Recently, many disasters, such as earthquakes, nuclear plant accidents, volcanic eruptions and flooding, have struck in many parts of the world, and it has been recognized that orderly evacuation planning is urgently needed. A powerful tool for evacuation planning is the dynamic flow model introduced by Ford and Fulkerson , which represents movement of commodities over time in a network. In this model, we are given a graph with source vertices and sink vertices. Each source vertex is associated with a positive weight, called a supply, each sink vertex is associated with a positive weight, called a demand, and each edge is associated with positive length and capacity. An edge capacity limits the amount of supply that can enter the edge per unit time. One variant of the dynamic flow problem is the quickest transshipment problem, of which the objective is to send exactly the right amount of supply out of sources into sinks with satisfying the demand constraints in the minimum overall time. Hoppe and Tardos  provided a polynomial time algorithm for this problem in the case where the transit times are integral. However, the complexity of their algorithm is very high. Finding a practical polynomial time solution to this problem is still open. A reader is referred to a recent survey by Skutella  on dynamic flows.
This paper discusses a related problem, called the sink location problem [4, 6, 7, 8, 11, 12, 19, 20, 26], of which the objective is to find a location of sinks in a given dynamic flow network so that all the supply is sent to the sinks as quickly as possible. For the optimality of location, the following two criteria can be naturally considered: the minimization of evacuation completion time and aggregate evacuation time (i.e., sum of evacuation times). We call the sink location problem that requires finding a location of sinks on a dynamic flow network that minimizes the evacuation completion time (resp. the aggregate evacuation time) the CTSL problem (resp. the ATSL problem). Several papers have studied the CTSL problems [4, 8, 11, 12, 19, 20, 26]. On the other hand, for the ATSL problems, we have a few results only for path networks [6, 7, 20].
In order to model the evacuation behavior of people, it might be natural to treat each supply as a discrete quantity as in [22, 26]. Nevertheless, almost all the previous papers on sink location problems [4, 8, 11, 12, 19, 20] treat each supply as a continuous quantity since it is easier for mathematically handling the problems and the effect of such treatment is small enough to ignore when the number of people is large. Throughout the paper, we adopt the model with continuous supplies.
Although the above two criteria are reasonable, they may not be practical since the population distribution is assumed to be fixed. In a real situation, the number of people in an area may vary depending on the time, e.g., in an office area in a big city, there are many people during the daytime on weekdays while there are much less people on weekends or during the night time. In order to take such the uncertainty into account, Kouvelis and Yu  introduced the minmax regret model. In the minmax regret sink location problems, we are given a finite or infinite set of scenarios, where each scenario gives a particular assignment of weights on all the vertices. Here, for a sink location and a scenario , we denote the evacuation completion time or aggregate evacuation time by . Then, the problem can be understood as a 2-person Stackelberg game as follows. The first player picks a sink location and the second player chooses a scenario that maximizes the regret defined as . The objective of the first player is to choose that minimizes the maximum regret. Throughout the paper, we call the minmax regret sink location problem, where the regret is defined with the evacuation completion time (resp. the aggregate evacuation time), the MMR-CTSL problem (resp. the MMR-ATSL problem). The MMR-CTSL problems have been studied so far [3, 10, 14, 17, 19, 25, 24]. On the other hand, for the MMR-ATSL problems, we have few results [9, 18] although the problems are also important theoretically and practically.
As for how to define a set of scenarios, all of the previous studies on the minmax regret sink location problems adopt the model with interval weights, in which each vertex is given the weight as a real interval, and a scenario is defined by choosing an element of the Cartesian product of all the weight intervals over the vertices. One drawback of the minmax regret model with interval weights is that each weight can take an independent value, thus we consider some extreme scenarios which may not happen in real situations, e.g, a scenario where all the vertices have maximum weights or minimum weights. To incorporate the dependency among weights of all the vertices into account, we adopt the model with parametric weights (first introduced by Vairaktarakis and Kouvelis  for the minmax regret median problem), in which each vertex is given the weight as a linear function in a common parameter on a real interval, and a scenario is just determined by choosing . Note that considering a real situation, each weight function should be more complex, however, such a function can be approximated by a piecewise linear function. Thus superimposing all such piecewise linear functions, it turns out that for a sufficiently small subinterval of , every weight function can be regarded as linear, and by solving multiple subproblems with linear weight functions, we can obtain the solution.
In this paper, we study the MMR-ATSL problem on dynamic flow path networks with parametric weights. Our main theorem is below.
Theorem 1 (Main Results).
Suppose that we are given a dynamic flow path network of vertices with parametric weights.
The MMR-ATSL problem can be solved in time , where is the inverse Ackermann function.
When all the edge capacities are uniform, the MMR-ATSL problem can be solved in time .
Note that the MMR-ATSL problem with interval weights is studied by [9, 18], and only for the case with the uniform edge capacity, Higashikawa et al.  provide an time algorithm, which is improved to one running in time by . However, for the case with general edge capacities, no algorithm has been known so far. Therefore, our result implies that the problem becomes solvable in polynomial time by introducing parametric weights.
For two real values with , let , , and .
In our problem, we are given a real interval and a dynamic flow path network , which consists of five elements: is a path with vertex set and edge set ,
is a vectorof which component is a weight function which is linear in a parameter and nonnegative for any , a vector consists of the capacity of edge , a vector consists of the length of edge , and is the time which the supply takes to move a unit distance on any edge. Let us explain how edge capacities and lengths affect the evacuation time. Consider an evacuation under fixed . Suppose that at time , the amount of supply is at vertex and going through edge towards vertex . The first fraction of supply from can arrive at at time . The edge capacity represents the maximum amount of supply which can enter in a unit time interval, so all the supply can complete leaving at time . Therefore, all the supply can complete arriving at at time .
For any integers with , we denote the sum of weights from to by . For the notation, we define for with . For a vertex , we abuse to denote the distance between and , i.e., . For an edge , we abuse to denote a real open interval . We also abuse to denote a real closed interval . If a real value satisfies , is said to be a point on edge to which the distance from is value . Let be the minimum capacity for all the edges from to , i.e., .
Note that we precompute values and for all in time, and then, for any can be obtained in time as . In addition, for any can be obtained in time with preprocessing time, which is known as the range minimum query [2, 5].
2.1 Evacuation Completion Time on a Dynamic Flow Path Network
In this section, we see the details of evacuation phenomenon using a simple example, and eventually show the general formula of evacuation completion time on a path, first provided by Higashikawa . W.l.o.g., an evacuation to a sink follows the first-come first-served manner at each vertex, i.e., when a small fraction of supply arrives at a vertex on its way to , it has to wait for the departure if there already remains some supply waiting for leaving .
Let us consider an example with where . Assume that the sink is located at , and under a fixed parameter , the amount of supply at is for .
All the supply at immediately completes its evacuation at time and we send all the supply and to as quickly as possible. Let us focus on how the supply of moves to . First, the foremost fraction of supply from arrives at at time , and all the supply completes leaving at time , i.e., it completes arriving at at time . Suppose that at time , the amount of supply remains at . From then on, the time required to send all the supply to is . Thus, the evacuation completion time is expressed as
We observe what value takes in the following cases.
Case 1: It holds . In this case, the amount of supply at should be non-increasing, because the amount of supply leaves and the amount at most of supply arrives at per unit time. Let us consider the following two situations at time : When all the supply completes arriving at , there remains no supply at , that is, holds or not. If holds, then substituting it into (1), the evacuation completion time is expressed as
Otherwise, that is holds, there remains a certain amount of supply at even at time since the amount of supply at is non-increasing. Thus at time , the amount of supply remains at . From time to time , the amount of supply waiting at decreases by per unit time. Then, we have
Thus, the evacuation completion time is expressed as
Case 2: It holds . In this case, the amount of supply waiting at increases by per unit time from time (when the foremost supply from arrives at ) to time (when the supply from completes to arrive at ). Let us consider the following two situations at time . When the foremost supply from arrives at , there remains no supply at or not.
If there remains no supply at at time , then it holds in (1). Thus, the evacuation completion time is expressed as
Otherwise, the situation is similar to the latter case of Case 1. The difference is that the amount of supply waiting at increases by per unit time during from time to time , while in Case 1, it decreases by per unit time. For this case, the evacuation completion time is given by formula (3).
Let us turn to the case with vertices, that is, . When the sink is located at and a parameter is fixed, generalizing formula (5), the evacuation completion time is given by the following formula, which is provided by Higashikawa :
An interesting observation is that each in (6) is equivalent to the evacuation completion time for the transformed input so that only is given supply and all the others are given zero supply.
Let us give explicit formula of the evacuation completion time for fixed and parameter . Suppose that a sink is on edge . In this case, all the supply on the right side (i.e., at ) will flow left to sink and all the supply on the left side (i.e., at ) will flow right to sink . First, we consider the evacuation for the supply on the right side of . Supply on the path is viewed as a continuous value, and we regard that all the supply on the right side of is mapped to the interval . The value satisfying with represents all the supply at vertices plus partial supply of at . Let denote the time at which the first amount of supply on the right side of (i.e., ) completes its evacuation to sink . Modifying formula (6), is given by the following formula: For with ,
In a symmetric manner, we consider the evacuation for the supply on the left side of (i.e., ). The value satisfying with represents all the supply at vertices plus partial supply of at . Let denote the time at which the first amount of supply on the left side of completes its evacuation to sink , which is given by the following formula: For with ,
Let us turn to the case that sink is at a vertex . We confirm that the evacuation times when the amount of supply originating from the right side of and the left side of to sink are given by and , respectively.
2.2 Aggregate Evacuation Time
Let be the aggregate evacuation time (i.e., sum of evacuation time) when a sink is at a point and the weight functions are fixed by a parameter . For a point on edge and a parameter , the aggregate evacuation time is defined by the integrals of the evacuation completion times over and over , i.e.,
In a similar way, if a sink is at vertex , then is given by
2.3 Minmax Regret Formulation
We denote by the minimum aggregate evacuation time with respect to a parameter . Higashikawa et al.  and Benkoczi et al.  showed that for the minsum -sink location problems, there exists an optimal -sink such that all the sinks are at vertices. This implies that we have
for any . For a point and a value , a regret with regard to and is a gap between and that is defined as
The maximum regret for a sink , denoted by , is the maximum value of with respect to . Thus, is defined as
Given a dynamic flow path network and a real interval , the problem 1-MMR-AT-PW is defined as follows:
Let denote an optimal solution of (14).
2.4 Piecewise Functions and Upper/Lower Envelopes
A function is called a piecewise polynomial function if and only if real interval can be partitioned into subintervals so that forms as a polynomial on each . We denote such a piecewise polynomial function by , or simply . We assume that such partition into subintervals are maximal in a sense that for any and . We call each pair a piece of , and an endpoint of the closure of a breakpoint of . A piecewise polynomial function is called a piecewise polynomial function of degree at most two if and only if each is quadratic or linear. We confirm the following property about the sum of piecewise polynomial functions.
Let and be positive integers, and be piecewise polynomial functions of degree at most two with and pieces, respectively. Then, a function is a piecewise polynomial function of degree at most two with at most pieces. Moreover, given and , we can obtain in time.
Let be a family of polynomial functions where and denote the union of , that is, . An upper envelope and a lower envelope of are functions from to defined as follows:
where the maximum and the minimum are taken over those functions that are defined at , respectively. For an upper envelope of , there exist an integer sequence and subintervals of such that holds. That is, an upper envelope can be represented as a piecewise polynomial function. We call the above sequence the upper-envelope sequence of .
In our algorithm, we compute the upper/lower envelopes of partially defined, univariate polynomial functions. The following result is useful for this operation.
Let be a family of partially defined, polynomial functions of degree at most two. Then, and consist of pieces and one can obtain them in time , where is the inverse Ackermann function. Moreover, if a family of line segments, then and consist of pieces and one can obtain them in time .
Note that the number of pieces and the computation time for the upper/lower envelopes are involved with the maximum length of Davenport–Schinzel sequences. See  for the details. For a family of functions, if we say that we obtain envelopes or , then we obtain the information of all pieces .
2.5 Property of the Inverse Ackermann Function
The Ackerman function is defined as follows:
The inverse Ackermann function is defined as
We show that the following inequality:
holds for any positive integer with .
Let us suppose that and since holds. The inequality (16) is equivalent to the inequality
By the definition and the monotonicity of the Ackermann function, we have
The last two inequalities are led by the fact that
holds for any and any positive integer . Since holds, we have . Thus, the proof completes.
The main task of the algorithm is to compute the following values, for all and for all . Once we compute these values, we immediately obtain the solution of the problem by choosing the minimum one among them in time.
Let us focus on computing for each . (Note that we can compute for in a similar manner.) Recall the definition of the maximum regret for , . A main difficulty lies in evaluating over even for a fixed since we need treat an infinite set . Furthermore, we are also required to find an optimal location among an infinite set . To tackle with this issue, our key idea is to partition the problem into a polynomial number of subproblems as follows: We partition interval into a polynomial number of subintervals so that is represented as a (single) polynomial function in and on for each . For each , we compute the maximum regret for over denoted by . An explicit form of will be given in Sec. 3.1. We then obtain for as the upper envelope of functions and find the minimum value of for by elementary calculation.
In the rest of the paper, we mainly show that for each or , there exists a partition of with a polynomial number of subintervals such that the regret is a polynomial function of degree at most two on each subinterval.
3.1 Key Lemmas
To understand , we observe function . We give some other notations. Let and denote functions obtained by removing terms containing from formulae (7) and (8). Formally, for , let function be defined on and as
and for , let function be defined on and as
In addition, let and denote univariate functions defined as
where and denote functions defined as
Recall the definition of the aggregate evacuation time shown in (9). We observe that for , can be represented as
Let us focus on function . As increases, while the upper-envelope sequence of w.r.t. remains the same, function is represented as the same polynomial, whose degree is at most two by formulae (17), (18) and (19). In other words, a breakpoint of corresponds to the value such that the upper-envelope sequence of w.r.t. changes. We notice that such a change happens only when three functions , and intersect each other, which can happen at most once. This implies that consists of breakpoints, that is, it is a piecewise polynomial function of degree at most two with pieces. The following lemma shows that the number of pieces is actually .
For each , and are piecewise polynomial functions of degree at most two with pieces, and can be computed in time. Especially, when all the edge capacities are uniform, the numbers of pieces of them are , and can be computed in time.
Let us suppose that is on . We will show that is a piecewise polynomial functions of degree at most two with pieces, and when all the edge capacities are uniform, the numbers of pieces of them are . For , we can see the same properties in a symmetric manner.
To show the above statement, we give the following properties of :
The number of pieces of is . Especially, when all the edge capacities are uniform, it is .
Function of each piece of is a quadratic function in .
First, we show that property (i) holds. Recall that is the upper envelope of w.r.t. . For integers with , let be a function in defined as follows: If ,
otherwise, i.e., if ,
For any , let be the upper-envelope sequence of in . Now, for some , suppose . Note that holds. Then, the -th smallest breakpoint of for is . We notice that if changes from in condition that and formula of each remain the same, formula of also remains the same. In other words, a breakpoint of corresponds to when or formula of some changes. Consider the following three cases.
[Case 1]: When comes to some value , formula of some changes.
[Case 2]: Just after comes to some value , i.e., when , of some appears as a part of so that .
[Case 3]: When comes to some value , disappears from , i.e.,