public boolean compare(ArrayList<Integer> path) {
        for (int i = 0; i < origin.length; ++i) {
            if (path.get(i) != origin[i])
                return false;
        }
        return true;
    }