In this paper we propose a distributed implementation of the relaxed Alternating Direction Method of Multipliers algorithm (R-ADMM) for optimization of a separable convex cost function, whose terms are stored by a set of interacting agents, one for each agent. Specifically the local cost stored by each node is in general a function of both the state of the node and the states of its neighbors, a framework that we refer to as `partition-based' optimization. This framework presents a great flexibility and can be adapted to a large number of different applications. We show that the partition-based R-ADMM algorithm we introduce is linked to the relaxed Peaceman-Rachford Splitting (R-PRS) operator which, historically, has been introduced in the literature to find the zeros of sum of functions. Interestingly, making use of non expansive operator theory, the proposed algorithm is shown to be provably robust against random packet losses that might occur in the communication between neighboring nodes. Finally, the effectiveness of the proposed algorithm is confirmed by a set of compelling numerical simulations run over random geometric graphs subject to i.i.d. random packet losses.