The heterogeneity of the Internet-of-things (IoT) network can be exploited as a dynamic computational resource environment for many devices lacking computational capabilities. A smart mechanism for allocating edge and mobile computers to match the need of devices requesting external computational resources is developed. In this paper, we employ the concept of Social IoT and machine learning to downgrade the complexity of allocating appropriate edge computers. We propose a framework that detects different communities of devices in SIoT enclosing trustworthy peers having strong social relations. Afterwards, we train a machine learning algorithm, considering multiple computational and non-computational features of the requester as well as the edge computers, to predict the total time needed to process the required task by the potential candidates belonging to the same community of the requester. By applying it to a real-world data set, we observe that the proposed framework provides encouraging results for mobile computer allocation.