— In a grid-computing environment, resource selection and scheduling depend on the network topology connecting the computation nodes. This paper presents a method to hierarchically group compute nodes distributed across the internet into logical clusters, and determine the relative location of the clusters. At inter-domain level, distance from landmarks (a small group of distributed reference nodes) is the basis for converting the location of nodes inside a complex network structure onto a simple geometric space. The position of compute nodes in this geometric space is the basis for partitioning nodes into clusters. For compute nodes within an administrative domain, minimum RTT is used as the metric to partition nodes into clusters. This approach leads to an efficient, scalable and portable method of clustering grid nodes and building a distance map among clusters. We demonstrate the system for automatic clustering by applying it to computation nodes distributed across five univers...