Slave && Master for Floyds algorithm