public boolean isBiparteDFS(Graph<Integer> graph){
        Set<Vertex<Integer>> redSet = new HashSet<Vertex<Integer>>();
        Set<Vertex<Integer>> blueSet = new HashSet<Vertex<Integer>>();
        for(Vertex<Integer> vertex : graph.getAllVertex()){
            if(redSet.contains(vertex) || blueSet.contains(vertex)){
                continue;
            }
            boolean flag = isBiparteDFS(vertex, redSet, blueSet, true);
            if(!flag){
                return false;
            }
        }
        return true;
    }
http://www.geeksforgeeks.org/bipartite-graph/
 Includes both DFS and BFS method
src/com/interview/graph/BiparteGraph.java