kClistCore.c
void recursion(unsigned kmax, unsigned k, unsigned* merge, unsigned* size, sparse* g, unsigned* ck, unsigned long long* nck){
	unsigned t=(k-3)*g->core,t2=t+g->core;
	unsigned i, u;

	if (size[k-3]<kmax-k){//stop if we already know k-cliques cannot be formed
		return;
	}

	if (k==kmax){//increasing the k-clique degrees
		for (i=0;i<kmax-1;i++){
			nck[ck[i]]+=size[k-3];
		}
		for (i=0;i<size[k-3];i++){
			nck[merge[t+i]]++;
		}
		return;
	}

	for(i=0; i<size[k-3]; i++){
		ck[k-1]=merge[t+i];
		size[k-2]=merging(&g->adj[g->cd[ck[k-1]]],g->d[ck[k-1]],&merge[t],size[k-3],&merge[t2]);
		recursion(kmax, k+1, merge, size, g, ck, nck);
	}
}
//the recursion to compute all possible intersections
the recursion to compute all possible intersections
the recursion to compute all possible intersections
void recursion(unsigned kmax, unsigned k, unsigned* merge, unsigned* size, sparse* g, unsigned* ck, unsigned long long* nck){
	unsigned t=(k-3)*g->core,t2=t+g->core;
	unsigned i, u;
	if (size[k-3]<kmax-k){
		return;
	}
	if (k==kmax){
		for (i=0;i<kmax-1;i++){
			nck[ck[i]]+=size[k-3];
		}
		for (i=0;i<size[k-3];i++){
			nck[merge[t+i]]++;
		}
		return;
	}
	for(i=0; i<size[k-3]; i++){
		ck[k-1]=merge[t+i];
		size[k-2]=merging(&g->adj[g->cd[ck[k-1]]],g->d[ck[k-1]],&merge[t],size[k-3],&merge[t2]);
		recursion(kmax, k+1, merge, size, g, ck, nck);
	}
}
void recursion ( unsigned kmax , unsigned k , unsigned * merge , unsigned * size , sparse * g , unsigned * ck , unsigned long long * nck ) { unsigned t = ( k - 3 ) * g -> core , t2 = t + g -> core ; unsigned i , u ; if ( size [ k - 3 ] < kmax - k ) { return ; } if ( k == kmax ) { for ( i = 0 ; i < kmax - 1 ; i ++ ) { nck [ ck [ i ] ] += size [ k - 3 ] ; } for ( i = 0 ; i < size [ k - 3 ] ; i ++ ) { nck [ merge [ t + i ] ] ++ ; } return ; } for ( i = 0 ; i < size [ k - 3 ] ; i ++ ) { ck [ k - 1 ] = merge [ t + i ] ; size [ k - 2 ] = merging ( & g -> adj [ g -> cd [ ck [ k - 1 ] ] ] , g -> d [ ck [ k - 1 ] ] , & merge [ t ] , size [ k - 3 ] , & merge [ t2 ] ) ; recursion ( kmax , k + 1 , merge , size , g , ck , nck ) ; } }
the recursion to compute all possible intersections
the recursion to compute all possible intersections
//stop if we already know k-cliques cannot be formed //increasing the k-clique degrees