A universal decision making model for restructuring networks based on Markov Random Fields