Do not use floyd's alg. Just with a dict, enougth