# How can we cast an optimisation problem as an inference problem?

The main idea of variational methods is to cast inference as an optimisation problem.

In the paper Junction Tree Variational Autoencoder for Molecular Graph Generation, the authors state that the optimisation problem (equation $$14$$)

$$\hat{G} = \operatorname{argmax}_{G' \in G(\hat{T})} f^a(G'),$$

where $$G(\hat{T})$$ is the set of possible graphs that are compatible with the decoded junction tree $$\hat{T}$$ and $$f^a$$ is a "scoring function", could be cast as a graphical model inference task in a model induced by the junction tree. How is this possible? Does it mean that the junction tree would induce a Bayesian network? How would it look like? What's the idea of casting an optimisation problem as an inference problem on a Bayesian network (which should be what the authors mean by "graphical model")?