In this paper, we consider an unconstrained collaborative optimization of a sum of convex functions where agents make decisions using local information in the presence of random communication topologies. We recast the problem as a minimization of the sum of convex functions over a constraint set defined as the set of fixed value points of a random operator derived from weighted matrix of a random graph. This formulation does not need the weighted matrix of the graph to be independent and identically distributed. We define a novel optimization problem which includes the formulated distributed optimization problem as a special case. We propose a discrete algorithm for converging in mean square to the solution of the optimization problem under suitable assumptions. Numerical examples illustrate the convergence of the proposed algorithms.