cgt algorithm project