Distributed termination detection in reducible communication graphs