Simulating a consensus algorithm on random graphs