Research Article

TPA: A Two-Phase Approach Using Simulated Annealing for the Optimization of Census Taker Routes in Mexico

Algorithm 4

Repair crossings over the blocks.
(1)   repairCrossings ()
(2)   begin
   / list of detected crossings in routing /
(3)   
     detect crossings in routing /
(4)   for  every edge  ,   used in routing    do
     / crossings with block /
(5)    
     / get a list of neighbor blocks /
(6)    
     / crossings with neighbor blocks /
(7)    
(8)   end
(9)   
(10) for  every detected crossing in    do
    / get a list of neighbor blocks /
(11)   
       / construct a visibility graph /
(12)   
      / find a path without crossings and minimum distance between and /
(13)    
       / repair routing using the path to avoid a particular crossing /
(14)     
(15) end
    / return a repaired routing with minimum total distance /
(16) return  
(17) end