In this paper, a decentralized iterative algorithm able to achieve a Pareto optimal working point in a clustered ad hoc network is analysed. Here, radio devices are assumed to operate above a minimal signal to interference plus noise ratio (SINR) threshold while minimizing the global power consumption. A distributed algorithm, namely the optimal dynamic learning (ODL), is presented and shown to be able to dynamically steer the network to an efficient working point, by exploiting only minimal amount of information. This algorithm aims at implementing a Pareto optimal solution for a large proportion of the time, with high probability. Conversely, existing solutions aim at achieving individually optimal solutions (Nash equilibria), which might be globally inefficient. The gain is shown to be larger when the amount of available radio resource is scarce. Sufficient analytical conditions for ODL to converge to the desired working point are provided, moreover through numerical simulations the ability of the algorithm to configure an interference limited network is shown. The performance of ODL and those of a Nash equilibrium reaching algorithm are numerically compared, and their performance as a function of available resources studied. Keywords: Learning, power control, trial and error, Nash equilibrium, Pareto optimality, ad hoc network, channel selection, spectrum sharing.