private static void hamilton(int node, int level) {
        // Add the current node in the cycle
        currentCycle[level] = node + 1;

        if ((START_NODE == node) && (level > 0)) {
            if (level == GRAPH_SIZE) {
                // the cycle is hamilton with min sum
                minSum = curSum;
                System.arraycopy(currentCycle, 0, minHamCycle, 0, currentCycle.length);
            }
        }

        if (used[node]) {
            // the cycle is not hamilton
            return;
        }

        used[node] = true;
        for (int i = 0; i < GRAPH_SIZE; i++) {
            if (graph[node][i] > 0 && node != i) {
                curSum += graph[node][i];
                // check if there is a hamilton cycle shorter than the current path
                if (curSum < minSum) {
                    hamilton(i, level + 1);
                }
                // Remove the node -> i length from the current sum (step back)
                curSum -= graph[node][i];
            }
        }

        // Step back
        used[node] = false;
    }