private void resetState() {
        cycle = null;
        colors = new LinkedHashMap<>();
        graph.getVertices().forEach(v -> colors.put(v, WHITE));
    }
<p>Applies the
<a href="https://www.geeksforgeeks.org/detect-cycle-direct-graph-using-colors/"> three-color algorithm</a>
to detect a cycle in a directed graph. If there are multiple cycles, this implementation only detects one
of them and does not guarantee that the shortest cycle is found.
</p>

@author gjoranv
container-core/src/main/java/com/yahoo/container/di/componentgraph/cycle/CycleFinder.java