Fully Dynamic Contraction Hierarchies with Label Restrictions on Road Networks

In the real world, road networks with weight and label on edges can be applied in several application domains. The shortest path query with label restrictions has been receiving increasing attention recently. To efficiently answer such kind of queries, a novel index, namely Contraction Hierarchies with Label Restrictions (CHLR), is proposed in the literature. However, existing studies mainly focus on the static road networks and do not support the CHLR maintenance when the road networks are dynamically changed. Motivated by this, in this paper, we investigate the CHLR maintenance problem in dynamic road networks. We first devise a baseline approach to update CHLR by recomputing the potential affected shortcuts. However, many shortcuts recomputed in baseline do not change in fact, which leads to unnecessary overhead of the baseline. To overcome the drawbacks of baseline, we further propose a novel CHLR maintenance algorithm which can only travel little shortcuts through an update propagate chain with accuracy guarantee. Moreover, an optimization strategy is presented to further improve the efficiency of index maintenance. Considering the frequency of edge changes, we also propose a batch index maintenance algorithm to handle batch edge changes which can process a large number of edge changes at once. Furthermore, a parallel method is proposed to further accelerate calculations. Extensive and comprehensive experiments are conducted on real road networks. The experimental results demonstrate the efficiency and effectiveness of our proposed algorithms.


Introduction
Shortest path query (SPQ) in road networks is a fundamental problem in graph analysis and has been widely studied due to its applications in various fields.Recently, with the proliferation of applications, the information of road networks becomes more complex and diversified, such as edge weight (e.g., transit time, toll fee) and edge label (e.g., toll road, trucks prohibited road).Existing works mainly aim to address the SPQ with minimum weight, i.e., find the shortest path with minimum distance or toll fee between two locations [1,3,6,13,16,34].However, the label information of edges can service more personalized scenarios.For example, if the drivers do not want to pay the toll fee, all toll roads should be neglected in the route planning [5].Moreover, if a truck driver requires path service, the path returned should avoid all trucks prohibited roads [23].The SPQ with considering the label constraints has many practical applications, such as personalized location-based services [35], logistics and commercial transportation [14].[27] formalizes this problem as Label Constrained Shortest Path (LCSP) query.Formally, given a restricted label set R, LCSP query aims to find the shortest path with minimum weight avoiding the edges with labels in R. To efficiently answer the LCSP query, [27] proposes a novel index which is based on Contraction Hierarchies, namely Contraction Hierarchies with Label Restrictions (CHLR).In CHLR, a shortcut e ¼ ððu; vÞ, w, l) denotes a path from u to v with weight w and label l.By shortening the path traversal, CHLR can significantly improve the LCSP query processing performance.

Motivation
In the real world, road networks can be dynamically changed.For each edge, the toll fee can be changed at any time by traffic department and the transit time is timedependent due to the change of traffic conditions [25,37].Specifically, the traffic conditions can be updated by collecting the travel information of taxi-hailing app users and drivers (e.g., Didi, Uber).However, the number of app users and drivers is huge.In 2022, Didi has 15 million drivers and 493 million users [12], and Uber has 3.5 million drivers and 93 million users [10].They can generate massive updates for traffic conditions per second.Accordingly, the edge weight can be dynamically changed at a high frequency.Moreover, the label of edges can be changed as well.For example, roads can be labeled as light traffic road, medium traffic road and heavy traffic road depending on the traffic conditions which will change in real time [22].Unfortunately, most existing works for CHLR focus on static road networks and do not support the CHLR maintenance in dynamic road networks, which makes them unpractical for real applications.Motivated by this, in this paper, we study the CHLR maintenance problem in dynamic road networks.

Our Approach
To solve the CHLR maintenance problem in dynamic road networks, we first propose a Baseline approach.When an edge e o changes its weight and label, a naive approach is to find all potential affected shortcuts due to the change of e o and then recompute the affected shortcuts by invoking the existing CHLR construction algorithm [27].However, the Baseline would recompute lots of shortcuts that actually do not change, which leads to expensive overhead of Baseline.To overcome the drawbacks of Baseline, in this paper, we devise a more efficient CHLR maintenance algorithm.Specifically, we design a novel update propagate chain to avoid massive invalid updates in Baseline.In the update propagate chain, the neighborhood of shortcuts are defined as parents, child and partner.We observe that a shortcut only affects its child, and the weight of child can be obtained by its parents.We give an update order for the update propagate chain following the observation.Moreover, to further improve the efficiency, we propose an optimization strategy based on weight count of shortcuts, which can guarantee that shortcuts will only be recomputed when necessary.We prove that the optimized algorithm has a tightly theoretical boundedness in terms of the number of changed shortcuts E D , i.e., , where d max is the maximum degree.
In real applications, the travel platforms, like Didi and Uber, need to update their map service in a real-time fashion.As mentioned before, they update their traffic conditions based on the navigation data collected from app users and drivers who complete 30 million trips per day on average in Didi [12].Similarly, more than 16 million trips are completed in Uber per day [10].The navigation data further invoke the map service update.Faced with the massive updating requirements, a naive idea is to process them edge by edge.In this way, one shortcut may be updated multiple times due to different edge changes, which will lead to unnecessary time cost.Motivated by it, we further propose a batch index maintenance algorithm to process them batch by batch instead of one by one.We build the hierarchy of shortcuts by splitting shortcuts into multiple layers and prove that the shortcut updates on the same layer are independent.Hence, a parallel method is further proposed to process the edges on the same layer in parallel, which can accelerate calculations effectively.

