private boolean alreadyVisited(ODocument neighbor, ODocument[] steps) {
        for (ODocument step : steps) {
            ODocument out = graph.getOutVertex(step);
            if (out.equals(neighbor)) {
                return true;
            }
        }
        return false;
    }
private boolean alreadyVisited ( ODocument neighbor , ODocument [ ] steps ) { for ( ODocument step : steps ) { ODocument out = graph . getOutVertex ( step ) ; if ( out . equals ( neighbor ) ) { return true ; } } return false ; }
Checks if a model is already visited in the path search algorithm. Needed for the loop detection.