Input:   ,
Output:  flow sign i
  set i and to be 0
  if  ( ) then
   selects according to FIFO
   
   return;
  end if
  for
   if  ( )
     calculate
    if  ( ) then
      
      for
        if  ( ) then
          
        end if
      end for
    end if
  end if
  end for
Algorithm 2: Flow selection algorithm.