Community Detection in Complex Networks Using Agents