Contributions
This paper has the following contributions.We also evaluate the efficiency of our batch index maintenance algorithm and parallel method.
2 Related Work

Shortest Path Query in General Graphs
Graph analysis has been receiving increasing attention recently [7-9, 21, 32, 38].Shortest path query in general graphs is an important problem in graph analysis [17,26,29,30,33,40]. [29] computes the shortest path graph with exactly all shortest paths for any pair of vertices.[40] proposes a disk-based index that supports both single source distance queries and single source shortest path queries with small I/O and CPU costs.Both [26] and [30] provide parallel method to speed up shortest paths counting.[33] focuses on the constrained shortest path(CSP) query over a large time-dependent graph with time function and weight function on each edge.However, none of the above works consider the label information on edges, like toll road and trucks prohibited road, which are also important to help discover more personalized shortest paths.Considering the label information of edges, [17] studies the edge-constrained shortest path (ECSP) query problem where the target is to find a shortest path after filtering some edges based on user-specified query labels.

Shortest Path Indexes in Road Networks
In the literature, many shortest path query (SPQ) algorithms are proposed based on traditional methods, such as Dijkstra [13]; they compute the shortest path on weighted road networks directly.Recently, many index-based SPQ algorithms are proposed achieving remarkable results on speeding up the query process.Hub Labeling (HL) [1,3,18] is one of the most important shortest path indexes, which can improve the efficiency of SPQ by reducing the points on the shortest path.Pruned Landmark Labeling (PLL) [2] and Parallel Shortest-distance Labeling (PSL) [19] are further proposed based on HL.Arterial Hierarchy (AH) [39] index can improve the query time efficiently by splitting a graph into grid structure.Contraction Hierarchies (CH) [4,11,16] is a fundamental index that can reduce the number of iterations during the SPQ process by introducing shortcuts.Moreover, Hierarchical 2-Hop Labeling (H2H) [24] and P2H [6] combine the advantages of 2-hop labeling and hierarchy among all vertices.[27] studies the Label Constraint Shortest Path (LCSP) query problem in labeled and weighted road networks which can explore the shortest path P R s;t between two query vertices and avoid labels in R. Based on CH, [27] proposes an important shortest path index under the label restrictions (CHLR).In CHLR, there are a series of shortcuts e ¼ ððu; vÞ; w; lÞ, the shortcuts can build bridges among vertices to speed up the shortest path search process.Based on CHLR, the shortest path P R s;t can be found faster than online search.[27] also proposes an efficient CHLR construction algorithm.[20,31] experimentally investigate the performance of different SPQ algorithms in multiple dimensions.In the above literature, most of them focus on the shortest path query on static road networks.However, in real world, the road networks can be constantly changed.Therefore, it is necessary to study the method of maintaining the shortest path index in dynamic road networks.

Shortest Path Index Maintenance in Dynamic Road Networks
In real world, road networks often change in practice.Hence, it is necessary to study the maintenance of shortest path indexes.[36] gives a solution for maintaining HL index in dynamic road networks.[6] introduces mechanisms for P2H index maintenance for edge weight updating.In order to maintain CH index, a number of methods [25] are proposed.Moreover, for the theoretical boundedness of the dynamic maintenance of CH and H2H, [37] presents the theoretical analysis according to the weight increase and decrease scenario separately.However, most of the existing works on dynamically maintaining shortest path indexes focus on the scenario with edge weight change.But the labels of the edges in road networks will be changed as well.To the best of our knowledge, for the important shortest path index CHLR, the corresponding index maintenance method is still to be investigated, which is studied in this paper.
The label of path is denoted as The order of P is the minimum order of vertices in the path, denoted as /ðPÞ.For simplicity, G is denoted as G ¼ ðV; EÞ if the context is self-evident.Note that the approach proposed in this paper can be smoothly adapted to undirected road networks as an undirected edge can be considered as two directed edges.The descriptions for the symbols and notations used in the paper are shown in Table 1.
Given a road network G ¼ ðV; EÞ, a restricted label set R and two vertices s and t, the LCSP under restricted labels R from s to t is a path P R s;t ¼ fe 1 ; e 2 ; . ..; e k g, such that (1) for , the path avoids all restricted labels in R; (2) wðP R s;t Þ is minimum, i.e., P R s;t is the shortest path satisfying condition (1).

