Wiring the (2-by-n) Grid
P is a 2xn Boolean matrix, p(i,j) true if net Np has a pin in C(i,j)
hij is the cost to be added if net cuts H1j
vij is the cost to be added if net cuts Vkj
Let l and r be the column numbers of the leftmost and rightmost pins of the net respectively:
Then define four structures as follows: