Data offloading offers a significant solution to the problem of explosive rise in mobile data traffic. A naive approach would be to utilize the infrastructure (cellular tower, WiFi, femtocell) or other mobile devices to offload data. However, increasing the number of a cellular towers, WiFi, or femtocells is costlier deal for data delivery. Recently, device-to-device (D2D) paradigm of data communication has emerged out as one of the most promising solutions to deal with cost effective cellular traffic offloading. D2D communication provides a direct communication link between closely located mobile users. Another significant feature of D2D is its content centric nature, which makes it useful in data offloading. In this paper, we have addressed the issue of data offloading in mobile devices and proposed a hybrid model of D2D communication with ad-hoc nature. The paper also considers the issues like memory constraints of the devices, pruning of replicated messages and energy efficiency to increase the lifetime of the battery. Considering all the constraints and trade off, we have modeled our problem into optimal target selection problem and distributed community detection problem, both of which are NP-hard. We propose a clustering algorithm to optimize the cooperative mobile nodes. The proposed algorithm uses the betweenness centrality and k-means for optimizing target set section. Our proposed algorithm requires less time in terms of computational complexity with limited space. We compare it with the community-based approach in terms of load transferred for varying target set sizes for validation. The simulation results of the suggested algorithm may reduce the energy requirements up to 16.7% and is able to accommodate 80% more traffic as compared to the community-based algorithm.