code: private void breadthFirstSearch(IAtom root, boolean addTreeNode) throws CDKException {
          sphere = 0;
          TreeNode tempNode = null;
          List<IAtom> conAtoms = atomContainer.getConnectedAtomsList(root);
          IAtom atom;
          IBond bond = null;
          sphereNodes.clear();
          sphereNodesWithAtoms.clear();
          for (int i = 0; i < conAtoms.size(); i++) {
              try {
                  atom = conAtoms.get(i);
                  if (atom.getSymbol().equals("H")) continue;
                  bond = atomContainer.getBond(root, atom);
                  /*
                   * In the first sphere the atoms are labeled with their own atom
                   * atom as source
                   */
                  if (bond.getFlag(CDKConstants.ISAROMATIC)) {
                      tempNode = new TreeNode(atom.getSymbol(), new TreeNode(root.getSymbol(), null, root, (double) 0, 0,
                              (long) 0), atom, 4, atomContainer.getConnectedBondsCount(atom), 0);
                  } else {
                      tempNode = new TreeNode(atom.getSymbol(), new TreeNode(root.getSymbol(), null, root, (double) 0, 0,
                              (long) 0), atom, bond.getOrder().numeric(), atomContainer.getConnectedBondsCount(atom), 0);
                  }
  
                  sphereNodes.add(tempNode);
                  if (!addTreeNode) sphereNodesWithAtoms.add(atom);
  
                  //		        rootNode.childs.addElement(tempNode);
                  atom.setFlag(CDKConstants.VISITED, true);
              } catch (Exception exc) {
                  throw new CDKException("Error in HOSECodeGenerator->breadthFirstSearch.", exc);
              }
          }
          Collections.sort(sphereNodes, new TreeNodeComparator());
          nextSphere(sphereNodes);
      }
docs: Prepares for a breadth first search within the {@link IAtomContainer}. The actual
  recursion is done in <code>nextSphere()</code>.
  
  @param  root  The atom at which we start the search
  @exception  org.openscience.cdk.exception.CDKException  If something goes wrong.