A Floyd-like algorithm for optimization of mix-valued logical control networks