Some embodiments of the invention provide a method of searching for a three-dimensional
global path between first and second sets of routable elements in a region of a
layout that has multiple layers. The method partitions the region into several
sub-regions. It then performs a path search to identify a path between a first
set of sub-regions that contains the first-set elements and a second set of sub-regions
that contain a second-set element. When the method performing the path search,
it explores expansions along Manhattan and non-Manhattan routing directions between
the sub-regions on a plurality of layers.