Research Article

Improved Optimal Path Finding Algorithm of Multistorey Car Park Based on MCP Protocol

Algorithm 2

ParkD (P, W).
Input: Candidate vacant parking space P, an adjacency matrix W formed by the Manhattan distance between the entrance, intersection, and the candidate vacant parking space.
Output: The path distance and path from the entrance to the candidate vacant parking space P.
Begin
1.  V←entrance, n intersections, and candidate parking spaces; //a total of n+2 nodes;
2  initialize mark set T[1~n+1]←0, adjacent node set Adj(Vi), path distance set D(V), used to record the set L(V) of the previous node in the path;
3  while T(n+1)≠1 do
4     m←{m|T(m)=0 and min{D(m)}}; T(m)←1;
5     For each i∈Adj(m) and T(i)≠1 do
6        D(i)←min{D(i), D(m)+W(i,m)};
7        if D(m)+W(i, m)<D(i), L(i)←m;
8     end for
9  end while
10.  H←backtracking according to L(n+1) to find the optimal path from the entrance to the candidate parking space;
11.  Return D(n+1), H
End