GraphLayoutImpl () { for (int i = 0; i < myHeadNodeIndex.size(); i++) { int headNodeIndex = myHeadNodeIndex.getInt(i); myStartLayoutIndexForHead[i] = currentLayoutIndex; dfs(headNodeIndex); } return new GraphLayoutImpl(myLayoutIndex, myHeadNodeIndex, myStartLayoutIndexForHead); }