|
Algorithm 1 Computation. |
-
1:
-
2:
-
3:
fordo
-
4:
▹V keeps track of the visited nodes.
-
5:
▹P is the path traced so far.
-
6:
DFS
-
7:
end for
-
8:
return
-
-
9:
function DFS()
-
10:
▹ is the last visited node, while is the destination of f.
-
11:
for
do
-
12:
if
then
-
13:
-
14:
-
15:
else
-
16:
if
&& then ▹h is the maximum number of hops.
-
17:
-
18:
-
19:
-
20:
-
21:
-
22:
-
23:
-
24:
end if
-
25:
end if
-
26:
end for
-
27:
return ,
-
28:
end function
|