private int returnStep (int vertex) {
        int maxVertex = 0;
        int i, j;
        for (Vertex incidentVertex : numberToVertex.get(vertex).getIncidentVertices()) {
            j = vertexToNumber.get(incidentVertex);
            if (j < vertex) {
                maxVertex = j;
            }
        }
        j = maxVertex;
        boolean []goodColor = new boolean[vertices.size() + 1];
        for (i = 0; i < vertices.size(); ++i) {
            goodColor[i] = true;
        }
        goodColor[color[j]] = false;
        for (Vertex incidentVertex : numberToVertex.get(j).getIncidentVertices()) {
            i = vertexToNumber.get(incidentVertex);
            if (0 != color[i]) {
                goodColor[color[i]] = false;
            }
        }
        int newColor = 0;
        for (i = color[j] + 1; i < maxColor; ++i) {
            if (goodColor[i]) {
                newColor = i;
                break;
            }
        }
        if (0 == newColor) {
            if (0 != j) {
                return returnStep(j);
            } else {
                return 0;
            }
        } else {
            color[j] = newColor;
            return j;
        }
    }