Research Article

SMF-GA: Optimized Multitask Allocation Algorithm in Urban Crowdsourced Transportation

Algorithm 2

Calculate .
Input: The planned route’s start point and end point ; start points set
and end points set of to-do tasks which are assigned to .
Output: The total distance that travels when finishing assigned to-do tasks
1: , , , .add()
2: while TRUE do
3:
4:
5: for   to length-1 do
6: if    then
7:
8:
9: end if
10: end for
11:
12: .add(), .remove()
13: if   in   then
14: Find corresponding end point of start point from and add to
15: end  if
16: if   length   then
17: Exit While
18: end  if
19: end  while
20: , .add()
21: return