Quantum Markov Networks and Commuting Hamiltonians