







Maze Router: Lee Algorithm • Lee, "An algorithm for path connection and its application," • Discussion mainly on single-layer routing • Strengths - Guarantee to find connection between 2 terminals if it exists.- Guarantee minimum path. • Weaknesses-Requires large memory for dense layout - Slow • Applications: global routing, detailed routing
817 18 1817161718 7 6 5 6 7 8 T7 6 5 4 5 6 1876543 4 5 6 7 87654323456 7 6 5 4 3 2 1 6 5 4 3 2 1 5 .6 5 4 3 2 1 8 7 6 5 43 876545 81765 81716 81718 8 87678 765678 T 7 6 5 4 5 6 7 8 87654345678 87654312345678 7 6 5 4 3 2 1 6 7 8 654 321 6543211 76 543 876545 8765 8|76|7 1878 8 Filing Retrace • Time & space complexity for an M x N grid: O(MN) (huge!)
Reducing Memory Requirement Adjacent labels for k are either k-1 ork+1. - Want a labelling scheme such that each label has its preceding label different from its succeeding label. • Way 1: coding sequence 1,2,3, 1, 2, 3,...; states: 1, 2, 3, empty, blocked (3 bits required) • Way 2: coding sequence 1, 1, 2, 2, 1, 1, 2, 2, ...; states: 1, 2, empty, blocked (need only 2 bits)
2 1/2 21312 1 3 2 3 1 2 T 1 3 2 1 2 3 1 2 2 132 1312312 213 21312312312 213 211321 T2H 321321s 321321 213 213 2|1|32|12 2132 2131 21112 2212 221221 2 1 1 1 2 21 T211 21122|| 2211221211221 221 122 122112 2 2 2 1122 11 1 22 1 122 115 1122 11 2211 220 2 2 1122 2 2 11 2212 2122 Sequence: 1, 2, 3, 1, 2, 3, ... Sequence: 1, 1, 2, 2, 1, 1, 2, 2, ...
Reducing Running Time . Starting point selection: Choose the point farthest from the centre of the grid as the starting point. • Double fan-out: Propagate waves from both the source and the target cells. • Framing: Search inside a rectangle area 10-20% larger than the bounding box containing the source and target. - Need to enlarge the rectangle and redo if the search fails.
starting point selection double fan-out framing
Hadlock's Algorithm • Hadlock, "A shortest path algorithm for grid graphs," Networks, 1977. • Uses detour number(instead of labelling wave front in Lee's router) - Detour number, d(P): # of grid cells directed away from its target on path P.- MD(ST): the Manhattan distance between S and T. - Path length of P, I(P):(P)= MD(S,T) + 2d(P).- MD (S,T) fixed! Minimize d(P) to find the shortest path. - For any cell labelledi, label its adjacent unblocked cells away from 1 į+1; labeli otherwise. • Time and space complexities: O(MN), but substantially reduces the # of searched cells. Finds the shortest path between Sandt. d(P): # of grid cells directed away from its target on path P. MD (ST): the Manhattan distance between Sand T. • Path length of P, I(P):1(P)= MD (5,1)+2d(P). MD (S, T) fixed! =Minimized(P) to find the shortest path. . For any cell labelled i, label its adjacent unblocked cells away from 1 i+1; labeli otherwise
|3|3|3|3|3|3 |3|22233 32T1 30 3|2|111 3| 2T 32111 3211 321 3| 21:00 ב11|2 |3| |3|222 |3|3|3|