public boolean isBipartite() {

		this.setState(States.ARR_ADJ);
		boolean result = true;
		int[] part = new int[this.getVertexCount()];
		Arrays.fill(part, -1);

		int fromNode = 0;
		part[fromNode] = 1;
		Queue<Integer> queue = new LinkedList<Integer>();
		queue.add(fromNode);
		
		while (!queue.isEmpty()){
			int u = queue.poll();
			for (int v = 0; v < this.getVertexCount(); v++){
				if (this.arr_adj[u][v] != 0 && part[v] == -1){
					part[v] = 1 - part[u];
					queue.add(v);
				}
				
				else if (this.arr_adj[u][v]!= 0 && part[v] == part[u]){
					result = false;
				}
			}
		}
		
		if (result)
			Log.print(Log.system, "The graph is bipartite");
		else
			Log.print(Log.system, "The graph is not bipartite");
		
		//have to count how many nodes in first partite
		int count = 0;
		for (int i = 0; i < this.getVertexCount(); i++){
			if (part[i]>0)
				count++;
		}
		this.nodeCountFirstPartite = count; 
		
		return result;
	}