retealgorithmcpp