public Node[] checkRandomNode(Node rnode, int hid)
{
	int slen, dlen;
	slen = (snodes[spos] == null ? spos : snodes.length);
	if (slen == 0)
		return null;
	int k = CommonState.r.nextInt(slen);
	Node random1 = snodes[k];
	HistoryUndirected history1 = (HistoryUndirected) random1.getProtocol(hid);
	slen = (history1.snodes[history1.spos] == null ? history1.spos : history1.snodes.length);
  if (slen == 0)
    return null;
	k = CommonState.r.nextInt(slen);
	Node random2 = history1.snodes[k];
	HistoryUndirected history2 = (HistoryUndirected) random2.getProtocol(hid);
    
	dlen = (history2.dnodes[history2.dpos] == null ? history2.dpos : history2.dnodes.length);
	for (int i=0; i < dlen; i++) {
		if (history2.dnodes[i] == random1 && 
		    history2.dvalues[i] == history1.svalues[k] &&
		    history2.dcycles[i] == history1.scycles[k]) {
			return null;
    }
	}
	
	nodes[0] = random1;
	nodes[1] = random2;
	return nodes;
}