Algorithm Search⌘K

Theoremadvanced

NP-completeness of channel routing

Also called Szymanski theorem.

Deciding whether a channel routes in k tracks is NP-complete without doglegs (LaPaugh 1980) and with doglegs (Szymanski 1985), though left-edge is optimal without vertical constraints.

Channel routing asks for the fewest tracks in which the nets of a channel can be routed. Two results show that this is hard in the usual two-layer model. A. S. LaPaugh proved in her 1980 MIT thesis that the decision version is NP-complete when each net must use one trunk on one track, the model without doglegs. T. G. Szymanski proved in 1985 that it stays NP-complete when wires may change track in any column. So, unless P = NP, no router finds the fewest tracks on every channel in polynomial time, which is why practical channel routers are heuristics. The hardness comes from the vertical constraints: when the vertical constraint graph has no edges, the left-edge algorithm uses dd tracks, the channel density, and that is optimal.

Statement

A channel has columns 1,…,n1, \ldots, n, a top pin and a bottom pin in each column, each a net label or 0, and the routing grid of the reserved two-layer model with kk tracks: trunks on layer H, branches on layer V, vias at grid points, and no point of a layer shared by two nets.

Channel routing without doglegs (CR-ND). Given a channel and an integer kk, is there a map tt from nets to {1,…,k}\{1, \ldots, k\} such that nets with intersecting intervals get different tracks, and t(a)<t(b)t(a) < t(b) for every edge a→ba \to b of the vertical constraint graph?

Channel routing with doglegs (CR-D). Given a channel and an integer kk, is there a routing of all nets on the grid with kk tracks and no columns outside the channel, where each net may use layer H and layer V in any column?

Theorem.

  1. CR-ND is NP-complete (LaPaugh 1980).
  2. CR-D is NP-complete (Szymanski 1985).
  3. If the vertical constraint graph has no edges, CR-ND is solvable in polynomial time, and the answer is yes exactly when k≥dk \ge d.

The page on the channel routing problem shows that CR-ND has the stated form: a routing with one trunk per net exists with kk tracks if and only if such a map exists.

In plain words

It is easy to check a proposed routing: look at every column and every track. It is hard to find the narrowest one. For a large channel, no known method does much better than trying very many arrangements, in the worst case.

The trouble comes from the rules that one net must be above another. Without those rules, the simple method of filling lanes from the left is always best. Allowing nets to change lanes does not remove the trouble.

Proof

Membership of CR-ND in NP. A certificate is the map tt. It has NN entries, one per net, each at most kk, and kk can be taken at most NN without loss, because with an acyclic constraint graph NN tracks always suffice. To check it, compute the intervals of the nets and the edges of the constraint graph in one pass over the columns, then check the at most nn edges, and check that the nets on each track are pairwise disjoint by sorting them by left end. This takes polynomial time.

Membership of CR-D in NP, for kk written in unary. A certificate is the set of grid edges, vias and points used by each net. The grid has n(k+2)n(k + 2) points per layer, so the certificate has polynomial size, and connectivity and disjointness are checked by a search on each net. Szymanski's paper states the result for the decision problem with kk as given; this page only gives the certificate for the case where kk is written in unary.

NP-hardness of CR-ND (sketch). LaPaugh gives a polynomial-time reduction from a known NP-complete problem to CR-ND. By part 3, such a construction must use vertical constraints: the order they force between nets, together with the rule that nets which meet need different tracks, is what makes the choices hard. The full construction is in the thesis.

NP-hardness of CR-D (sketch). Szymanski gives a polynomial-time reduction from a known NP-complete problem to CR-D. The difficulty, compared with CR-ND, is that a router may change the track of a net in any free column, so the construction must work for every placement of doglegs and not only for maps from nets to tracks. The full construction and its proof are in the paper.

Part 3. If the constraint graph has no edges, every routing needs at least dd tracks by the density bound, and the left-edge algorithm gives one with dd tracks. So the answer is yes if and only if k≥dk \ge d, and dd is computed by one sweep over the columns. □\square

The proofs of parts 1 and 2 on this page are sketches. The page gives no gadget in detail, since the constructions are long and rest on the cited works.

