A Geometric Approach for Inference on Graphical Models