This code is based on the original LaplacianInference class.
Maybe, I will refactor the original class later once I pass the unit test.