A small instance to check. Take the channel

column 1 2 3 4 5 6 7 8
top 5 0 0 1 0 0 1 0
bottom 2 2 4 5 3 3 1 4

and k=3k = 3. The map t(1)=1t(1) = 1, t(3)=t(5)=2t(3) = t(5) = 2, t(2)=t(4)=3t(2) = t(4) = 3 is a certificate: the intervals [4,7][4, 7] on track 1, [5,6][5, 6] and [1,4][1, 4] on track 2, and [1,2][1, 2] and [3,8][3, 8] on track 3 are disjoint on each track, and the edges 1→51 \to 5 and 5→25 \to 2 go down. For k=2k = 2 the answer is no, because column 5 is crossed by nets 1, 3 and 4, so d=3d = 3. The left-edge algorithm uses 4 tracks on this channel, so a fast heuristic can miss a yes answer.

Consequences

  • Heuristics are the practical choice. The left-edge algorithm, dogleg channel routing, the Yoshimura-Kuh algorithm and the greedy channel router all run in polynomial time, so none of them can find the fewest tracks on every channel unless P = NP.
  • Switchboxes. A channel with kk tracks is a switchbox with no pins on the left and right sides, so deciding whether a switchbox can be routed is NP-hard as well.
  • Exact methods are exponential. Exact routers use branch and bound or integer programming, and their worst-case time grows exponentially.
  • The lower bounds are not tight. Since dd and the longest path of the constraint graph are computed in polynomial time, neither can always equal the optimum unless P = NP.

Tightness

  • Without vertical constraints the problem is easy. Part 3 shows that the hardness of CR-ND needs vertical constraints. Channels with all pins on one side, or with one pin per column, have no constraints, and left-edge solves them.
  • Feasibility alone is easy without doglegs. Whether some kk works at all is the question whether the constraint graph is acyclic, which a cycle detection answers in linear time. The hard part is the number of tracks.
  • One layer is easy. With one layer and no crossings, the problem is river routing, and the least width is found in polynomial time.
  • Other models. In the knock-knee model, where two nets may bend at the same grid point, channels with two-pin nets can be routed in dd tracks, but Sarrafzadeh showed in 1987 that the problem is NP-complete when nets have more pins. Middendorf showed in 1996 that the Manhattan problem stays NP-complete under strong limits on the instances.

History

Hashimoto and Stevens gave the left-edge algorithm in 1971, and it was soon clear that vertical constraints make the problem harder. A. S. LaPaugh, in her 1980 PhD thesis at MIT, proved that routing without doglegs in a given number of tracks is NP-complete. Deutsch had shown in 1976 that doglegs often save tracks, and it remained open whether they also make the problem easy. T. G. Szymanski settled this in 1985 in the IEEE Transactions on Computer-Aided Design, with a proof that the problem stays NP-complete when wires may dogleg in any column. Later work extended the hardness to other routing models and to restricted instances.

References

  1. A. S. LaPaugh, Algorithms for Integrated Circuit Layout, An Analytic Approach, PhD thesis, MIT, report MIT/LCS/TR-248, 1980, the NP-completeness of channel routing in a given number of tracks when each net has one trunk (general locator)
  2. Thomas G. Szymanski, Dogleg channel routing is NP-complete, IEEE Transactions on Computer-Aided Design 4(1), 31 to 41, 1985, the NP-completeness of channel routing in a given number of tracks in the two-layer Manhattan model where wires may dogleg in any column (general locator)
  3. M. Middendorf, Manhattan channel routing is NP-complete under truly restricted settings, Chicago Journal of Theoretical Computer Science, article 6, 1996, hardness for channels with strong limits on the nets (general locator; the title is not checked against the journal)
  4. M. Sarrafzadeh, Channel-routing problem in the knock-knee mode is NP-complete, IEEE Transactions on Computer-Aided Design 6(4), 1987, hardness of channel routing in the knock-knee model for nets with more than two pins (general locator)
  5. Naveed A. Sherwani, Algorithms for VLSI Physical Design Automation, third edition, Kluwer, 1999, the chapter on detailed routing, the part on channel routing (the complexity of channel routing; general locator)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/YJ25C7/text.yaml