  In this paper, we formulate and solve a randomized optimal consensus problem
for multi-agent systems with stochastically time-varying interconnection
topology. The considered multi-agent system with a simple randomized iterating
rule achieves an almost sure consensus meanwhile solving the optimization
problem $\min_{z\in \mathds{R}^d}\ \sum_{i=1}^n f_i(z),$ in which the optimal
solution set of objective function $f_i$ can only be observed by agent $i$
itself. At each time step, simply determined by a Bernoulli trial, each agent
independently and randomly chooses either taking an average among its neighbor
set, or projecting onto the optimal solution set of its own optimization
component. Both directed and bidirectional communication graphs are studied.
Connectivity conditions are proposed to guarantee an optimal consensus almost
surely with proper convexity and intersection assumptions. The convergence
analysis is carried out using convex analysis. We compare the randomized
algorithm with the deterministic one via a numerical example. The results
illustrate that a group of autonomous agents can reach an optimal opinion by
each node simply making a randomized trade-off between following its neighbors
or sticking to its own opinion at each time step.
