Algorithm 2: CHASE(Gi)

Input: a pointer to Gi in T

Output: perform clearing, deletion or addition

1. Mark Gi visited.

2. If ( there are discontinuities)

3. For (each Gi _ discontinuities)

4. If (can’t be seen by other previous gaps)

5. then add it and update gridmap

6. else

7. If ( current discontinuities and a previous gap have same parent)

8. then merge it

9. else

10. delete it

11. Gi = first discontinuities added as a child

12. else

13. gap cleared

14. Gi = parent node