private void recalculate(final VariableState state, final String var, final boolean start, final LinkedList<String> treePath, final List<List<String>> cyclesFound) {
        if (!start && var.equals(state.var)) {
            //new CYCLE found!
            cyclesFound.add(new ArrayList<>(treePath));
            return;
        }

        if (!recalculateSingle(state, false)) {
            for (String n : state.isNeededBy) {
                treePath.add(0, state.var);
                recalculate(get(n), var, false, treePath, cyclesFound);
                treePath.remove(0);
            }
        }
    }
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