We develop an algorithm to detect community structure in complex networks. The algorithm is based on spectral methods and takes into account weights and links orientations. Since the method detects efficiently clustered nodes in large networks even when these are not sharply partitioned, it turns to be specially suitable to the analysis of social and information networks. We test the algorithm on a large-scale data-set from a psychological experiment of word association. In this case, it proves to be successful both in clustering words, and in uncovering mental association patterns. 1 Communities in Networks Complex networks are composed by a large number of elements (nodes), organized into sub-communities summing up to form the whole system. The partition of a complex network has no unique solution, since nodes can be aggregated according to different criteria. However, when dealing with networks an additional constraint bounds the possible choices: the entire information is coded in...