The paper deals with the consensus problem in networks of multiagents with stochastic switching topologies. The switch of graph topology is modeled here as an adapted stochastic process. The authors introduce the concept of
-consensus in both discrete and continuous time. In the particular case when
, one arrives to the usual mean square consensus. By employing the Hajmal inequality from the theory of products of SIA matrices, sufficient conditions for
-consensus in both discrete and continuous time switching networks are derived. This conditions are provided in terms of conditional expectations of the underlying graph topology. A comparison with previous results is given, showing that some of these results could be derived from this approach. It is also shown that the conditions for
-consensus are also sufficient for almost sure consensus. As applications, there are given some corollaries concerning stochastic processes other than i.i.d. process and Markov processes.