3.2. clean Phase
Given an arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$ that undergoes a decremental update, the clean phase aims at performing a more efficient regarding bidir–2hc, removal of outdated labels, by finding and removing all and only outdated label entries (from now on simply referred to as outdated entries) from the labeling, i.e., by avoiding to remove any correct entry. This is obtained by scanning the labels of vertices that are actually subject to entry removals and, contextually, by identifying pairs of vertices that might remain "uncovered" (i.e., without an hub in the labeling) after the removal of the mentioned incorrect label entries. This last identification step is necessary to test that the cover property for the new graph efficiently, in a next phase. The two purposes above are achieved, in detail, by:
determining two sets of vertices, named forward invalid hubs and backward invalid hubs, respectively, that are hubs for some pair in G but might stop being hubs in ${\mathsf{G}}^{\prime}$, due to the operation on $(\mathsf{x},\mathsf{y})$, so to remove from L the incorrect entries associated with such vertices;
identifying and exploring two (virtual) subgraphs of the input graph, named forward cover graph and backward cover graph, respectively, and denoted by ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, respectively
In more details, to define our algorithm we give the following definitions.
Definition 1 (Forward Cover Graph). Given a graph $\mathsf{G}=(\mathsf{V},\mathsf{A})$, a 2hopcover labeling L of G, an arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$. The forward cover graph ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ is a subgraph of G with ${\mathsf{V}}^{\prime}$ and ${\mathsf{A}}^{\prime}$ as vertex and arc sets, respectively, as follows:
a vertex u is in ${\mathsf{V}}^{\prime}$ if $\mathsf{u}\in \mathsf{V}$ and there exist two pairs $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{y}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{y}\right)$ such that ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}+{\mathsf{\delta}}_{\mathsf{h}\mathsf{y}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$ (that is a shortest path from u to y includes $(\mathsf{x},\mathsf{y})$ and h is a hub vertex for pair $\mathsf{u},\mathsf{y}$);
an arc $(\mathsf{u},\mathsf{v})$ is in ${\mathsf{A}}^{\prime}$ if $(\mathsf{u},\mathsf{v})\in \mathsf{A}$ and $\mathsf{u},\mathsf{v}\in {\mathsf{V}}^{\prime}$ (hence ${\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{y})=\mathsf{w}(\mathsf{u},\mathsf{v})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$).
In other words, vertices of the forward cover graph are those with, in G, a shortest path toward y that might contain arc
$(\mathsf{x},\mathsf{y})$ and hence whose distance toward y might change as a consequence of a decremental operation occurring on
$(\mathsf{x},\mathsf{y})$. Please note that whether the distance toward y changes or not depends on the number of shortest paths from the vertex to y that are in the graph, and on the vertex ordering (see
Figure 3a for a graphical example of two different vertices of the forward cover graph). Note also that the arcs of such graph are the arcs of a shortestpath arborescence of G rooted at x plus arc
$(\mathsf{x},\mathsf{y})$. Symmetrically, we define a backward version of the cover graph as follows.
Definition 2 (Backward Cover Graph). Given a graph $\mathsf{G}=(\mathsf{V},\mathsf{A})$, a 2hopcover labeling L of G and an arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$. The backward cover graph ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ is a subgraph of G with ${\mathsf{V}}^{\prime}$ and ${\mathsf{A}}^{\prime}$ as vertex and arc sets, respectively, as follows:
a vertex u is in ${\mathsf{V}}^{\prime}$ if $\mathsf{u}\in \mathsf{V}$ and there exist two pairs $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{x}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{x}\right)$ and $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ such that ${\mathsf{\delta}}_{\mathsf{x}\mathsf{h}}+{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{v})=\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{v})$ (that is a shortest path from x to u includes $(\mathsf{x},\mathsf{y})$ and h is a hub vertex for pair $\mathsf{x},\mathsf{v}$);
an arc $(\mathsf{u},\mathsf{v})$ is in ${\mathsf{A}}^{\prime}$ if $(\mathsf{u},\mathsf{v})\in \mathsf{A}$ and $\mathsf{u},\mathsf{v}\in {\mathsf{V}}^{\prime}$ (hence ${\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{v})=\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{u})+\mathsf{w}(\mathsf{u},\mathsf{v})$).
In other words, analogously to the forward case, vertices of the backward cover graph are those having, in G, a shortest path from x that might contain arc
$(\mathsf{x},\mathsf{y})$ and hence whose distance from x might change as a consequence of a decremental operation occurring on
$(\mathsf{x},\mathsf{y})$. Please note that again whether the distance from x changes or not depends on the number of shortest paths from the vertex from x that are in the graph, and on the vertex ordering. Note also that the arcs of such graph are the arcs of a shortestpath arborescence of
${\mathsf{G}}^{\mathsf{T}}$ rooted at y plus arc
$(\mathsf{x},\mathsf{y})$ (a toy example of the structure of cover graphs for a given input graph is shown in
Figure 3b).
Finally, we define the set of forward invalid hubs ${\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})\subseteq \mathsf{V}$ (backward invalid hubs ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})\subseteq \mathsf{V}$, respectively) of $(\mathsf{x},\mathsf{y})$ as follows.
Definition 3 (Forward Invalid Hubs).
Given a graph $\mathsf{G}=(\mathsf{V},\mathsf{A})$, a 2
hop
cover labeling L
of G
and an arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$. Then, the set of forward invalid hubs ${\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$ of $(\mathsf{x},\mathsf{y})$ is defined as: Similarly, we give a backward version.
Definition 4 (Backward Invalid Hubs).
Given a graph $\mathsf{G}=(\mathsf{V},\mathsf{A})$, a 2
hop
cover labeling L
of G
and an arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$. Then, the set of backward invalid hubs ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ of $(\mathsf{x},\mathsf{y})$ is defined as: Given the above definitions, algorithm clean’s strategy is based on the following properties. Notice that for the sake of simplicity, in what follows we use $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ or $\mathsf{v}\in {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ to denote a vertex v belonging to the vertex set of either the forward or the backward cover graph.
Property 2. Let L be a 2hopcover labeling of G. Assume arc $(\mathsf{x},\mathsf{y})$ is subject to a decremental operation and let ${\mathsf{G}}^{\prime}$ be the graph obtained by applying to G such modification. Let ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ (${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, resp.) be the forward (backward, resp.) cover graph. Then, for any vertex $\mathsf{u}\in \mathsf{V}$ such that $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ ($\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, resp.) we have that ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ (${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{u}\right)$, resp.) contains only correct entries for ${\mathsf{G}}^{\prime}$, that is for any $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ we have ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{u},\mathsf{h})$ (for any $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{u}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{u}\right)$ we have ${\mathsf{\delta}}_{\mathsf{h}\mathsf{u}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{h},\mathsf{u})={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{u})$, resp.).
Proof. By definition of forward cover graph, we know $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ implies there does not exist two pairs $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{y}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{y}\right)$ such that ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}+{\mathsf{\delta}}_{\mathsf{h}\mathsf{y}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$ for some $\mathsf{h}\in \mathsf{V}$. Observe that for any 2hopcover labeling, $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$, for some $\mathsf{h}\in \mathsf{V}$, implies $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{h}}=0)\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{h}\right)$. Now, by contradiction, assume an entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ is outdated, that is ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})\ne {\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{u},\mathsf{h})$. This implies that the only shortest path from u to y in G includes arc $(\mathsf{x},\mathsf{y})$ (since the update is decremental we have that $\mathsf{w}(\mathsf{x},\mathsf{y})$ increases) and h is a hub vertex for pair $\mathsf{u},\mathsf{h}$. Hence we would have u is in the forward cover graph since there exist pairs $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{h}}=0)\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{h}\right)$ such that ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}+{\mathsf{\delta}}_{\mathsf{h}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$, which is a contradiction. The proof for the backward version is symmetric. □
Corollary 1. For any pair $\mathsf{u},\mathsf{v}\in \mathsf{V}$ such that $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, we have that labeling L covers the pair also for ${\mathsf{G}}^{\prime}$, that is $\mathrm{Q}(\mathsf{u},\mathsf{v},\mathsf{L})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{v})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$.
Proof. Consider that for any pair $\mathsf{u},\mathsf{v}\in \mathsf{V}$, since L is a 2hopcover labeling, we have $\mathrm{Q}(\mathsf{u},\mathsf{v},\mathsf{L})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{v})$. Moreover, having $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ implies both ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and ${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ contain only correct entries for ${\mathsf{G}}^{\prime}$. Therefore $\mathrm{Q}(\mathsf{u},\mathsf{v},\mathsf{L})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{v})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$. □
Hence, regardless of the magnitude of the change on $(\mathsf{x},\mathsf{y})$, we are sure that the cover property is satisfied by L also in ${\mathsf{G}}^{\prime}$, for pairs $\mathsf{u},\mathsf{v}$ such that $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and we do not need to search for outdated entries in outgoing labels of vertices of the forward cover graph nor in incoming labels of vertices of the backward cover graph.
Now, we establish how to determine which entries are outdated in the labels of the vertices of the two cover graphs. Please note that there can be labels of vertices of the two cover graphs that do not contain outdated entries. Still, we will show it is necessary to identify such vertices since they might be interested by violations of the cover property due to the removals of the abovementioned outdated entries. This heavily depends on the structure of the shortest paths in the graph and on the effect of the decremental update on such structure, as shown in the example of
Figure 4.
Property 3. Let ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ be the forward and backward cover graphs, respectively. Let L be a wellordered 2hopcover labeling of G. Assume arc $(\mathsf{x},\mathsf{y})$ is subject to a decremental operation and let ${\mathsf{G}}^{\prime}$ be the graph obtained by applying to G such modification. Let ${\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})\subseteq \mathsf{V}$ and ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})\subseteq \mathsf{V}$ be the sets of forward and backward invalid hubs. Then:
a label entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ in the outgoing label ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ of a vertex $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ is outdated if and only if $\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ and there is no vertex $\mathsf{u}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ such that: (i) $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$; (ii) $\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$; (iii) $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$;
a label entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})$ in the incoming label ${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ of a vertex $\mathsf{v}\in {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ is outdated if and only if $\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$ and there is no vertex $\mathsf{u}\in {\mathsf{N}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ such that: (i) $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{u}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{u}\right)$; (ii) $\mathsf{w}(\mathsf{u},\mathsf{v})+{\mathsf{\delta}}_{\mathsf{h}\mathsf{u}}={\mathsf{\delta}}_{\mathsf{h}\mathsf{v}}$; (iii) $\mathsf{u}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$.
Proof. We focus on case 1. The proof for case 2 is symmetric.
(⇒) First of all observe that if ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ contains an outdated label entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ then, by Lemma 2, we must have $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and hence we know that ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{h})$ and ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})\ne {\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})$, i.e., v is connected in G to y via a shortest path that includes $(\mathsf{x},\mathsf{y})$. By contradiction, we now assume that $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ is outdated but one of the two following conditions is true:
$\mathsf{h}\notin {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$;
$\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ and there is a vertex $\mathsf{u}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ such that: (i) $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$; (ii) $\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$; (iii) $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$.
Case 1. If $\mathsf{h}\notin {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$, we have that h is not a hub vertex for pair $\mathsf{x},\mathsf{h}$ in L. This implies that there exists another hub vertex ${\mathsf{h}}^{\prime}$ that covers pair $\mathsf{x},\mathsf{h}$ which in turn implies that:
either ${\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{x},{\mathsf{h}}^{\prime})+{\mathsf{d}}_{\mathsf{G}}({\mathsf{h}}^{\prime},\mathsf{h})<\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{h})$;
or ${\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{x},{\mathsf{h}}^{\prime})+{\mathsf{d}}_{\mathsf{G}}({\mathsf{h}}^{\prime},\mathsf{h})=\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{h})$ but h is not hub vertex (that is h does not belong to ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{x}\right)$) since ${\mathsf{h}}^{\prime}$ precedes both h and x in the vertex ordering (${\mathsf{h}}^{\prime}<\mathsf{h}$ and ${\mathsf{h}}^{\prime}<\mathsf{x}$) and since L is wellordered.
In both subcases we obtain a contradiction, as $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ is not outdated (the decremental operation does not change the value of ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$).
Case 2. We have that there exists a neighbor of v, namely u, that is not in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$. Hence, its outgoing label, by Property 2, does not contain any incorrect entry and we have ${\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{h})$ for any $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$. Therefore, as $(\mathsf{v},\mathsf{u})\in \mathsf{A}$ and the weight of $(\mathsf{v},\mathsf{u})$ does not change in ${\mathsf{G}}^{\prime}$, we have that ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$ and thus the label entry ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$ is not outdated, which is a contradiction.
(⇐) Again by contradiction we assume that there is a nonoutdated (correct) entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ while $\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ and there is no vertex $\mathsf{u}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ such that: (i) $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$; (ii) $\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$; (iii) $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$. Since $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ we know that ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{h})$. Now, since the entry is correct for ${\mathsf{G}}^{\prime}$, there must exist another shortest path, say P, in G that: (i) does not contain $(\mathsf{x},\mathsf{y})$ and such that $\mathsf{w}\left(\mathsf{P}\right)={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})$. Call ${\mathsf{u}}^{\prime}$ the neighbor of v on this second shortest path. Since there is no neighbor u such that $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and $\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$, it follows that $\mathsf{h}(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\notin {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left({\mathsf{u}}^{\prime}\right)$.
It follows that pair
${\mathsf{u}}^{\prime},\mathsf{h}$ is covered by some other vertex, say
${\mathsf{h}}^{\prime}$, such that
${\mathsf{h}}^{\prime}<\mathsf{h}$ and
${\mathsf{h}}^{\prime}<{\mathsf{u}}^{\prime}$. Since
$(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ we have also that h must be preceding
${\mathsf{h}}^{\prime}$ in the vertex ordering (i.e.,
$\mathsf{h}<{\mathsf{h}}^{\prime}$) as otherwise the visit rooted at h would have not reached v (it would have been pruned thanks to
${\mathsf{h}}^{\prime}$). This is a contradiction since for the pruning on P to happen
${\mathsf{h}}^{\prime}$ must precede h. An explanatory example of this scenario is shown in
Figure 5a. □
To summarize, Properties 2–3 provide a theoretical basis upon which we design an effective algorithm for removing outdated entries, and for detecting pairs of uncovered vertices in ${\mathsf{G}}^{\prime}$, as we know that: (i) to find and remove (all and only) outdated entries it suffices to scan labels ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ (${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$, resp.) of vertices $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ ($\mathsf{v}\in {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, resp.) and to search for entries in the form $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ such that $\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ ($(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})$ such that $\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$, resp.); (ii) to find pairs of vertices $\mathsf{u},\mathsf{v}$ whose cover property can be broken in ${\mathsf{G}}^{\prime}$ due to removals of outdated entries, it suffices to determine vertices of ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$,
Therefore, the strategy of algorithm clean is divided in two steps. First, it computes sets ${\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$ and ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$, according to the definition (line 3 of Algorithm 3), and then it performs two suited visits of the input graph G (Algorithms 5 and 6) with the twofold aim of identifying the vertices of the two cover graphs and removing outdated entries. These two sets are stored to evaluate, in a subsequent phase, whether the cover property in the new graph is satisfied or not.
Algorithm 3: Algorithm clean 

Specifically, each of the two visits start from the endpoints of the arc that is interested by the update (x and y, respectively), as shown in Algorithms 5 and 6, and proceed by determining vertices of the cover graphs on the basis of the corresponding conditions (see Definitions 1 and 2).
To limit the search to such vertices only, each visit employs a priority queue to drive the exploration in a shortestpath first fashion, starting from either x or y, and performs corresponding relax operations (see procedure 7 used in both Algorithms 5 and 6). This guarantees that vertices of the cover graphs are analyzed in order of distance from x or y and hence that entries are removed only if outdated.
In fact, whenever a vertex v of the forward (backward, resp.) cover graph is found, its outgoing (incoming, resp.) label is searched for entries in the form
$(\mathsf{h},\ast )$ for every
$\mathsf{h}\in {\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ (
$\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$, resp.). If any entry of this kind is present, then the algorithm determines whether the entry is correct or not for
${\mathsf{G}}^{\prime}$ by looking at the outgoing (incoming, resp.) neighbors’ labels to establish whether there exists a second shortest path in G from v to h (from h to v, resp.), which is sufficient for the label entry to be correct in
${\mathsf{G}}^{\prime}$ (see
Figure 5b).
If the search fails, then the entry is outdated and hence it is selected for removal (see line 12 of Algorithm 5 and line 12 of Algorithm 6) by adding the hub to a corresponding list (one per vertex, see line 17 of Algorithm 5 and line 17 of Algorithm 6). Otherwise, it is correct and hence it is preserved (see, e.g., line 13 of Algorithm 5). Once all vertices of the cover graphs have been found, and their label sets searched to select outdated entries, the visit terminates and both the lists of hubs corresponding to outdated entries and sets of vertices of the cover graphs are returned.
Algorithm 4: Algorithm recover 

The actual removal of outdated entries is performed then at this point, once the two visits are concluded, by sequentially scanning only the labels of vertices of the cover graphs that contain at least one outdated label entry (see lines 7–9 of Algorithm 3).
This is done for the sake of the efficiency, so to be able to test the membership of vertices of the cover graph and the presence of outdated entries in linear time, by exploiting the content of the 2hopcover labeling L of G (see, e.g., line 18 of Algorithm 5 or line 18 of Algorithm 6). The naive alternative to achieve the same purpose would be executing a traditional shortestpath algorithm (with possibly superlinear worstcase running time, e.g., Dijkstra’s).
We conclude the section by proving some results concerned with the correctness of Algorithm clean. In particular, first we show the two sets $\mathtt{OUT}$ and $\mathtt{IN}$, computed by the algorithm, are exactly the two vertex sets of ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$.
Algorithm 5: Procedure fclean 

Algorithm 6: Procedure bclean 

Algorithm 7: SubProcedure RELAX used in Procedures fclean and bclean 

Lemma 1. Let L be a minimal wellordered 2hopcover labeling of a graph G. Let us assume that an arc $(\mathsf{x},\mathsf{y})$ of G undergoes a decremental update. Let ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ (${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, resp.) be the forward (backward, resp.) cover graph. Then, if a vertex v is in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ (in ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, resp.), we have that vertex v is added to set $\mathtt{OUT}$ by Algorithm 5 (to set $\mathtt{IN}$ by Algorithm 6, resp.).
Proof. The proof is by induction on the number $\left\mathtt{Q}\right$ of $\mathtt{deleteMin}$ operations on the queue $\mathtt{Q}$. We first focus on Algorithm 5. Consider that at least one vertex is always inserted in the queue, namely x, with a priority of $\mathsf{w}(\mathsf{x},\mathsf{y})$, the weight of the arc in G. Observe that $\left\mathtt{Q}\right$ is a monotonically increasing value.
Base case ($\left\mathtt{Q}\right=1$). The only time when we have $\left\mathtt{Q}\right=1$ is when $\mathtt{Q}=\left\{\mathsf{x}\right\}$. Hence $\mathsf{v}=\mathsf{x}$ and this shows the inductive basis since, if x is in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ we have that $\{{\mathsf{h}}^{\prime}\in \mathsf{V}\phantom{\rule{3.33333pt}{0ex}}:\phantom{\rule{3.33333pt}{0ex}}{\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)\wedge {\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{y}\right),{\mathsf{\delta}}_{\mathsf{v}{\mathsf{h}}^{\prime}}+{\mathsf{\delta}}_{{\mathsf{h}}^{\prime}\mathsf{y}}=\mathsf{\delta}\}\ne \varnothing $ with $\mathsf{\delta}={\mathsf{\delta}}_{\mathsf{x}\mathsf{x}}+{\mathsf{\delta}}_{\mathsf{x}\mathsf{y}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})=\mathsf{w}(\mathsf{x},\mathsf{y})$. Therefore, the vertex is added to $\mathtt{OUT}$ by the algorithm. Please note that x is always added to $\mathtt{Q}$.
Inductive Hypothesis. We assume the claim holds when $\left\mathtt{Q}\right=\mathsf{k}$, i.e., we have k extracted vertices that are in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and have been visited by Algorithm 5.
Inductive Step. We consider the case when $\left\mathtt{Q}\right=\mathsf{k}+1$. Observe that the next extracted vertex v must be a neighbor of some vertex, say ${\mathsf{v}}^{\prime}$, processed in one of the previous k iterations, as otherwise v would not be in $\mathtt{Q}$. Moreover, ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},{\mathsf{v}}^{\prime})+{\mathsf{d}}_{\mathsf{G}}({\mathsf{v}}^{\prime},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$ as v is the one with minimum priority. Therefore, we have that, if vertex v is in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, in line 18, set $\{{\mathsf{h}}^{\prime}\in \mathsf{V}\phantom{\rule{3.33333pt}{0ex}}:\phantom{\rule{3.33333pt}{0ex}}{\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)\wedge {\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{y}\right),{\mathsf{\delta}}_{\mathsf{v}{\mathsf{h}}^{\prime}}+{\mathsf{\delta}}_{{\mathsf{h}}^{\prime}\mathsf{y}}=\mathsf{\delta}\}$ must be not empty, with $\mathsf{\delta}={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}+{\mathsf{\delta}}_{\mathsf{h}\mathsf{y}}$ for some $\mathsf{h}\in \{{\mathsf{h}}^{\prime}\in \mathsf{V}\phantom{\rule{3.33333pt}{0ex}}:\phantom{\rule{3.33333pt}{0ex}}{\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)\wedge {\mathsf{h}}^{\prime}\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{y}\right),{\mathsf{\delta}}_{\mathsf{v}{\mathsf{h}}^{\prime}}+{\mathsf{\delta}}_{{\mathsf{h}}^{\prime}\mathsf{y}}=\mathsf{\delta}\}$ (since any pair of vertices is covered by some hub h in L for G) and ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},{\mathsf{v}}^{\prime})+{\mathsf{d}}_{\mathsf{G}}({\mathsf{v}}^{\prime},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{h},\mathsf{y})$. Thus, the claim holds. □
Then, we prove that all entries left in the labeling by Algorithm clean are correct for ${\mathsf{G}}^{\prime}$.
Lemma 2. Let L be a minimal wellordered 2hopcover labeling of a graph G. Let us assume that an arc $(\mathsf{x},\mathsf{y})$ of G undergoes a decremental update and let ${\mathsf{G}}^{\prime}$ be the resulting graph. Let ${\mathsf{L}}^{\prime}$ the labeling returned by Algorithm 3. Then, for any $\mathsf{v}\in \mathsf{V}$, all entries $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}^{\prime}\left(\mathsf{v}\right)$ are correct for ${\mathsf{G}}^{\prime}$, that is ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$. Symmetrically, for any $\mathsf{v}\in \mathsf{V}$, all entries $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}^{\prime}\left(\mathsf{v}\right)$ are correct for ${\mathsf{G}}^{\prime}$, that is ${\mathsf{\delta}}_{\mathsf{h}\mathsf{v}}={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{h},\mathsf{v})$.
Proof. By contradiction, assume that there exists some entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$, for some $\mathsf{h}\in \mathsf{V}$, that does not correspond to a shortest path in ${\mathsf{G}}^{\prime}$ after executing Algorithm 3, i.e., such that ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}\ne {\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$. Since $\{\mathsf{x},\mathsf{y}\}$ undergoes a decremental update, we must have that ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}<{\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$, as otherwise a first contradiction would be reached (either a decremental update is not increasing the distance or ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$).Moreover, we know ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})$ since L is a 2hopcover labeling therefore v must be a descendant of x in a shortestpath arborescence of G rooted at h, as otherwise $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ would not be in ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$. Hence, by Lemma 1, vertex v must be in the forward cover graph ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and hence is processed by Algorithm 3 in line 19. Thus, two cases can occur: either $\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$ or not. In the former case, the label entry is removed by Algorithm clean, which is again a contradiction. In the latter case, instead, we have that the shortest path from x to h in G did not contain $(\mathsf{x},\mathsf{y})$, hence ${\mathsf{d}}_{\mathsf{G}}(\mathsf{x},\mathsf{h})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{x},\mathsf{h})$. Now, on the one hand, if the shortest path from v to h in G included $(\mathsf{x},\mathsf{y})$, we reach a contradiction. In fact, $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ is removed, since ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{y},\mathsf{h})$ and hence $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$. On the other hand, if the shortest path from v to h in G did not include $(\mathsf{x},\mathsf{y})$, we obtain the contradiction of ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}$ being correct, since $(\mathsf{x},\mathsf{y})$ not being on the shortest path from v to h implies ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$. A symmetric argument can be used to show that all entries $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ are correct, for any $\mathsf{h}\in \mathsf{V}$, by considering the shortestpath arborescence of ${\mathsf{G}}^{\mathsf{T}}$ and set ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$. □
Finally, we prove a slightly stronger property, which is the minimality of removals. Specifically, we can prove that no correct label entry is removed by Algorithm 3, i.e., the number of removals is minimal to remove all entries that do not correspond to shortest paths in ${\mathsf{G}}^{\prime}$. In what follows, given two labelings L and ${\mathsf{L}}^{\prime}$ we use $\mathsf{L}\backslash {\mathsf{L}}^{\prime}$ to denote the set of label entries that are in L but not in ${\mathsf{L}}^{\prime}$.
Lemma 3. Let L be a minimal wellordered 2hopcover labeling of a graph G. Let us assume that an arc $(\mathsf{x},\mathsf{y})$ of G undergoes a decremental update and let ${\mathsf{G}}^{\prime}$ be the resulting graph. Let ${\mathsf{L}}^{\prime}$ the labeling returned by Algorithm 3. Then, $\mathsf{L}\backslash {\mathsf{L}}^{\prime}$ does not contain any label entry that is correct for ${\mathsf{G}}^{\prime}$.
Proof. Assume by contradiction a correct label entry $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ is removed from ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$, that is $\mathsf{L}\backslash {\mathsf{L}}^{\prime}$ contains, for some $\mathsf{h}\in \mathsf{V}$, pair $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})$ and ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$. Call u the neighbor of v that induces the presence of such label entry in L which is wellordered. Clearly we have that ${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}$ and ${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})$ since there must exist a neighbor on the shortest path from v to h (which is traversed, e.g., by fs–2hc).
Now, either the shortest path P from u to h contains arc
$(\mathsf{x},\mathsf{y})$ or not. In the latter case, we have that
$\mathsf{h}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and
${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})={\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})=\mathsf{w}(\mathsf{v},\mathsf{u})+{\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{h})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{v},\mathsf{h})$. Therefore, in line 13 of Algorithm 5 the label entry is not selected for removal, which is a contradiction. In the former case, as the entry is correct for
${\mathsf{G}}^{\prime}$, there must exist another shortest path, say
${\mathsf{P}}^{\prime}$, that does not contain arc
$(\mathsf{x},\mathsf{y})$ and such that
$\mathsf{w}\left(\mathsf{P}\right)=\mathsf{w}\left({\mathsf{P}}^{\prime}\right)={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{h})$. Call
${\mathsf{u}}^{\prime}$ the neighbor of v on such path, i.e.,
${\mathsf{u}}^{\prime}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ and
${\mathsf{d}}_{\mathsf{G}}(\mathsf{v},\mathsf{h})=\mathsf{w}(\mathsf{v},{\mathsf{u}}^{\prime})+{\mathsf{d}}_{\mathsf{G}}({\mathsf{u}}^{\prime},\mathsf{h})$. Since the label entry is removed, it follows that Algorithm 5 in line 12 does not find any neighbor of
${\mathsf{u}}^{\prime}$ satisfying
${\mathsf{\delta}}_{\mathsf{v}\mathsf{h}}=\mathsf{w}(\mathsf{v},{\mathsf{u}}^{\prime})+{\mathsf{\delta}}_{{\mathsf{u}}^{\prime}\mathsf{h}}$, i.e.,
${\mathsf{u}}^{\prime}$ cannot have
$(\mathsf{h},{\mathsf{\delta}}_{{\mathsf{u}}^{\prime}\mathsf{h}})$ in
${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left({\mathsf{u}}^{\prime}\right)$. Therefore, the visit rooted at h has not reached
${\mathsf{u}}^{\prime}$ due to some pruning test. It follows that pair
${\mathsf{u}}^{\prime}\mathsf{h}$ is covered (on
${\mathsf{P}}^{\prime}$) by some other vertex, say
${\mathsf{h}}^{\prime}$, such that
${\mathsf{h}}^{\prime}<\mathsf{h}$ and
${\mathsf{h}}^{\prime}<{\mathsf{u}}^{\prime}$. Since
$(\mathsf{h},{\mathsf{\delta}}_{\mathsf{v}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ we have also that h must be preceding
${\mathsf{h}}^{\prime}$ in the vertex ordering (i.e.,
$\mathsf{h}<{\mathsf{h}}^{\prime}$) as otherwise the visit rooted at h would have not reached v (it would have been pruned thanks to
${\mathsf{h}}^{\prime}$). This is a contradiction since, for the pruning on
${\mathsf{P}}^{\prime}$ to happen, vertex
${\mathsf{h}}^{\prime}$ must precede h (an explanatory example of the scenario discussed in this proof is shown in
Figure 6a). A symmetric argument can be used to prove that no correct label entry is removed from any incoming label
${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$. □
3.3. recover Phase
The second phase of Algorithm queue–2hc, named recover, takes place after Algorithm clean is concluded and considers sets $\mathtt{OUT}$ and $\mathtt{IN}$ with the aim of restoring the (possibly broken) cover property for the new graph ${\mathsf{G}}^{\prime}$. The procedure, shown in Algorithm 4, takes as input also ${\mathsf{G}}^{\prime}$ and the labeling returned by Algorithm clean, say ${\mathsf{L}}^{\prime}$, and works by resuming a series of forward and backward shortestpath visits, each considering as root one of the vertices in sets $\mathtt{OUT}$ and $\mathtt{IN}$ (i.e., vertices of forward and backward cover graphs), in the order imposed by the vertex ordering. Please note that in the remainder of the paper, given a vertex $\mathsf{h}\in \mathsf{V}$, we denote by $\mathsf{IDX}\left(\mathsf{h}\right)$ the index of h in said ordering. Each visit, rooted at some vertex $\mathsf{h}\in \mathtt{OUT}$, has the purpose of checking whether the cover property is satisfied for pairs $\mathsf{h},\mathsf{v}$ for any other $\mathsf{v}\in \mathtt{IN}$ and, in case it is not, to restore it. This is done by visiting only the vertices and the arcs of the forward and backward cover graphs, as discussed in the following. The above is possible thanks to the following property on the labeling, holding after the execution of Algorithm clean.
Property 4. Let ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ the forward and backward cover graphs, respectively. Let ${\mathsf{L}}^{\prime}$ be the labeling returned by Algorithm 3 when applied to G, to its 2hopcover labeling L, as a consequence of a decremental update on arc $(\mathsf{x},\mathsf{y})\in \mathsf{A}$. Then, for any pair $\mathsf{u},\mathsf{v}\in \mathsf{V}$ such that $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ or $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$, we have that labeling ${\mathsf{L}}^{\prime}$ covers pair $\mathsf{u},\mathsf{v}$ also for ${\mathsf{G}}^{\prime}$, that is $\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$.
Proof. By contradiction assume for a pair $\mathsf{u},\mathsf{v}\in \mathsf{V}$ such that $\mathsf{u}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ (while v can be of any kind) we have that labeling ${\mathsf{L}}^{\prime}$ does not cover the pair for ${\mathsf{G}}^{\prime}$, i.e., $\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime})\ne {\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$ (the case when u can be of any kind while $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ is symmetric). Notice that by Lemma 2 we know that entries in ${\mathsf{L}}^{\prime}$ are all correct for ${\mathsf{G}}^{\prime}$. Now, only three cases can occur: (i) $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$; (ii) $\mathsf{v}\in {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$; (iii) $\mathsf{v}\notin {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{v}\notin {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$. Notice in fact that by the definition of cover graphs, we cannot have that $\mathsf{v}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and $\mathsf{v}\in {\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$.
Case (i). Both u and v are in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ hence we know that the shortest path in G between u and v does not contain $(\mathsf{x},\mathsf{y})$. Furthermore, it is straightforward to see that the shortest path from u to v is made of only vertices in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ (by contradiction, otherwise u cannot be in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$). Hence the hub, say h covering the pair must be in ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ as well. Therefore h is not in ${\mathtt{H}}_{\mathtt{b}}(\mathsf{x},\mathsf{y})$ thus it cannot be removed from ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ by Algorithm 5. Moreover, ${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ is not changed by Algorithm 5. Hence, we reach the contradiction of $\mathrm{Q}(\mathsf{u},\mathsf{v},\mathsf{L})=\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{v})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$.
Case (ii). We know the shortest path from x to v in G included arc $(\mathsf{x},\mathsf{y})$. We can distinguish two subcases: either the hub h covering pair $\mathsf{u},\mathsf{v}$ in G belongs to such path or not. In the former case, we have that $\mathsf{h}\in {\mathtt{H}}_{\mathtt{f}}(\mathsf{x},\mathsf{y})$ and hence also the shortest path from u to h in G must include $(\mathsf{x},\mathsf{y})$. This implies that $\mathsf{u}\in {\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ since there must exist two pairs $({\mathsf{h}}^{\prime},{\mathsf{\delta}}_{\mathsf{u}{\mathsf{h}}^{\prime}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}^{\prime}\left(\mathsf{u}\right)$ and $({\mathsf{h}}^{\prime},{\mathsf{\delta}}_{{\mathsf{h}}^{\prime}\mathsf{y}})\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}^{\prime}\left(\mathsf{y}\right)$ such that ${\mathsf{\delta}}_{\mathsf{u}{\mathsf{h}}^{\prime}}+{\mathsf{\delta}}_{{\mathsf{h}}^{\prime}\mathsf{y}}={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{y})$ and ${\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{y})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{x})+\mathsf{w}(\mathsf{x},\mathsf{y})$ (that is there must exist an ${\mathsf{h}}^{\prime}$ that is a hub vertex for pair $\mathsf{u},\mathsf{y}$) which is a contradiction. In the latter case, the shortest path from u to h in G does not include $(\mathsf{x},\mathsf{y})$ and neither the shortest path from h to v in G. Hence, by Lemma 3, correct entries $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})$ and $(\mathsf{h},{\mathsf{\delta}}_{\mathsf{h}\mathsf{v}})$ must be in ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}^{\prime}\left(\mathsf{u}\right)$ and ${\mathsf{L}}_{\mathsf{i}\mathsf{n}}^{\prime}\left(\mathsf{v}\right)$, respectively, which implies the pair is covered and the contradiction is reached.
Case (iii). As with case (i), we have that the shortest path in G between u and v does not contain $(\mathsf{x},\mathsf{y})$ and that both labels ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ and ${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ are not changed by Algorithm 5. Hence, again we have the contradiction of with $\mathrm{Q}(\mathsf{u},\mathsf{v},\mathsf{L})=\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime})={\mathsf{d}}_{\mathsf{G}}(\mathsf{u},\mathsf{v})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$. □
By Property 4 it emerges that to guarantee the property holding for
${\mathsf{G}}^{\prime}$, it suffices to restart some shortestpath visits as follows. Given a root vertex
$\mathsf{h}\in \mathtt{IN}$ (
$\mathsf{h}\in \mathtt{OUT}$), all vertices
$\mathsf{v}\in \mathtt{OUT}$ (
$\mathsf{v}\in \mathtt{IN}$, respectively) are first analyzed in order to find
viable neighbors for h. A viable neighbor
$\mathsf{u}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ (
$\mathsf{u}\in {\mathsf{N}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$, respectively) is a neighbor such that: (a)
$\mathsf{h}\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)$ (
$\mathsf{h}\in {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{u}\right)$, respectively) and (b)
$\mathsf{u}\notin \mathtt{OUT}$ (
$\mathsf{u}\notin \mathtt{IN}$, respectively). For all such neighbors, we know that after the execution of Algorithm
clean, there exists at least one shortest path from u to h (from h to u, respectively) that did not contain
$(\mathsf{x},\mathsf{y})$ in G. Clearly, there can be many viable neighbors (see
Figure 6b). Therefore, to correctly discover distances corresponding to shortest paths, the procedure selects the one with a minimum distance encoded in the label entry. In particular, if we call
$\mathtt{dmin}=\underset{\mathsf{u}\in {\mathsf{N}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right),\mathsf{u}\notin \mathtt{OUT},(\mathsf{h},{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}})\in {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{u}\right)}{min}\{{\mathsf{\delta}}_{\mathsf{u}\mathsf{h}}+\mathsf{w}(\mathsf{v},\mathsf{u})\}$ then the algorithm inserts v into a queue
Q with priority
$\mathtt{dmin}$ (see Algorithm 4). If no viable neighbor exists in
${\mathsf{G}}^{\prime}$, then the vertex is not inserted in the queue. Observe that the search for viable neighbors can be accelerated by skipping vertices according to their ordering and to the wellordered property (see lines 5–8 or lines 18–21) that guarantees that if
$\mathsf{v}<\mathsf{u}$ then
$\mathsf{u}\notin {\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$ and
$\mathsf{u}\notin {\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$.
Algorithm 8: Procedure $\mathrm{PRUNED}\mathrm{R}\mathrm{ELAX}$ used by Algorithm recover 

Once all vertices in
$\mathtt{OUT}$ (
$\mathtt{IN}$, respectively) has been treated as above, we have that
Q contains vertices in
$\mathtt{OUT}$ (
$\mathtt{IN}$, respectively) with at least one viable neighbor, i.e., connected to the vertex h under consideration through a path that is not including
$(\mathsf{x},\mathsf{y})$. If
Q is empty, it follows that no such vertices exist, and hence it is easy to see that the decremental operation must be an arc removal that has increased the number of strongly connected components of G (otherwise we would have that at least vertex x has vertex y as viable neighbor). Therefore, vertices in
$\mathtt{OUT}$ (
$\mathtt{IN}$, respectively) are not connected to (are not reachable from, respectively) h and hence the visit for h can terminate. If Q is not empty instead, the vertex v with minimum priority, say
$\mathsf{\delta}$, is extracted and, if
$\mathsf{\delta}<\mathsf{pQ}(\mathsf{v},\mathsf{h},\mathsf{L},\mathsf{IDX}(\mathsf{h}\left)\right)$ (or
$\mathsf{\delta}<\mathsf{pQ}(\mathsf{h},\mathsf{v},\mathsf{L},\mathsf{IDX}(\mathsf{h}\left)\right)$, respectively) then new label entry
$(\mathsf{h},\mathsf{\delta})$ is added to
${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{v}\right)$ (
${\mathsf{L}}_{\mathsf{i}\mathsf{n}}\left(\mathsf{v}\right)$, respectively). In particular, if the value of
$\mathsf{\delta}$ is smaller than the distance returned by
pQ, it follows that the shortest path being discovered is not encoded in the labeling, i.e., that pair
$\mathsf{v},\mathsf{h}$ is not covered by L. Please note that the pruning test considers vertices up to index
$\mathsf{IDX}\left(\mathsf{h}\right)$ in the ordering, as done by
resume–2hc to preserve minimality of the labeling (see [
8] for more details on
prefixal correctness). Now, if a new label entry is added, then only the neighbors of v that are in
$\mathtt{OUT}$ (
$\mathtt{IN}$, resp.) are scanned in a relaxation step (see Algorithm 8) to add them to the queue or to decrease their key. In fact, vertices outside
$\mathtt{OUT}$ (
$\mathtt{IN}$, resp.) by Lemma 2 already satisfy the cover property to h. The algorithm terminates when the queue is empty for all vertices in
$\mathtt{OUT}$ and
$\mathtt{IN}$. We are now ready to conclude the proof of correctness of Algorithm
queue–2hc.
Theorem 1. Let ${\mathsf{F}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ and ${\mathsf{B}}_{\mathsf{G}}^{\mathsf{L}}(\mathsf{x},\mathsf{y})$ the forward and backward cover graphs, respectively. Let ${\mathsf{L}}^{\prime \prime}$ be the labeling returned by Algorithm 4 when applied to graph ${\mathsf{G}}^{\prime}$, labeling ${\mathsf{L}}^{\prime}$ and set $\mathtt{OUT}$ and $\mathtt{IN}$, respectively. Then, ${\mathsf{L}}^{\prime \prime}$ is a minimal wellordered 2hopcover labeling that covers ${\mathsf{G}}^{\prime}$, i.e., for any pair $\mathsf{u},\mathsf{v}\in \mathsf{V}$ we have $\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime \prime})={\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})$.
Proof. First of all, observe that any pair that can have the cover property not satisfied for ${\mathsf{G}}^{\prime}$ (see Property 4) is considered by Algorithm recover, either in line 5 or in line 8.
We focus on proving the claim for all pairs $\mathsf{h},\mathsf{t}$ for a given vertex $\mathsf{h}\in \mathtt{OUT}$ (the proof for the case $\mathsf{h}\in \mathtt{IN}$ is symmetric). The proof is by induction on the number $\left\mathtt{Q}\right$ of $\mathtt{deleteMin}$ operations on the queue $\mathtt{Q}$. Observe that if $\left\mathtt{Q}\right=0$ we have that no vertex $\mathsf{t}\in \mathtt{IN}$ has at least one viable neighbor. It is easy to see that this implies none of such vertices are reachable, in ${\mathsf{G}}^{\prime}$, from h in ${\mathsf{G}}^{\prime}$. In fact, any viable neighbor, say w, is outside $\mathtt{IN}$ hence pair $\mathsf{h},\mathsf{w}$ is covered by ${\mathsf{L}}^{\prime}$ by Lemma 4. Moreover, all entries in ${\mathsf{L}}^{\prime}$ are correct. Thus, ${\mathsf{d}}_{{\mathsf{G}}^{\prime}}(\mathsf{u},\mathsf{v})=\mathrm{Q}(\mathsf{u},\mathsf{v},{\mathsf{L}}^{\prime \prime})=\infty $ and the claim holds.
Base case ($\left\mathtt{Q}\right=1$). In this case, we have that one vertex, say w, has a viable neighbor and $\mathsf{w}>\mathsf{h}$. By Lemma 2 it follows that $\mathsf{\delta}={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{w})$ and hence the cover property is tested in line 27. If $\mathsf{\delta}$ is smaller than $\mathsf{pQ}(\mathsf{h},\mathsf{w},{\mathsf{L}}^{\prime \prime},\mathsf{IDX}\left(\mathsf{h}\right)$, a label entry $(\mathsf{h},\mathsf{\delta})$ is added to ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{w}\right)$ thus the claim follows. Otherwise, we have that $\mathsf{pQ}(\mathsf{h},\mathsf{w},{\mathsf{L}}^{\prime \prime},\mathsf{IDX}\left(\mathsf{h}\right)={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{w})$ which, in turn, implies that $\mathrm{Q}(\mathsf{h},\mathsf{w},{\mathsf{L}}^{\prime \prime})={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{w})$ by the definition of pQ.
Inductive Hypothesis. We assume the claim holds when $\left\mathtt{Q}\right=\mathsf{k}$, i.e., we have $\mathrm{Q}(\mathsf{h},\mathsf{w},{\mathsf{L}}^{\prime \prime})={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{w})$ and $\mathsf{w}<\mathsf{h}$ for any vertex t among the k vertices that have been extracted up to this point.
Inductive Step. We consider the case when $\left\mathtt{Q}\right=\mathsf{k}+1$. Observe that the next extracted vertex v must be a neighbor of some vertex, say ${\mathsf{v}}^{\prime}$, processed in one of the previous k iterations, as otherwise v would not be in $\mathtt{Q}$. Therefore, we have that $\mathsf{\delta}={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{v})$, as otherwise either v would not be extracted to be the minimum, or ${\mathsf{v}}^{\prime}$ would not be among the previously extracted vertices. Therefore, two cases can occur: either $\mathsf{\delta}$ is smaller than $\mathsf{pQ}(\mathsf{h},\mathsf{v},{\mathsf{L}}^{\prime \prime},\mathsf{IDX}\left(\mathsf{h}\right)$ or not. In the former case, a label entry $(\mathsf{h},\mathsf{\delta})$ is added to ${\mathsf{L}}_{\mathsf{o}\mathsf{u}\mathsf{t}}\left(\mathsf{w}\right)$ thus the claim follows. In the latter case, again we have that $\mathsf{pQ}(\mathsf{h},\mathsf{v},{\mathsf{L}}^{\prime \prime},\mathsf{IDX}\left(\mathsf{h}\right)={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{v})$ which, in turn, implies that $\mathrm{Q}(\mathsf{h},\mathsf{v},{\mathsf{L}}^{\prime \prime})={\mathsf{d}}_{\mathsf{G}}^{\prime}(\mathsf{h},\mathsf{v})$ by the definition of pQ and this concludes the proof. □