158 Int. J. Social Network Mining, Vol. 2, No. 2, 2015 Copyright © 2015 Inderscience Enterprises Ltd. Community detection in social networks using logic-based probabilistic programming Ahmed Ibrahem Hafez* CS Department, Faculty of Computer and Information, Minia University, Main Road, Shalaby Land, Menia, Minia , Postal Code 61519, Egypt Email: ah.hafez@gmail.com *Corresponding author Eiman Tamah Al-Shammari Faculty of Computing Science and Engineering, Kuwait University, Al-Adailiya, Library Building, 1st Floor, P.O. Box: 5969, Safat 13060, Kuwait Email: eiman.tamah@gmail.com Aboul Ella Hassanien and Aly A. Fahmy Faculty of Computers and Information, Cairo University, 5 Ahmed Zewal St., Orman, Giza, Postal Code 12613, Egypt Email: aboitcairo@gmail.com Email: aly.fahmy@gmail.com Abstract: Community detection in complex networks has attracted a lot of attention in recent years. Communities play special roles in the structure-function relationship; therefore, detecting communities can be a way to identify substructures that could correspond to important functions. Social networks can be formalised by a generative process in which interactions between actors are generated based on some assumptions, i.e., a model with some parameters. Based on that idea, a probabilistic inference technique can be used to infer the community structure of the network. We propose a generative model to describe how network interactions are generated and show the use of a logic-based probabilistic modelling technique such as PRISM, to solve the community detection problem. The proposed model works well with directed and undirected networks, and with weighted and un-weighted networks. We use the deterministic annealing expectation maximisation algorithm in the learning process, which prove to yield a very promising result when is applied to the community detection problem. Keywords: social networks; logic-probabilistice modelling; community detection.