distributed algorithm based on Ricart-Agrawala algorithm along with Roucairol-Carvalho Optimization