algos/bip.c
void explore(int V, int* visited, struct node *adj[],struct order *vals,int *count,int colour,int *c,int parent,int *isbi) {
	struct node *t;
	//state what connected component the node is in
	visited[V]=1;
	vals[V].pre=*count;
//	printf("Node %d color %d\t parent %d, colour: %d\n",V,colour,parent,c[parent]);
	(*count)++;
	//visit all nodes connected to node V
	c[V]=colour;
	colour=!colour;
	for(t=adj[V];t!=t->next;t=t->next) {
		if(visited[t->V]==0) {
//			printf("Exploring edge %d %d\n",V,t->V);
			explore(t->V,visited,adj,vals,count,colour,c,V,isbi);
		} else if(c[t->V]==c[V]) {
//			printf("Node %d and Node %d share colour\n",t->V,V);
			*isbi=0;
		}
	}	
	vals[V].post=*count;
	(*count)++;
	return;
}
//explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive - DFS
void explore(int V, int* visited, struct node *adj[],struct order *vals,int *count,int colour,int *c,int parent,int *isbi) {
	struct node *t;
	visited[V]=1;
	vals[V].pre=*count;
	(*count)++;
	c[V]=colour;
	colour=!colour;
	for(t=adj[V];t!=t->next;t=t->next) {
		if(visited[t->V]==0) {
			explore(t->V,visited,adj,vals,count,colour,c,V,isbi);
		} else if(c[t->V]==c[V]) {
			*isbi=0;
		}
	}	
	vals[V].post=*count;
	(*count)++;
	return;
}
void explore ( int V , int * visited , struct node * adj [ ] , struct order * vals , int * count , int colour , int * c , int parent , int * isbi ) { struct node * t ; visited [ V ] = 1 ; vals [ V ] . pre = * count ; ( * count ) ++ ; c [ V ] = colour ; colour = ! colour ; for ( t = adj [ V ] ; t != t -> next ; t = t -> next ) { if ( visited [ t -> V ] == 0 ) { explore ( t -> V , visited , adj , vals , count , colour , c , V , isbi ) ; } else if ( c [ t -> V ] == c [ V ] ) { * isbi = 0 ; } } vals [ V ] . post = * count ; ( * count ) ++ ; return ; }
explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive - DFS
//state what connected component the node is in //	printf("Node %d color %d\t parent %d, colour: %d\n",V,colour,parent,c[parent]); //visit all nodes connected to node V //			printf("Exploring edge %d %d\n",V,t->V); //			printf("Node %d and Node %d share colour\n",t->V,V);