Peer-to-peer (P2P) topology has a significant influence on the performance, search efficiency and functionality, and scalability of the application. In this paper, we investigate a multi-swarm approach to the problem of neighbor selection (NS) in P2P networks. Particle swarm share some common characteristics with P2P in the dynamic socially environment. Each particle encodes the upper half of the peer-connection matrix through the undirected graph, which reduces the search space dimension. The portion of the adjustment to the velocity influenced by the individual's cognition, the group cognition from multi-swarms, and the social cognition from the whole swarm, makes an important influence on the particles' ergodic and synergetic performance. We also attempt to theoretically prove that the multiswarm optimization algorithm converges with a probability of 1 towards the global optima. The performance of our This work is supported partially by NSFC Grant 60873054.A. Abraham ( ) Machine Egypt approach is evaluated and compared with other two different algorithms. The results indicate that it usually required shorter time to obtain better results than the other considered methods, specially for large scale problems.