Research Article

Finding the Shortest Path with Vertex Constraint over Large Graphs

Algorithm 1

PERMUTATION-EXPANDING ().
Input:.
Output:.
// Input: : an undirected weighted graph
// : a vertex subset of
// , : starting vertex and ending vertex respectively
// Output: : the shortest path between and with vertex
// constraint of
1: Let be a min priority queue with entries in the form , sorted in ascending order of ;
2: for  each    do
3: Enqueue an entry into ;
4: Dequeue the first entry from and let be the last vertex of ;
5: while    do
6: if    then
7: for  each    do
8: Enqueue an entry into ;
9: else
10: Enqueue an entry into ;
11: Dequeue the first entry   from    and let be the last vertex of ;
12: Generate the shortest path    between    and under a permutation ;
13: return  ;