The desirable global scalability of Grid systems has steered the research towards the employment of the peer-to-peer (P2P)
paradigm for the development of new resource discovery systems. As Grid systems mature, the requirements for such a mechanism
have grown from simply locating the desired service to compose more than one service to achieve a goal. In Semantic Grid,
resource discovery systems should also be able to automatically construct any desired service if it is not already present
in the system, by using other, already existing services. In this paper, we present a novel system for the automatic discovery
and composition of services, based on the P2P paradigm, having in mind (but not limited to) a Grid environment for the application.
The paper improves composition and discovery by exploiting a novel network partitioning scheme for the decoupling of services
that belong to different domains and an ant-inspired algorithmthat places co-used services in neighbouring peers.
Keywords Peer to peer - Service composition - Partitions - Ant-algorithm