isthmusTo = new TIntArrayList();
ND = new int[n];
L = new int[n];
H = new int[n];
}
ISet act = graph.getNodes();
for (int i = act.getFirstElement(); i >= 0; i = act.getNextElement()) {
p[i] = -1;
}
for(int i=0;i<CC_firstNode.length;i++){
CC_firstNode[i] = -1;
}
//algo
int start = act.getFirstElement();
int i = start;
int k = 0;
numOfNode[start] = k;
nodeOfNum[k] = start;
p[start] = start;
int j;
boolean first = true;
while (true) {
if (first) {
j = graph.getSuccOrNeighOf(i).getFirstElement();
first = false;
} else {
j = graph.getSuccOrNeighOf(i).getNextElement();
}
if (j < 0) {
if (i == start) {
if (k < act.getSize() - 1) {
return false;
} else {
break;
}
}
i = p[i];
} else {
if (p[j] == -1) {
p[j] = i;
i = j;
first = true;
add(i, 0);
k++;
numOfNode[i] = k;
nodeOfNum[k] = i;
}
}
}
// POST ORDER PASS FOR FINDING ISTHMUS
isthmusFrom.clear();
isthmusTo.clear();
int currentNode;
for (i = k; i >= 0; i--) {
currentNode = nodeOfNum[i];
ND[currentNode] = 1;
L[currentNode] = i;
H[currentNode] = i;
ISet nei = graph.getSuccOrNeighOf(currentNode);
for (int s = nei.getFirstElement(); s >= 0; s = nei.getNextElement()) {
if (p[s] == currentNode) {
ND[currentNode] += ND[s];
L[currentNode] = Math.min(L[currentNode], L[s]);
H[currentNode] = Math.max(H[currentNode], H[s]);
} else if (s != p[currentNode]) {