Search in Temporal Domains Kikuo Fujimura Department of Computer and Information Science The Ohio State University 2015 Neil Avenue , Columbus , OH 43210 USA Email : fujimura@cis.ohio-state.edu Phone : 614-292-6730 Fax : 614-292-2911 Abstract Best-first search algorithms have been widely used to find a minimum cost path in graph search . To formulate certain problems involving temporal events , it is at times instrumental to use graphs whose edge costs are time-dependent . In such a graph , shortest paths are dependent on time at which traversal in the graph begins . Typically , structural changes in sst occur at discrete points in t , where sst is the shortest path with start time t . In this paper , a best-first algorithm is generalized to handle time-dependent graphs to find shortest paths together with their start time characteristics and some properties of the algorithm are investigated . 1 Introduction Many heuristic search algorithms are designed to find a minimum cost solution from a given start node to a goal node in a directed graph -LSB- 7 , 10 , 13 -RSB- . Usually , a fixed -LRB- i.e. , time-invariant -RRB- cost is assigned to each edge of the graph . When dealing with a time-varying environment , it is sometimes convenient to consider a graph whose edge costs can vary with time . This paper describes a search algorithm in a temporal domain in which costs of traversing edges and nodes are dependent on time . A number of problems in machine intelligence can be formulated by using time-dependent graphs . Let us illustrate this point by using examples . Example 1 : Suppose a navigation system is to guide a vehicle from location S to location G in a certain area . Suppose that there are some time-dependent factors such as traffic signals , street closings , temporary inaccessible spaces , predicted heavy traffic jams , bad weather , etc. . Assuming that these time constraints are available a priori , what is the predicted time-minimum path ? This type of problems can naturally be formulated by a shortest path problem using a graph where nodes -LRB- representing intersections of roadways , railway crossings , etc. -RRB- are passable only during some time-intervals due to time constraints and delays of edges -LRB- representing passages between nodes -RRB- are also time-dependent as road conditions such as traffic can vary with time . Example 2 : Suppose that a visitor to a certain campus wishes to meet with several professors one at a time . Each professor may be found at different locations -LRB- e.g. , his office , lab , classroom -RRB- at different times of a day . Assuming that the visitor knows their schedules ahead of time , how can he plan his visiting schedule so that his trip around the campus is optimized ? This problem can be considered as a generalization of the traveling salesman problem in which nodes -LRB- i.e. , cities in TSP -RRB- are locations of the professors -LRB- variable in time -RRB- and the distances between two professors -LRB- corresponding to edge weights -RRB- are also time-dependent . Moreover , if each professor is unavailable for meeting with the visitor -LRB- due to office hours , faculty meetings , etc -RRB- , then the corresponding node of the graph has additional time constraints . Example 3 : Another problem of interest can be found in path planning in robotics . One wellknown solution for static environments is based on the visibility graph -LSB- 11 , 9 -RSB- . The visibility graph can be generalized to handle moving obstacles -LSB- 3 -RSB- , in which a path is represented by a sequence of vertex-to-vertex transitions . When the obstacles are permitted to move , the structure of the visibility graph also changes over time , that is , the robot departing a vertex Vi can reach another vertex Vj by a straight-line motion only when departing during certain time-intervals . Also , travel time it takes to move from Vi to Vj is time-dependent , which imposes a time-dependent graph in the problem . As can be seen by the above examples , search involving temporal events can be naturally formulated by using time-dependent graphs . One unique feature of temporal problems is that optimal solutions are dependent on start times . Let sst be the optimal solution -LRB- or path in a graph -RRB- for start time t. Then , sst and sst0 are , in general , not the same for t < > t0 . Considering sst as a function of start time t , sst can be classified into a number of groups based on sequences of nodes constituting the solutions such that within each group solutions consist of the same node sequence , i.e. , structural changes in sst occur at discrete points in t . In the rest of the paper , we use a ` topological path ' to refer to the node sequence of a path disregarding the timing information about when each node is traversed along the path . We are interested in finding all topologically different shortest paths with various start times . Various aspects of temporal constraints have been investigated in artificial intelligence -LSB- 1 , 2 -RSB- . Time-dependent graphs have been used in conjunction with search algorithms -LSB- 5 , 12 -RSB- . Orda and Rom have investigated shortest-delay paths under various wait conditions . They propose an algorithm for finding shortest-delay path for all start times by using a relaxation algorithm . However , this algorithm requires search to be started from all nodes in the graph simultaneously . This type of algorithm is effective when all nodes in the graph can be enumerated and fit in memory , while it does not work well in a circumstance in which generation of all nodes is not feasible , such as in TSP , due to memory constraints . In such a situation , a method that initiates search from a certain start node while gradually expanding its search horizon -LRB- possibly with a heuristic -RRB- must be used . Contrary to Orda and Rom 's conjecture that such a search method will not exist , we generalize a best-first algorithm to solve the problem of finding shortest paths for all start times in time-dependent graphs . The rest of the paper is organized as follows . In Section 2 , we state our problem and define time-dependent graphs used in our problem . In Section 3 , we present our method for graph search and describe a few properties of our search method . Section 4 contains discussions and Section 5 contains concluding remarks . 2 Preliminaries We first define time-dependent graphs and state a few basic properties on them . We consider two aspects separately , namely , time-dependent nodes and time-dependent edges . The former is shown to be subsumed by the latter . Time-dependent nodes : We consider a graph G -LRB- V ; E -RRB- , where V = fN1 ; N2 ; ? ? ? g is the set of nodes and E ae V ? V the set of edges . The edge between node Ni and Nj has a positive scalar value di ; j to indicate delay of the edge between node Ni and Nj . A node is assumed to be traversable only for some given time-intervals . For example , if we start node Ni at time t , then the earliest possible arrival time at an adjacent node Nj is time t + di ; j . If t + di ; j happens to be in node Nj 's untraversable time period -LSB- t1 ; t2 -RSB- , then the earliest arrival time at node Nj is defined as time t2 . -LRB- In the first example from Section 1 , the vehicle is infinitesimally close to node Nj , say a railroad crossing , at time t0 + di ; j , but can not pass through node Nj until time t2 . In the second example , the visitor can not meet with the professor until his class ends . -RRB- Time-dependent edges : A positive function di ; j -LRB- t -RRB- is associated to the edge NiNj , representing a time-dependent delay from nodes Ni to Nj . A traveler departing node Ni at time t will arrive at node Nj at time t + di ; j -LRB- t -RRB- . As noted in -LSB- 12 -RSB- , if no restriction is imposed on di ; j -LRB- t -RRB- , then non first-in-first-out behavior on edges is possible , that is , a traveler who leaves node Ni later may reach node Nj earlier . See Fig. 1 for an example of such a delay function in which the delay function d -LRB- t -RRB- is depicted by the solid curve . If the traveler departs at time t1 , then his arrival time is t1 + ffi1 , while if he waits until time t2 , his arrival time is t2 + ffi2 which is earlier than t1 + ffi1 . For a continuous function d -LRB- t -RRB- , the optimal delay function -LRB- denoted by D -LRB- t -RRB- depicted in dots -RRB- can be obtained from d -LRB- t -RRB- by considering the negative 45o line tangent to the curve of d -LRB- t -RRB- . The function Di ; j -LRB- t -RRB- represents the minimum delay between two nodes Ni and Nj including optimal wait time at node Ni . For example , for times between t3 and t2 , it is best to wait until time t2 to leave the node . In the following , we only consider delay functions with the first-in-first-out behavior or equivalently we assume that the delay function has already been converted to the form to preserve the first-in-first-out property -LRB- i.e. , Di ; j -LRB- t -RRB- in Fig. 1 is assumed rather than di ; j -LRB- t -RRB- -RRB- . start time d -LRB- t -RRB- delayd1d2 D -LRB- t -RRB- t2 t3 t1 Figure 1 : Delay function A time-dependent node can in fact be replaced by using time-dependent edges in the following manner . Suppose that N is a time-dependent node that is not traversable during time -LSB- t1 ; t2 -RSB- -LRB- Fig. 2a -RRB- . For each edge , ei , incident on N , we create an additional node N i and an edge e0i between N and N i -LRB- Fig. 2b -RRB- . Define the delay function for edge e0 as described in Fig. 2c . Due to edge e0i , we can not pass through node N until time t2 , which achieves the same effect as the original time-dependent node N . Thus , time-dependent node N has been replaced by a number of time-dependent edges . A path ff from a start node Ns to a goal node Ng is said to be optimal -LRB- or of minimum-time -RRB- if no other path can arrive at Ng earlier than ff . As pointed out in Section 1 , the notable characteristic of time-dependent graphs defined as above is that optimal paths are time-dependent . That is , for start times t1 and t2 , optimal paths starting from the same start node nS at times t1 and t2 are in general not the same in time-dependent graphs . This observation leads us to raise the following questions . t1 t2 t2-t1 -LRB- c -RRB- delay start time e2 ' e3 ' e3e2 e1e1 ' e1e2 45o N N N12N 3N e3 -LRB- a -RRB- -LRB- b -RRB- Figure 2 : Conversion Q1 . For a given start time ts , find the optimal path to a given goal node Ng . Q2 . Find optimal paths for all start times in -LSB- t0 ; 1 -RSB- , that is , develop an algorithm that produces the mapping M -LRB- t -RRB- : t ! sst for a time-dependent graph -LRB- V ; E -RRB- , where t 2 -LSB- t0 ; 1 -RSB- is a start time and sst is an optimal path for start time t . In fact , Q1 can be solved by extending the framework of the best-first algorithm such as A * . The second question enables us to characterize optimal paths exactly based on start times . Although this problem is more involved , it is of fundamental importance in search in time-dependent graphs , since it is instrumental in solving a number of related problems as below . 1 . If we are to ask query Q1 for k different start times , then the algorithm for Q1 has to be run k times independently . If we have an algorithm to find optimal paths for all start times at once -LRB- i.e. , if we can find mapping M -LRB- t -RRB- -RRB- , all queries can be answered immediately . If the cost for generating such a mapping M -LRB- t -RRB- is reasonable , then it pays to find M -LRB- t -RRB- rather than running the same algorithm repeatedly , especially when k is large . 2 . What is the overall optimal path that minimizes travel time , i.e. , the arrival time minus the departure time ? In the scenario of Example 2 , what time should the visitor start visiting the first professor so that his total travel time is minimized ? If there are multiple intervals to achieve such minimum travel time , then when is the first such one ? 3 . Once we have M -LRB- t -RRB- , it is simple to derive an answer for a query such as \ What is the latest start time in order to reach a certain node before a certain time ? '' , \ For a node N in the graph , is N ever on a minimum delay path ? If so , during which time interval ? '' , \ Find all start times for which a specific topological path is optimal '' , etc. . It is not efficient or even impossible to answer these types of queries by just using solutions for Q1 . 3 Search in Time-Dependent Graphs In the best-first algorithm in static domains , a scalar value is assigned to each node N to indicate the best path to node N found so far . In A * with an admissible heuristic function , the cost of node Ni is labeled as ` permanent ' when node Ni is expanded . To generalize this approach , we associate a chart -LRB- termed ` arrival chart ' -RRB- to each node . The horizontal axis of the chart represents start time and the vertical axis is delay to reach node N . That is , -LRB- t , y -RRB- in the chart means that if we start at time t from a given start node , then y is the earliest arrival time that node N can be reached . In our problem , it is possible that some portion of the arrival chart is ` permanently fixed ' , while the rest of the chart is ` tentatively assigned ' within a single node . The point -LRB- pt , py -RRB- -LRB- termed ` frontier point ' -RRB- is used to separate the two portions . It can be shown that when a node N is expanded , the portion of N 's arrival chart left of pt -LRB- thus below py -RRB- is final , whereas the portion right of pt may be revised later in the process . 3.1 Algorithm First , let us define some notations . Ns : start node . Gs : goal node . di ; j -LRB- t -RRB- : delay of the edge from nodes Ni to Nj . fi -LRB- t -RRB- : Arrival chart of node Ni , i.e. , if we start node Ns at time t , then the earliest possible arrival time at node Ni is time fi -LRB- t -RRB- . This chart is nondecreasing due to our FIFO assumption on edge delay , i.e. , fi -LRB- t2 -RRB- > = fi -LRB- t1 -RRB- for t2 > t1 . Initially , fi -LRB- t -RRB- = 1 for all nodes , except for Ns where fs -LRB- t -RRB- = t . The t axis of the chart is divided into a number of time intervals such that each time interval contains an identical topological shortest path . The chart also contains information about topological shortest paths from Ns to Ni , that is , backpointers to nodes immediately before Ni along the shortest paths . -LRB- pt , py -RRB- : A point on each chart to indicate the \ frontier point '' . An arrival chart has two parts ` lower-left ' -LRB- i.e. , part in which t < = pt or equivalently part in which y < = py -RRB- and ` upper-right ' -LRB- part in which t > pt or y > py -RRB- . When the node in OPEN is chosen for expansion , the lower-left part of the chart is considered ` permanent ' , while the rest of the chart is still ` temporary ' . pt and py are undefined until the node is visited for the first time . -LRB- ct , cy -RRB- : The current frontier point , i.e. , the frontier point of the node currently being expanded in the algorithm . It can be shown that upto y = cy , all arrival charts are final -LRB- i.e. , permanent -RRB- . YMAX : User defined constant to define a termination criterion . The search procedure terminates when cy reaches YMAX . LE -LRB- f , g -RRB- : The lower envelope of f -LRB- t -RRB- and g -LRB- t -RRB- , i.e. , pointwise minimum of the two functions . When taking the lower of the two , backpointers are setup appropriately to reflect a correct shortest path for each time interval . CrossPoint -LRB- f , g -RRB- : Let tCP be the smallest t such that f -LRB- t + ffl -RRB- < g -LRB- t -RRB- is true for any sufficiently small ffl > 0 . If such tCP exists , then CrossPoint -LRB- f , g -RRB- returns -LRB- tCP ; f -LRB- tCP -RRB- -RRB- ; otherwise , it returns NIL . This function is used to set the frontier point for a node to be expanded . OPEN : Queue of nodes which are to be expanded . The first element of the queue is the node whose py is the smallest . CLOSED : A node is put into CLOSED after being expanded . The node stays in CLOSED until some portion of its arrival chart is revised , at which point the node re-enters OPEN . Now let us present the time-dependent graph search -LRB- TDS -RRB- algorithm . In static graph search , the scalar value of a node is either ` tentatively assigned ' or ` permanently fixed ' , depending on the status of search , while in our search a part of the arrival chart associated to a node is permanent while the rest is tentative . A node in the graph can move between OPEN and CLOSED a number of times as illustrated in Fig. 3 . The function ` increment ' propagates the travel time between nodes and defined as below , where node N is not traversable in time intervals -LSB- ai , bi -RSB- . Node is Node expanded Revise -LRB- pt , py -RRB- if the start of the lowered reached portion is before pt . Not Reached CLOSEDOPEN Some portion of the arrival chart lowered . Set -LRB- pt , py -RRB- as the start of the lowered portion . Some portion of the arrival chart is lowered . Figure 3 : Transition of node status . Procedure TDS 1 . Push -LRB- Ns , OPEN -RRB- ; 2 . while OPEN is not empty 3 . M Pop -LRB- OPEN -RRB- ; 4 . ct M : pt ; cy M : py ; 5 . if cy > YMAX then report paths obtained so far and exit ; 6 . for each node N adjacent to M in graph 7 . ~ fN increment -LRB- fM , dM ; N , N -RRB- ; 8 . fnew N LE -LRB- ~ fN ; fN -RRB- 9 . X CrossPoint -LRB- ~ fN ; fN -RRB- ; 10 . if fnew N < > fN then / * Some portion of ~ fN is lower than fN * / 11 . if N 62 -LRB- OPEN S CLOSED -RRB- then 12 . fN fnew N ; 13 . N : pt X : t ; N : py X : y ; 14 . Push -LRB- N , OPEN -RRB- ; 15 . else if N 2 OPEN then 16 . fN fnew N ; 17 . N . pt MIN -LRB- X : t , N . pt -RRB- ; N . py MIN -LRB- X : y , N . py -RRB- ; 18 . / * Update the frontier point only when it gets lower . * / 19 . else if N 2 CLOSED then 20 . fN fnew N ; 21 . N . pt X : t ; N . py X : y ; 22 . Delete N from CLOSED ; 23 . Push -LRB- N , OPEN -RRB- ; 24 . M . pt 1 ; / * Tentative value for pt for nodes in CLOSED . * / 25 . Push -LRB- M , CLOSED -RRB- ; increment -LRB- fM ; dM ; N ; N -RRB- / * Node N is not traversable in -LSB- a1 ; b1 -RSB- , -LSB- a2 ; b2 -RSB- , ? ? ? . * / for all t 2 -LSB- 0 , 1 -RRB- y -LRB- t -RRB- fM -LRB- t -RRB- + dM ; N -LRB- fM -LRB- t -RRB- -RRB- ; if y -LRB- t -RRB- 2 -LSB- ai , bi -RSB- for some t then y -LRB- t -RRB- bi for that t ; return -LRB- y -LRB- t -RRB- -RRB- ; Let us illustrate how the TDS algorithm works by using an example . Figure 4 contains a timedependent graph containing four nodes . In this example , only node N1 is time-dependent | during time intervals -LSB- 3 , 7 -RSB- and -LSB- 8,11 -RSB- , N1 is not passable . This means , for example , if we start from node Ns at time 1 to move to node N1 , then we arrive at node N1 at time 4 -LRB- = 1 +3 -RRB- ; however , this transition is not complete until time 7 , since node N1 is considered not passable -LRB- or N1 can not be entered -RRB- at time 4 . We have to wait until time 7 to enter node N1 . All edges have a constant delay function in this example . 3 6 2 N 1 2 -LSB- 3,7 -RSB- -LSB- 8,11 -RSB- gN 2N 1Ns Figure 4 : An example graph . We first expand Ns . Figure 5a contains the arrival chart for node N1 as created when node N1 is reached via edge NsN1 . Since N1 is not available during time interval -LSB- 3,7 -RSB- , the arrival time at node N1 remains 7 for start times in -LSB- 0,4 -RSB- . After time 4 before 5 , the arrival time at node N1 monotonically increases -LRB- i.e. , the arrival time at node N1 is t + 3 , where t is the start time from node Ns -RRB- . Since f1 -LRB- t -RRB- = 1 initially , CrossPoint is 7 , which is the new pt for N1 and is circled in the figure . Figure 5b is the arrival chart for node N2 as reached directly from node Ns . Since node N2 is always available , the arrival time is t + 6 . CrossPoint returns 6 , as indicated as a circle in Fig. 4b . After Ns 's expansion , OPEN contains N2 -LRB- with pt = 6 -RRB- and N1 -LRB- with pt = 7 -RRB- . Note that when a node N is reached for the first time , its pt is always fN -LRB- 0 -RRB- . We now expand node N2 . For edge N2Ng , we add one to the chart of Fig . 5b to obtain the chart of Fig. 6a . For edge N2N1 , we obtain the chart of Fig. 6b based on Fig. 5b and information on N1 . The new arrival chart ~ f1 -LRB- Fig. 6b -RRB- is compared against the existing arrival chart f1 -LRB- i.e. , Fig. 5a -RRB- . It turns out that f1 < ~ f1 for all t 2 -LSB- 0 , 1 -RRB- , i.e. , f1 = LE -LRB- ~ f1 ; f1 -RRB- . Thus , no part of the arrival chart of N1 is to be changed at this point . After this expansion of N2 , OPEN contains N1 and CLOSED contains NS and N2 . In this example , we do not consider expanding Ng as there is only one goal node in the graph . Next , N1 is expanded . For edge N1N2 , we add two onto the chart of Fig . 5a to obtain the chart ~ f2 of Fig. 7a . We overlay ~ f2 on top of the existing f2 -LRB- Fig. 5b -RRB- to produce the lower-envelope of f2 and ~ f2 -LRB- Fig. 7b -RRB- . In Fig. 7b , f2 is depicted in coarse dotted lines and ~ f2 is reproduced in finer dots . The solid line indicates the lower-envelope of the two . The two dotted lines -LRB- coarse and fine -RRB- 41 5N 's -LRB- pt , py -RRB- = -LRB- 0 , 7 -RRB- . 11 8 Ns to N 22 -LRB- a -RRB- -LRB- b -RRB- 6 73 Ns to N 1 t -LRB- start time -RRB- t y -LRB- arrival time -RRB- y N 's -LRB- pt , py -RRB- = -LRB- 0 , 6 -RRB- . Figure 5 : Expansion of Ns Ns to N to N2 1 7 Ns to N to N 11 1 3 2 N 's arrival chart does not change . g -LRB- a -RRB- -LRB- b -RRB- y y -LRB- arrival time -RRB- tt N 's -LRB- pt , py -RRB- = -LRB- 0 , 7 -RRB- g Figure 6 : Expansion of N2 4 7 5 11 8 6 9 1Ns to N to N2 13 5 5 913 3 4 7 8 shortest path0 In these intervals , shortest path = = -LRB- a -RRB- -LRB- b -RRB- 1110 Cross Point 2 N N N N N 2 1 2 y -LRB- arrival time -RRB- y t t N re-enters OPEN with -LRB- pt , py -RRB- = -LRB- 3,9 -RRB- . N 's revised arrival chart 2 f2 f2 -LRB- from Fig. 7a -RRB- -LRB- from Fig. 5b -RRB- Figure 7 : Expansion of N1 along edge N1N2 4 7 5 11 8 9 1 -LRB- from Fig. 8a -RRB- Ns to N to N 13 5 5 913 3 4 7 8 shortest path0 In these intervals , shortest path = = -LRB- a -RRB- 7 12 2 6 g N N N2 g N N N1 g -LRB- b -RRB- y -LRB- arrival time -RRB- t t y N 's revised arrival chartg Cross Point f g f g -LRB- from Fig. 6a -RRB- Figure 8 : Expansion of N1 along edge N1Ng 10 intersect at -LRB- 3 , 9 -RRB- , which defines CrossPoint of f2 and ~ f2 . This in turn makes N2 's new pt to be 9 . Node N2 is re-entered into OPEN with pt = 9 . As shown in Fig. 7b , topological paths can be associated with corresponding intervals of the t axis . This means that the route Ns ! N2 is optimal if the start time is earlier than 3 or within -LSB- 5 , 7 -RSB- ; Ns ! N1 ! N2 is optimal otherwise . Thus , node N2 is to be associated with two different routes to get there together with the arrival chart . Function LE is responsible for setting backpointers when it is evoked with two input arrival charts . Next , we turn to N2 's expansion along edge N2Ng . Fig. 8a contains ~ fg obtained by adding two to Fig. 5a . Fig. 8b contains the overlay of ~ fg -LRB- finer dots -RRB- and fg -LRB- coarser dots -RRB- to produce fnew g -LRB- solid line -RRB- . After expansion , N1 enters CLOSED . At this point , we have only N2 in OPEN . It is simple to confirm that expanding N2 with pt = 9 does not change the arrival chart of either N1 nor Ng . Thus , OPEN is empty in the next time the while loop is executed and the procedure terminates . Thus , the arrival chart of Fig. 8b is final for Ng ; so are Fig 5a and Fig 7b for nodes N1 and N2 , respectively . The total travel time from Ns to Ng -LRB- excluding the wait time at Ns -RRB- is shortest in time -LSB- 4 , 5 -RSB- and -LSB- 8 , 1 -RRB- . Thus , the earliest start time to achieve a path with minimum travel time is 4 . 3.2 Properties In this subsection , we describe a few properties exhibited by the TDS algorithm . Property 1 . Let N be a node selected for expansion in TDS , -LRB- tN ; yN -RRB- be its frontier point at the time of expansion , and Q be a node adjacent to N . The part of Q 's arrival chart that is lower than yN will not be changed by -LRB- i.e. , remains unchanged after -RRB- the expansion of N . Proof : We show the above property by induction on n , the number of node expansions . For n = 1 , i.e. , immediately after Ns has been expanded , -LRB- pt , py -RRB- = -LRB- 0 , 0 -RRB- for all nodes , thus the property is correct . Suppose the property holds upto -LRB- n ? 1 -RRB- - th expansion . Let N be the node selected for the n-th expansion . There are two cases to consider , depending on whether or not N is expanded for the first time . -LRB- Case 1 - N is expanded for the first time -RRB- : In this case , Nt must be 0 , that is , N 's frontier point is -LRB- 0 ; yN -RRB- . Since fN -LRB- t -RRB- is nondecreasing -LRB- thus fN -LRB- t -RRB- > = yN for t > = 0 -RRB- , expansion of N certainly can not decrease the portion of Q 's arrival chart lower than y = yN . -LRB- Case 2 - N has been expanded before -RRB- : Let -LRB- ~ tN , ~ yN -RRB- be N 's frontier point at the time of its most recent expansion prior to the latest expansion with the frontier point -LRB- pt , py -RRB- = -LRB- tN ; yN -RRB- . Apparently , Q 's arrival chart has been affected -LRB- if at all -RRB- by N 's expansion at least once when N was expanded with -LRB- ~ tN ; ~ yN -RRB- . By the induction hypothesis , no part of N 's arrival chart prior to Nt has been modified between the time N was expanded with -LRB- ~ tN , ~ yN -RRB- and the latest expansion with -LRB- tN ; yN -RRB- . That is , as long as N 's arrival chart prior to Nt is concerned , it has remained the same between the last expansion with -LRB- ~ tN , ~ yN -RRB- and the this expansion with -LRB- tN ; yN -RRB- . Thus , N 's expansion this time can not lower Q 's arrival chart prior to tN . Thus , the property has been proved . 2 Property 1 implies that whenever node N with py = yN is expanded , we may be tightening -LRB- i.e. , lowering -RRB- the portions of other arrival charts higher than y = yN , while leaving the part lower than y = yN intact . Thus , functions LE and CrossPoint in TDS need only be applied to the portion whose y is greater than yN . It follows from Property 1 that the value of py can only increase -LRB- except for tie cases -RRB- , that is , cy in line 4 of TDS is nondecreasing , whereas ct can decrease -LRB- see Fig. 5a and Fig. 7b in which ct decreased from 4 to 3 -RRB- . Due to Property 1 , once cy is set at line 4 of TDS , the portions of arrival charts below cy -LRB- for all nodes -RRB- will remain unchanged for the rest of the execution of the algorithm . This indicates that for the portion below y = cy , shortest paths have been computed to all the nodes at that point when cy is set . Since cy is nondecreasing , TDS terminates when cy reaches its predefined limit or OPEN becomes empty . Thus , we have the following result . Property 2 . Upon termination of TDS , we have computed optimal paths to nodes in CLOSED and OPEN -LRB- i -RRB- for all start times -LRB- when TDS terminates with empty OPEN -RRB- or -LRB- ii -RRB- upto y = cy -LRB- when TDS terminates with cy > YMAX -RRB- . Unlike most best-first search algorithms , it is better not to terminate the algorithm -LRB- unless so desired -RRB- when the goal node is expanded for the first time , as it does not contain much information as to how topological shortest paths change over time . If we were to obtain topologically different optimal paths over a range of start times , it would make more sense to terminate the procedure when pt or py reaches some predefined limit . Now we turn our attention to the number of node expansions as compared to atemporal graph search . Assume that we somehow know ahead of time that there are a total of n topological shortest paths with start times in -LSB- T0 ; T1 -RSB- , -LSB- T1 ; T2 -RSB- , ? ? ? , -LSB- Tn ? 1 , 1 -RRB- . Assume further that we do not know actual optimal paths for the intervals . Then , we can run the conventional best-first algorithm n times on the graph with fixed start times ti = Ti + Ti +1 2 -LRB- i = ; 1 ; 2 ; ? ? ? ; n ? 1 -RRB- independently to find the shortest path for each of the intervals . Let us use si -LRB- Gti -RRB- to denote the number of node expansions of the best-first search as described above with start time ti and TDS -LRB- G -RRB- be the total number of node expansions for algorithm TDS on time-dependent graph G. Property 3 . If some node N is expanded in TDS , then that node N is also expanded in some atemporal search , that is , TDS -LRB- G -RRB- < = n X i si -LRB- Gti -RRB- Proof : Let N , ~ tN , and tN as in the proof of Property 1 . When node N is expanded with pt = ~ tN , the portion N 's arrival chart in -LSB- ~ tN ; tN -RSB- becomes final -LRB- although at the time of expansion , the value of tN is not known -RRB- . In other words , we have found a shortest path from Ns to N for start times 12 in -LSB- ~ tN ; tN -RSB- . Thus , if we run a search with t = ~ tN + tN 2 as a start time , node N will be expanded . 2 Property 3 indicates that the total number of node expansions in the n atemporal searches is never fewer than the total number of node expansions in one execution of TDS . However , one expansion in TDS involves more work than an expansion in si , since operations involving functions are to be used in TDS compared to scalar additions in conventional atemporal best-first search . An expansion of node N indicates that a new topological shortest path to N has been found for some start time interval . -LRB- However , it is possible that a node with many topological paths leading to it is expanded only once . Consider an example where node N is connected only to node M that has many topological paths to it . Node N can inherit all the shortest patsh when M is expanded . -RRB- Letting ss -LRB- N -RRB- denote the number of topological shortest paths to N , we can characterize TDS -LRB- G -RRB- as follows . Property 4 . Suppose node N is expanded n times in TDS . Then , there are n topological shortest paths from Ns to N . Taking the sum over all nodes that have been visited by TDS , we have TDS -LRB- G -RRB- < = X i ss -LRB- Ni -RRB- ; where Ni 2 OPEN SCLOSED . 4 Discussions In this section , we discuss some additional features of TDS . Edge Delay . TDS uses a ` compound ' operation in function increment -LRB- that is , dM ; N -LRB- fM -LRB- t -RRB- -RRB- -RRB- . This restricts the type of delay functions which may be used in practice . For example , if dM ; N -LRB- t -RRB- is a quadratic function , then f -LRB- t -RRB- can grow to a polynomial of order more than 10 after a few iterations , which makes the CrossPoint operation quite difficult to implement . Piecewise linear functions , on the other hand , remain piecewise linear after compound operations . For this reason , approximation of delay functions by piecewise linear functions may be used where applicable . For example , the geometric TSP in a time-varying environment -LRB- as stated in Example 2 in Introduction -RRB- requires non piecewise linear delay functions for edges if the Euclidean distance is to be used , even when the motions of sites are piecewise linear in time . In our experiment , we used the L1 norm instead of L2 norm -LRB- i.e. , the Euclidean norm -RRB- to measure the time-varying distance between two sites . Figure 9 contains a sample input with eight sites -LRB- called professors in the scenario of Example 2 -RRB- , A through H. Each site has three straight motion-segments as indicated by the arrow and during each motion-segment it moves at a constant speed -LRB- one unit distance per unit time -RRB- . The traveler is to start from site A and return to A after visiting all other sites exactly once . Our algorithm indicates that minimum-delay tours are dependent on start times as follows . E F G H x A B C D 155 15 5 -15 -5 y Figure 9 : An example scene of the time-dependent TSP Start time interval shortest delay route -LSB- 0.00 . . 5.00 -RSB- : A E H D C G F B A -LSB- 5.00 . . 13.33 -RSB- : A F G B C H E D A -LSB- 13.33 . . 20.00 -RSB- : A G F D C E H B A -LSB- 20.00 . . 1 -RSB- : A H E B C F G D A For the time-dependent TSP problem as discussed above , the relaxation algorithm faces the difficulty in that it requires all the nodes of the search graph be explicitly enumerated and stored before search starts . This is quite impractical as the search space for such a problem can be quite large . Only best-first algorithms may be used which explore the search space in a incremantal fashion in as the search progresses . Search with limited space . As with conventional search algorithms , best-first algorithms may not be able to solve problems of large sizes due to memory constraints . In fact , TDS could not produce solutions for the time-varying TSP with more than several nodes because of the memory limitation . To overcome this problem , search methods with limited space have been investigated by a number of researchers -LSB- 8 , 4 , 14 -RSB- . Some of the ideas are adaptable to TDS . For example , the iterative-deepening scheme may be applied by using cy as the cutoff value in depth-first search . After a number of paths to Ng are found , the lower envelope of their arrival charts are taken to obtain the arrival chart for Ng . Heuristics . So far we have not used heuristic functions in our search . We could incorporate a heuristic function hN -LRB- t -RRB- . In evaluating node N 's priority for expansion , fN -LRB- t -RRB- = gN -LRB- t -RRB- + hN -LRB- gN -LRB- t -RRB- -RRB- can be used , where gN -LRB- t -RRB- is the cost to N so far -LRB- i.e. , earliest time to reach node N starting from Ns at time t -RRB- and hN -LRB- t -RRB- is expected time to completion , i.e. , the expected remaining time to goal Ng starting from N at t . Some properties described in Section 3 need revision . For example , when TDS terminates with cy > YMAX , some paths found so far to node N may not necessarily be shortest paths to N . Ishida and Korf -LSB- 6 -RSB- have studied a real time search algorithm under the assumption that heuristic values can change over time due to a moving target point . Our algorithm is not a real time algorithm in the sense that time-varying heuristic functions as well as cost functions are assumed to be known before search starts . 5 Concluding Remarks We have considered the problem of search in temporal domains . Time-dependent graphs are suitable structures for handling some types of problems involving time-varying factors such as path planning and scheduling problems . We have discussed a method for generating the mapping between start times and topological shortest paths . This has been achieved by generalizing the best-first search method to dealing with time-varying graphs . A few observations have been made as to the number of node expanded by the algorithm . In this paper , we only discussed delay as the edge cost . We could associate a secondary timevarying metric to edges . For example , in the scenario of Example 2 , one could ask for a minimumlength tour -LRB- as opposed to a minimum-delay tour -RRB- . Furthermore , we could permit node failure -LRB- once node fails , the node can no longer be visited at all -RRB- to generalize the problem . In the scenario of Example 2 , this implies that some professor may become unavailable forever after a certain time , the traveler must finish his tour before a certain time to catch his plane , etc. . In such a case , obtaining a minimum-time tour becomes important even if minimum-length tour is the primary objective , namely , multiobjective search techniques are to be considered . Also , we could use a secondary parameter to determine edge delay . For example in the example of time-dependent TSP , we can use the traveler 's speed v in addition to start time t as a parameter to define di ; j -LRB- t ; v -RRB- , i.e. , if the traveler leaves node Ni at time t and walks at speed v , then he reaches node Nj at time t + di : j -LRB- t -RRB- . Here , v can be related a secondary cost of how much the traveller can dispense his energy to complete his tour . We leave such mutlidimensional search problems as our future work . References -LSB- 1 -RSB- J. Allen . Maintaining knowledge about temporal intervals . Communications of the ACM , 26 -LRB- 11 -RRB- :832 -LCB- 843 , 1983 . -LSB- 2 -RSB- R. Dechter , I. Meiri , and J. Pearl . Temporal constraint networks . Artificial Intelligence , 49:61 -LCB- 95 , 1991 . -LSB- 3 -RSB- K. Fujimura and H. Samet . Planning a time-minimal motion among moving obstacles . Algorithmica , 10:41 -LCB- 63 , 1993 . -LSB- 4 -RSB- S. Ghosh , A. Mahanti , and D. Nau . Its : An efficient limited-memory heuristic tree search algorithm . In AAAI , 1994 . -LSB- 5 -RSB- J. Halpern . The shortest route with time dependent length of edges and limited delay possibilities in nodes . Zeitschrift Operations Research , 21:117 -LCB- 124 , 1977 . -LSB- 6 -RSB- T. Ishida and R. Korf . Moving target search . In AAAI , pages 204 -LCB- 210 , 1990 . -LSB- 7 -RSB- L. Kanal and V. Kumar , editors . Search in Artificial Intelligence . Springer-Verlag , 1988 . -LSB- 8 -RSB- R.E. Korf . Depth first iterative deepening : An optimal admissible tree search . Artificial Intelligence , 27:97 -LCB- 109 , 1985 . -LSB- 9 -RSB- J. Latombe . Robot Motion Planning . Kluwer Academic Pulishers , Boston , MA , 1991 . -LSB- 10 -RSB- N. Nilsson . Principles of Artificial Intelligence . Tioga Publishing , Palo Algo , CA , 1980 . -LSB- 11 -RSB- N. Nilsson . A mobile automaton : An application of artificial intelligence techniques . In AAAI , pages 509 -LCB- 520 , 1991 . -LSB- 12 -RSB- A. Orda and R. Rom . Shortest-path and minimum-delay algorithms in networks with timedependent edge-length . Journal of the ACM , 37 -LRB- 3 -RRB- :607 -LCB- 625 , July 1990 . -LSB- 13 -RSB- J. Pearl . Heuristics : Intelligent Search Strategies for Computer Problem Solving . AddisonWesley , 1984 . -LSB- 14 -RSB- U.K. Sarkar , P.P. Chakrabarti , S. Ghosh , , and S.C. De Sarkar . Reducing reexpansions in iterative deepening search by controlling cutoff bounds . Artificial Intelligence , 50 -LRB- 2 -RRB- :207 -LCB- 221 , 1991 .

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O