— This paper presents a generalized gossip-based algorithm to solve distributed optimization problems in multiagent networks, especially for multiple supply-demand optimization problems. The proposed algorithm provides a generalization such that the optimization process can operate in the entire spectrum of “complete consensus” to “complete disagreement”. A user-defined control parameter θ is identified for controlling such tradeoff as well as the temporal convergence properties. Analytical results for first moment convergence analysis are presented and it is shown that with θ → 0, the formulation boils down to a classical consensus based protocol. Beyond the control parameter, the agent interaction matrix is also shown to be useful for effectively suppressing large localized uncertainties in subgradient estimation. A practical use case regarding building zone temperature control is presented as a numerical example for validation.