Solving Optimization Problems with the Heuristic Kalman Algorithm