Contraction Hierarchies with Label Restrictions
To address LCSP query efficiently, [27] Þ if there is no path P 0 shorter than P ¼ fe 0 ; e 00 g satisfying /ðP 0 Þ [ /ðPÞ and l ðP 0 Þ l ðPÞ.The CHLR index on G is the set of shortcuts, denoted as E 0 .The road network with CHLR is called augmented graph, denoted as Note that e can represent a shortcut or an original edge depending on the context.To distinguish them, since a shortcut e ¼ ððu; vÞ; w; lÞ may also be an original edge in G, the 'edge' is only be used to denote the original edge in G.Moreover, e can be simplified as e ¼ ðu; vÞ when the context is self-evident.
Example 2 Considering the road network G in Fig. 1a, the order of each vertex is marked close the vertex.The CHLR index on G is shown in Fig. 1b, which is represented in blue dotted lines.For instance, shortcut e 0 ¼ ððv and there is no path P 0 from Table 1 The list of symbols and notations

G
The road network

CHLR-based LCSP Query
Given a road network G, and G 0 with CHLR, to address a LCSP query for P R s;t , the result can be retrieved by using a bidirectional Dijkstra query variant which performs a simultaneous forward query from s in upward graph G 0" and backward query from t in the downward graph G 0# , where EðG 0" Þ ¼ fe ¼ ðu; vÞj/ðuÞ\/ðvÞ ^l ðeÞ \ R ¼ ;g and EðG 0# Þ ¼ fe ¼ ðu; vÞj/ðuÞ [ /ðvÞ ^l ðeÞ \ R ¼ ;g.The query terminates once the minimum key for the priority queue of Dijkstra's algorithm exceeds the tentative shortest distance and P R s;t on G is obtained.

CHLR Construction
Given a road network G and a vertex order function /, CHLR can be constructed through contracting vertices in the increasing order of /.When contracting a vertex q, based on Definition and l ðP 0 Þ l ðPÞ, e is unnecessary and can be omitted in G 0 .Otherwise, e is created as a shortcut and inserted into G 0 .P 0 can be retrieved by Dijkstra's algorithm from u to v through vertices with higher order than q and edges with labels in l ðPÞ.When all vertices are contracted, all shortcuts in CHLR are obtained.

Problem Statement
In this paper, we investigate the CHLR maintenance problem on dynamic road networks.Given a road network G and edge change including weight increase/ decrease and label change, we incrementally update the CHLR index on G after the edge change.

Baseline Approach
To address the CHLR maintenance problem, in this section, we first explore a Baseline approach.Considering a changed edge e ¼ ðq; vÞ with new weight or label, the main idea of Baseline is to explore the affected shortcuts and recompute the affected shortcuts.There are two steps: (1) Explore the affected shortcuts.Due to the change of e ¼ ðq; vÞ, assuming /ðqÞ\/ðvÞ, the shortcuts like e 0 ¼ ðu; vÞ produced by contracting q and incident to e may be changed.As e 0 can be updated by recontracting q who can produce e 0 , q is marked as the vertex to be recontracted and stored into H.Recursively, the change of e 0 may further affect more shortcuts.Similarly, the vertices supporting the affected shortcuts are stored into H. (2) Recompute the affected shortcuts.When all effected shortcuts are explored, they can be updated by recontracting the vertex in H by invoking the existing CHLR construction algorithm [27].
Example 3 Consider the road network G shown in Fig. 1a.

Drawbacks of Baseline
Unfortunately, the Baseline approach may introduce unnecessary overhead.First, the affected shortcuts explored at step 1 may do not change their weights and labels.Second, at step 2, all shortcuts incident to vertices in H will be recomputed by vertex contraction.However, most of them are unchanged in fact.All of these lead to unnecessary overhead of Baseline.

CHLR Maintenance Algorithm
In this section, we explore a new CHLR maintenance algorithm to update index more efficiently by avoiding the overhead of Baseline for unchanged shortcuts.

Framework
Considering a road network G and a changed edge e, due to the weight or label change of e, we can recursively update shortcuts in a BFS-like way.In our new CHLR maintenance algorithm, we aim to reveal an update propagate chain among shortcuts.Only when current shortcut e 0 is changed, it will extend the update propagate chain to update more shortcuts incident to e 0 .In this way, the unnecessary overhead of Baseline for updating unchanged shortcuts can be reduced sharply.
then, e 0 and e 00 are the parents of e, denoted as ðe 0 ; e 00 Þ 2 N À ðeÞ.e is the child of e 0 and e 00 , denoted as e ¼ N þ ðe 0 ; e 00 Þ. e 0 is a partner of e 00 , denoted as e 0 2 N ¼ ðe 00 Þ.
Lemma 1 Given a road network G and a shortcut e, the weight of e can be computed by where w is the weight of e in G if e is an original edge in G.

Algorithm of CalWeight
Based on Lemma 1, we first propose a weight calculation algorithm to compute the weights of shortcuts on the augmented graph G 0 , which is named CalWeight.The pseudocode is shown in Algorithm 1.Since the pseudocode is self-explanatory, we omit the detailed description for brevity.Note that cnt of Algorithm 1 can be ignored here which will be introduced later.
After obtaining the weights of shortcuts, based on Definition 2, the shortcuts with same (u, v) but different labels may conflict with each other in G 0 .For instance, there are two shortcuts e ¼ ððu; vÞ; w 1 ; fa; bgÞ and e 0 ¼ ððu; vÞ; w 2 , fa; b; cgÞ, w 1 \w 2 .Then, for any LCSP query with restricted label set R, if the target P R s;t passes through u and v, e has higher priority than e 0 and P R s;t will never pass through e 0 .It's because e 0 has heavier weight and stricter label constraint than e.To distinguish the conflict relationship, we propose the formal definition of shortcut dominance below.Definition 4 (Shortcut Dominance) Given a road network G and CHLR on G, considering two shortcuts e and e 0 for vertices u and v with different weights or labels, if wðeÞ wðe 0 Þ and l ðeÞ & l ðe 0 Þ, then e dominates e 0 , e 0 is dominated by e. UðeÞ is the dominant shortcut set of e, e 0 2 UðeÞ.
Lemma 2 Given a road network G and CHLR on G, considering two shortcuts e and e 0 , if e dominates e 0 , then e 0 can be removed from CHLR safely.

Algorithm of KeepSCDom
Following Lemma 2, we propose a KeepSCDom algorithm to keep the shortcut dominance, the pseudocode is shown in Algorithm 2. Given a shortcut e, type is used to mark the weight increase or decrease of e, Q is a priority queue to store the changed shortcuts.Based on Definition 4, if e can be dominated by e 0 in the augmented graph G 0 , e is marked as invalid shortcut in G 0 , the weight of e is assigned as 1 (line 1-2).Otherwise, if the weight of e increases, we recompute the weight of shortcut e 0 in UðeÞ, if wðe 0 Þ\w ðeÞ, e 0 is not dominated by e anymore.In this case, e 0 becomes valid in G 0 (line 4-9).On the other hand, if the weight of e decreases, it can dominate more shortcuts who have heavier weight and longer label than e.Such dominated shortcuts become invalid in G 0 (line 10-14).Since the weights of shortcuts in line 9 and line 14 are updated, they are pushed into Q to further update more shortcuts.Now, we analyze the update propagate chain among shortcuts.
Definition 5 (Update Propagate Chain) When the weight of a shortcut e decreases or increases, e only changes its child shortcuts e 00 in N þ ðe; e 0 Þ, where e 0 is a partner of e in N ¼ ðeÞ.Specifically, -when wðeÞ decreases, update wðe 00 Þ ¼ wðeÞ þ wðe 0 Þ if wðe 00 Þ [ wðeÞ þ wðe 0 Þ; -when wðeÞ increases, recompute wðe 00 Þ.If wðe 00 Þ changes, KeepSCDom algorithm is utilized to keep the shortcut dominance and e 00 is pushed into Q to be the next shortcut of the update propagate chain.
Proof Theorem 2 holds based on two significant facts.(1) Given an updated shortcut e, e only affects its child shortcuts e 00 .The weight of e 00 can be updated following Definition 5. Specifically, if wðeÞ decreases, it only needs to determine whether e will produce a shorter path for e 00 , if so, wðe 00 Þ ¼ wðeÞ þ wðe 0 Þ.Otherwise, if wðeÞ increases, it's necessary to recompute wðe 00 Þ by invoking CalWeight.This is because due to the weight increase of e, the shortest path for e 00 may be destroyed by e and a new shortest path should be generated by other parents of e 00 .Moreover, for other shortcuts incident to e but with lower order than e, since e will only affect the shortcuts with higher order than it based on the contracting process of CHLR, they will not be affected by e. (2) For accuracy guarantee, parents shortcuts should be updated before their child shortcut.By Definition 3 and Definition 6, for shortcut e 00 ¼ N þ ðe; e 0 Þ, we have /ðeÞ\/ðe 00 Þ and /ðe 0 Þ\/ðe 00 Þ.Hence, updating the shortcut with lowest order in Q at each time ensures that their child shortcut will be updated correctly as the weights of their parents shortcuts are up to date now.In this way, CHLR can be updated correctly.h

Algorithm of CHLRMaintenance
Based on Theorem 2, we propose our CHLR maintenance algorithm, the pseudocode is shown in Algorithm 3. Given the augmented graph G 0 , a changed edge e o with new weight w n and new label l n , we first update e o and create e n with new weight and label (line 2-8).If the label of e o is changed, we compute the weight of e o with old label, if the weight increases, e o is pushed into Q with type='inc', meanwhile, if weight of e n with new label decreases, e n is pushed into Q with type='dec' (line 3-5).Otherwise, e o is pushed into Q depending on the weight increase or decrease (line 7-8).After that, the update propagate chain starts.At each time, Q selects the shortcut e with lowest order /ðeÞ to propagate update.Following the update rules in Definition 5, we update the weight of each child e 00 of e.If the weight of e increases, the weight of e 00 is recomputed by invoking CalWeight algorithm.And if wðe 00 Þ increases due to e, e 00 is pushed into Q with type='inc' and invokes KeepSCDom algorithm (line 14-18).On the other hand, if the weight of e decreases, we just update the weight of e 00 directly if wðe 00 Þ [ wðeÞ þ wðe 0 Þ.Then, e 00 is pushed into Q and invokes KeepSCDom algorithm if wðe 00 Þ decreases (line [19][20][21][22][23].When all shortcuts in Q finish their update propagation, we obtain the new CHLR on G 0 correctly.

Example 4
Considering the road network G in Fig. 1a and CHLR on G shown in Fig. 1b, the neighborhood of shortcuts is shown in Fig. 2  To further improve the efficiency of CHLR maintenance, we explore an optimization strategy based on the following observation.Reconsidering the update operation of Algorithm 3, for a shortcut e from Q, when the of a shortcut e increases, we have to recompute the weight of each child shortcut e 00 of e (line 16 of Algorithm 3) whenever wðe 00 Þ will change or not.However, if e does not support the current weight of e 00 , i.e., wðe 00 Þ\w ðeÞ þ wðe 0 Þ where e and e 0 are the parents of e 00 , wðe 00 Þ will not be affected by e.Moreover, even e and e 0 can support the current weight of e 00 , i.e., wðe 00 Þ ¼ wðeÞ þ wðe 0 Þ, if there exists another couple of parents e 1 and e 0 1 that can support wðe 00 Þ, wðe 00 Þ will not change as well.To avoid the invalid computation for weight, we propose an optimized CHLR maintenance algorithm based on weight count.We first give the definition of weight count.

Optimization Strategy
Definition 7 (Weight Count) Given a road network G and the CHLR on G, for each shortcut e in CHLR, the weight count of e is the number of parents that can support the weight of e, denoted as cntðeÞ, i.e., cntðeÞ = Note that if e is an original edge in G with weight wðeÞ, cntðeÞ is increased by one.
Lemma 3 In the update propagate chain, when the weight of a shortcut e increases, for e's each child shortcut e 00 , wðe 00 Þ will not change, the weight update for e 00 can be skipped safely.
Example 5 Considering the road network G in Fig. 1a and CHLR on G shown in Fig. 1b, Fig. 3 where E D denotes the changed shortcuts in CHLR.
Proof In CHLRMaintenance Ã algorithm, only the changed shortcuts will be pushed into the priority queue Q. Q needs to sort shortcuts based on their update order which consumes OðjE D j Á logjE D jÞ time.Moreover, when update a shortcut e ¼ ðu; vÞ in Q, if type ='dec', e can be updated in O(1) time (line 22 of Algorithm 4), otherwise, if cntðeÞ\1, we need to recompute the weight of e by visiting its parents which costs Oðd max Þ time.Meanwhile, to keep the shortcut dominance, in the worst case, the weights of all shortcuts incident to (u, v) should be computed (line 6 of Algorithm 2) with Oðd max Þ time.Therefore, the total time complexity of

CHLR Maintenance for Batch Update
On the real road network, the frequency of edge updates is high.Many edges may change in a very short period of time.When dealing with a large number of edge updates, a naive idea is to process them edge by edge through invoking CHLRMaintenance Ã algorithm.In this way, one shortcut may be updated multiple times due to different edge changes, which will lead to unnecessary time cost.Motivated by it, in this section, we propose a CHLR batch maintenance algorithm for batch update.The main thought is that build the hierarchy of edges/shortcuts by splitting them into multiple layers and update shortcuts in a bottom-up manner.Following the thought, all shortcuts will be only updated once when necessary.We first define the layer of edges as follows.
Definition 8 (Layer of Shortcut) Given a road network G 0 with CHLR, each shortcut e in G 0 , the layer number of e is denoted as Lay(e).LayðeÞ ¼ 1 if the child set of e is empty, otherwise LayðeÞ ¼ maxfLayðe 0 Þg þ 1, where e 0 is a child of e.
Example 6 For the road network G in Fig. 1a and the CHLR of G in Fig. 1b, Fig. 3 gives the neighborhood of shortcuts.By Definition 8, we find that shortcut ðð11; 9Þ; 7; fa; bgÞ has no child, so its layer is 1, and the layer number of its parent ðð8; 9Þ; 2; fagÞ is the maximum number of layers of all children plus 1, which is 2.
Lemma 4 For each shortcut layer l, shortcuts update on l only affect the shortcuts on the upper layers and have no effect on the shortcuts on the lower layers.
Proof For each shortcut e, e 0 and e 00 are the parents of e.Based on Lemma 1, e will be only affected by its parents e 0 and e 00 .By Definition 8, the layer of e is upper than that of e 0 and e 00 .Hence, the lemma holds.h Lemma 5 Update shortcuts from lower layer to upper layer in a bottom-up manner, the correctness of this approach can be guaranteed.
Proof Reconsidering the update process of CHLRMaintenance Ã algorithm, when each update is propagated, for each shortcut e, it must wait for all its parents to be updated before getting its new value.Based on Definition 8, all parents of e are on the lower layers; when update e, all its parents have already been updated.Hence, the correctness of our bottom-up approach can be guaranteed.h Fig. 3 Example for update process of CHLRMaintenance Ã algorithm 6.1 Algorithm CHLRMaintenance * -Batch Following Lemma 5, given a set of changed edges U, we propose our batch index maintenance algorithm CHLRMaintenance Ã -Batch.The pseudocode is shown in Algorithm 5. A bucket array B is used to store the shortcuts with different layers and initialized as ; (line 1).Similar to Algorithm 4, we first update edges in U one by one (lines 2-11).Then, we process the shortcuts on the bucket corresponding to the largest layer first (line 12).For each shortcut e that has changed, the same update propagate chain is used; e's child e 00 to be updated is deposited into B½Layðe 00 Þ (lines 15-27).Following Lemma 4, after a layer has been processed, the layer is processed (line 28).When all layers are processed, the CHLR index is updated correctly.

Vertex/Edge Deletion or Insertion
In this paper, we focus on the CHLR index maintenance for edge changes.However, our algorithms can also address the index maintenance for vertex/edge deletion or insertion.Specifically, when a new vertex v is inserted, we assign o max ?1 to v as its order where o max is the largest order in G.Then, deleting/inserting a vertex is equivalent to deleting/inserting a series of edges, so we can just focus on the deleting/inserting edge scenario.When an edge e 1 is deleted, it is equivalent to the weight of that edge being increased to infinity.Hence, the input of our Algorithm 5 is where w o is e 1 's old weight and l o is the label of e 1 .Then, our algorithm can update the index correctly.When an edge e 2 is inserted with weight w n , it is equivalent to the weight of that edge being decreased from infinity to w n .Hence, we can update our index by invoking Algorithm 5 with U ¼ fe 2 ¼ ððu 2 ; v 2 Þ; 1; l n ; w n ; l n Þg where l n is the label of e 2 .

Parallel Method
To further improve the efficiency of index maintenance, we propose a parallel method to update shortcuts in parallel based on the following lemma.
Lemma 6 For each shortcut e with layer l, updating e does not affect other shortcuts on the l-layer.
Proof A shortcut change only affects its descendants via its children.When two shortcuts belong to the same layer, by Definition 8, they are not each other's child or descendant, so they do not affect each other.h Based on Lemma 6, the order of updates within the same layer can be arbitrary.According to our batch index maintenance algorithm, combined with Lemma 6, they provide an opportunity to process shortcuts at the same layer in parallel.In this way, the efficiency of maintaining index can be obviously improved through distributing the processing of shortcuts on the same layer to multiple threads, and the specific implementation is given below.
We use OpenMP 1 for parallel computing.OpenMP is a multi-threaded programming solution for shared memory parallel systems.Serial code can be easily transformed into parallel execution with OpenMP.By simply adding #pragma instructions to the code, programs can be automatically processed in parallel, which greatly reduces the difficulty and complexity of parallel programming.Therefore, we rely on OpenMP to process updates of shortcuts within the same layer in parallel.Specifically, in Algorithm 5, the for loop starting at line 14 is used to process the updates of the shortcuts in the bucket with layer i, so the for loop can be run in parallel.Openmp parallel for assigns the computation load for different shortcuts on the same layer to multiple threads to achieve our parallel method for batch update.

Datasets
We evaluate our algorithms on 8 real road networks, in which the weight of edges is the length of each road and the label shows the category of different roads.The datasets are downloaded from DIMACS. 2 Table 2 gives the statistic of datasets, where jRj is the number of labels and d max represents the maximum degree of vertices in the corresponding augmented graphs.All the experiments are conducted on a machine with Xeon(R) Gold 6258R CPU 2.70GHz and 1TB RAM running Linux.The core number of CPUs is 32.
For the vertex order in the road networks, we generate vertex order following the method used in [16,27] with the same setting.

Exp-1: Efficiency of Algorithms When
Varying the Percent of Weight Decrease/ Increase In this experiment, we evaluate the efficiency of Baseline, CHLRM and CHLRM Ã with varying the percent of weight decrease/increase on all datasets.On each dataset, we randomly select 1000 edges as changed edges.We use W o to denote the original weights of the changed edges.We first change edges' labels and decrease their weights as 20%w o À 80%W o .The running time of three algorithms with different percent of weight decrease is recorded in Fig. 5.Then, we increase their weights as 120%W o À 200%w o .The corresponding running time is shown in Fig. 6.On all datasets, CHLRM Ã and CHLRM can achieve up to 2 orders of magnitude speedup compared with Baseline.It's because that Baseline often performs the update for edges whose weights are not changed, which leads to unnecessary overhead of Baseline.However, our CHLRM Ã and CHLRM can avoid the unnecessary overhead by a novel update propagate chain, in which only the changed shortcuts can further affect other shortcuts.For the efficiency of algorithms when varying the percent of weight increase, Fig. 6 shows similar phenomena with Fig. 5. CHLRM Ã is fastest among three algorithms.Furthermore, CHLRM Ã outperforms CHLRM on all datasets.It's because CHLRM Ã utilizes the optimization strategy based on weight count, which can further avoid the invalid update.Moreover, the running time of algorithms changed with varying the percent of weight decrease/increase is inapparent, which demonstrates our algorithms have good scalability with the percent of weight change.

Exp-2: Efficiency of Algorithms When Varying the Number of Changed Edges
In this experiment, we compare the efficiency of Rebuild, Baseline, CHLRM and CHLRM Ã algorithms with changing 0:1%jEj À 100%jEj edges.The results are shown in Fig. 7.
As shown in Fig. 7, since Rebuild is the method to rebuild the CHLR index which directly reconstructs the index, the number of changed edges has negligible effect on the running time of Rebuild, the running time of

Exp-3: Effectiveness of CHLR Maintenance Algorithms
In this experiment, we evaluate the effectiveness of different algorithms by comparing the hit rate of them.The hit rate is denoted as jE D j jE U j , where E D denotes the shortcuts whose weights are changed and E U denotes the shortcuts recomputed by algorithms.
As shown in Fig. 8, with the increasing of the number of changed edges, the hit rate of three algorithms increases as well because more shortcuts will be further changed.Besides, CHLRM performs better than Baseline, CHLRM Ã achieves the highest hit rate among them on all update cases.It verifies that our CHLRM can avoid the unnecessary update compared with Baseline, and CHLRM Ã can further reduce the invalid update benefitted from the optimization strategy, which also confirms the reasons for the efficiency of our optimized algorithm at Exp-1 and Exp-2.

Exp-4: Efficiency of CHLRM * -B Algorithm for Batch Update
In this experiment, we compare the running time between CHLRM Ã algorithm and CHLRM Ã -B algorithm with changing 0:1%jEj À 100%jEj edges.Figure 9 shows the results.
As shown in Fig. 9, CHLRM Ã -B algorithm outperforms CHLRM Ã algorithm on all datasets.It's because CHLRM Ã algorithm may update the shortcuts on the same layer multiple times due to different edge changes, which will introduce unnecessary time overhead.Meanwhile, the advantage of CHLRM Ã -B is that the shortcuts are updated layer by layer, avoiding processing the same shortcut multiple times, which improves the efficiency of index maintenance.The running time gap between CHLRM Ã and CHLRM Ã -B increases as the number of changed edges ranges from 0.1 to 10%.But when the number of changed edges is more than 10%, the running time gap may decrease such as Fig. 9c.This is because as the number of edges in the batch increases, the number of updated shortcuts also increases, which weakens the advantages of  In this experiment, we compare the speedup with different numbers of threads when running the parallel version of CHLRM Ã -B.We record the speedup of running time compared with single thread with varying the number of threads.The results are shown in Fig. 10.By observing the results, it demonstrates that the speedup of our proposed parallel method increases as the number of threads increases.It's because that, benefited from our parallel method, the edges from the same layer can be updated in parallel.And, more threads will provide higher computational efficiency.

Conclusion
In this paper, we propose a novel CHLR maintenance algorithm, in which an update propagate chain is designed to propagate the shortcuts whose weights are actually changed without losing the accuracy guarantee.Moreover, an optimization strategy is presented to make sure that shortcuts are updated when necessary, it can further improve the efficiency of index maintenance.Considering the frequency of edge changes, we also propose a batch index maintenance algorithm to handle batch edge changes.Furthermore, a parallel method is proposed to further accelerate calculations.Extensive and comprehensive experiments are conducted on real road networks.The experimental results demonstrate the efficiency and effectiveness of our optimized algorithms which can achieve up to 2 orders of magnitude speedup compared with Baseline.
We also evaluate the efficiency of our batch index maintenance algorithm and parallel method.

wFig. 1
Fig. 1 An example for road network G and CHLR on G

Fig. 2
Fig. 2 Example for update process of CHLRMaintenance algorithm

Fig. 5 Fig. 6
Fig. 5 Running time of different algorithms varying the percent of weight decrease

Fig. 7 Fig. 8
Fig. 7 Running time of different algorithms varying the number of changed edges

Fig. 9
Fig. 9 Running time of CHLRM Ã and CHLRM Ã -B varying the number of changed edges

Fig. 10
Fig.10The speedup with the increasing thread number for parallel method Extensive experiments on the real road networks.We conduct extensive and comprehensive experiments on real road networks.As shown in our experiments, the optimized CHLR maintenance algorithm has good efficiency and effectiveness.It can achieve up to 2 orders of magnitude speedup compared with Baseline.
1.The first work for CHLR maintenance in dynamic road networks.In this paper, we aim to incrementally maintain the CHLR when the road networks are dynamically changed.To the best of our knowledge, this is the first work to address the CHLR maintenance problem in dynamic road networks.2. Efficient CHLR maintenance algorithms.In this paper, we devise an efficient CHLR maintenance algorithm.shortcuts and updating shortcuts layer by layer in a bottom-up manner.We also show that shortcut changes within the same layer do not affect each other; thus, a parallel method is proposed to further improve the efficiency.4.
proposes a novel shortest path index based on Contraction Hierarchies (CH) with label restrictions.
For shortcut e n , if wðe n Þ ¼ w n , we increase cntðe n Þ by one (line 4).Besides, if wðe n Þ decreases due to w n , cntðe n Þ is assigned as 1 and e n is pushed into Q with type ='dec' (line 5).On the other hand, if the label of e n is unchanged, cntðe o Þ can be updated similarly depending on the change of wðe o Þ (line 7-10).After that, the update propagate chain starts from the shortcuts in Q.At each time, Q selects the shortcut e with lowest order /ðeÞ to propagate update.If e will increase its weight, for each child shortcut e 00 , e 00 ¼ N þ ðe; e 0 Þ, based on CHLRMaintenance * Following Lemma 3, we devise our optimized algorithm CHLRMaintenance Ã .The pseudocode is shown in Algorithm 4. Given the augmented graph G 0 , a changed edge e o , new weight w n and new label l n for e o , we first update the weight count cnt for e o and e n .The weight wðe o Þ is destroyed, cntðe o Þ is assigned as 0 and e o is pushed into Q with type ='inc' (line 3).
shows the update process of Algorithm 4. Given the same updated edge e o ¼ ððv 4 ; v 6 Þ; 5; fbgÞ, and new weight 7 and new label fcg for e o , when process the child shortcuts of e o , compared with Algorithm 3, the update operation for e 1 ¼ ððv 5 ; v 6 Þ; 7; fbgÞ is skipped as cntðe 1 Þ ¼ 2, Algorithm 4 just needs to decrease cntðe 1 Þ by 1.Hence, Algorithm 4 can improve the efficiency of CHLR maintenance.Theorem 3 Given a road network G and a changed edge e, the time complexity of CHLRMaintenance Ã algorithm to update CHLR index is OðjE D

Table 2
Statistic of the realRebuild is nearly unchanged.And the running time of Baseline increases when the number of changed edges increases.It's because more shortcuts need to be updated.Moreover,CHLRM and CHLRM Ã are always faster than Baseline.Compared with Rebuild, CHLRM and CHLRM Ã spend less time updating the CHLR when 10% edges change.Meanwhile, when 100% edges are changed, the running time of CHLRM and CHLRM Ã is near to the time of rebuilding the CHLR by Rebuild algorithm.The experiment results indicate the significant efficiency of our CHLRM and CHLRM Ã algorithm.