Abstract. Following a bacterial-based modeling approach, the authors want to model and analyze the impact of both decentralization and heterogeneity on group behavior and collective learning. The paper aims to discuss these issues.Inspired by bacterial conjugation, the authors have defined an artificial society in which agents' strategies adapt to changes in resources location, allowing migration, and survival in a dynamic sugarscape-like scenario. To study the impact of these variables the authors have simulated a scenario in which resources are limited and localized. The authors also have defined three constraints in genetic information processing (inhibition of plasmid conjugation, inhibition of plasmid reproduction and inhibition of plasmid mutation). The results affirmed the hypothesis that efficiency of group adaptation to dynamic environments is better when societies are varied and distributed than when they are homogeneous and centralized.The authors have demonstrated that in a model based on free interactions among autonomous agents, optimal results emerge by incrementing heterogeneity levels and decentralization of communication structures, leading to a global adaptation of the system. This organic approach to model peer-to-peer dynamics in complex adaptive systems (CAS) is what the authors have named "bacterial-based algorithms" because agents exchange strategic information in the same way that bacteria use conjugation and share genome.