This study seeks to provide scalable and distributed algorithms to solve the resource allocation problem within an agent community. We propose an approach that can be applied to any kind of contact network, any range for the utility values, for the most important social welfare notions, avoiding the centralized approach drawbacks. In that purpose, we study various agent behaviors. We show that there exists in each case a simple behavior leading the negotiation process to a socially optimal resource allocation as an emergent phenomenon, or to a socially close solution if the need arises. We give, for each social welfare notion, the agent behavior to implement in order to solve the problem.