public int DFS(Vertex<Integer> vertex, Map<Vertex<Integer>,Boolean> visited,Vertex<Integer> parent){
        
        if(visited.containsKey(vertex)){
            return 0;
        }
        visited.put(vertex, true);
        int count = 0;
        for(Vertex<Integer> child : vertex.getAdjacentVertexes()){
            if(child.equals(parent)){
                continue;
            }
            if(visited.containsKey(child)){
                count += isNeighbor(child, parent) ? 1: 0;
            }else{
                count += DFS(child, visited, vertex);
            }
        }
        return count;
    }
http://www.careercup.com/question?id=5988741646647296
Given an undirected graph find number of triangles in this graph
Find cycle of length 3. Pass parent in DFS search.
If there is a cycle check if my parent is neighbor of the the node 
which caused it to be a cycle.
src/com/interview/graph/NumberofTriangles.java