Distributed algorithm