int i = 0;
for(Operator notVisitedOp : operators) {
final int count = i;
final SimpleOperatorGraphVisitor sogv = new SimpleOperatorGraphVisitor() {
private static final long serialVersionUID = -3649188246478511485L;
public Object visit(Operator operator) {
numberReachable[count]++;
return null;
}
};
notVisitedOp.visit(sogv);
i++;
}
int max = 0;
for(int c = 1; c < numberReachable.length; ++c) {
if(numberReachable[max] < numberReachable[c]) {
max = c;
}
}
result.add(operators[max]);
final SimpleOperatorGraphVisitor sogv = new SimpleOperatorGraphVisitor() {
private static final long serialVersionUID = -3649188246478511485L;
public Object visit(Operator operator) {
notVisitedOperators.remove(operator);