private int depthFirstSearch(Object object1, Object object2, int[] visited, byte count)
        {
                if (count > MAXDEPTH)
                        return 1000000;
                int index1 = findIndex(object1);
                int index2 = findIndex(object2);
                int[] newVisited = new int[visited.length+1];
                for (int i = 0; i < visited.length; i++)
                        newVisited[i] = visited[i];
                newVisited[visited.length] = index1;
                if (index1 == index2)
                        return 0;
                
                LinkedList<Vertex> list = adj.get(index1);
                ListIterator<Vertex> iter = list.listIterator();
                int min = 1000000;
                while (iter.hasNext())
                {
                        int current = 1000000;
                        Vertex nextVertex = iter.next();
                        boolean alreadyVisited = false;
                        for (int i = 0; i < visited.length; i++)
                                if (visited[i] == nextVertex.getIndex())
                                        alreadyVisited = true;
                        if (!alreadyVisited)
                                current = depthFirstSearch(nextVertex.getObject(), object2, newVisited, (byte) (count+1))+1;
                        if (current < min)
                                min = current;
                }
                return min;
        }