Problem
Provide a structured variable elimination algorithm that solves the MAP task for networks with rule-based CPDs.
a. Modify the algorithm Rule-Sum-Product-Eliminate-Var in algorithm deal with the max-product task.
b. Show how we can perform the backward phase that constructs the most likely assignment to X. Make sure you describe which information needs to be stored in the forward phase so as to enable the backward phase.