Implement the single-variable factor (variable node in classical max-sum)