An iterative algorithm for trust and reputation management