In this research, consensus problem is investigated for multi-agent systems with Markovian switching topologies in presence of interactions between agents. The interactions can be made by physical connections between agents. These physical connections are considered linear and with deterministic structure. However, control algorithm has to be designed based on switching communication topologies which are modeled by a time-homogeneous Markov process. In this study, the consensus problem becomes stability problem. For achieving to consensus goal, Lyapunov functional approach and algebraic Riccati equation are applied to design proper control gains. In the control approach union of topologies has important role for reaching to the consensus. The proposed algorithm is presented for both leader-follower and leaderless systems. Also, it is proposed that the formation problem for multi-agent systems with Markovian switching topologies in presence of interactions between agents by changing the appropriate variable can be solved by the consensus approach. Finally, numerical simulations are presented to demonstrate the capability of method for solving the problem. consensus, switching topologies, interactions, physical connections, Markov process.