private static String getCyclicString(final List<String> cycle, final int idx) {
        final StringBuilder sb = new StringBuilder(cycle.get(idx));
        for (int i = 0; i < cycle.size(); i++) {
            sb.append("->").append(cycle.get((i + idx + 1) % cycle.size()));
        }
        return sb.toString();
    }
Calculates a set of all variables which are needed (directly or indirectly) to calculate the given vars
main/src/main/java/cgeo/geocaching/utils/formulas/VariableMap.java