code: private void markRings(int idx, int bprev) {
          avisit[idx] = numVisit++;
          final int d = deg[idx];
          for (int j = 0; j < d; j++) {
              int nbr = atomAdj[idx][j];
              int bidx = bondAdj[idx][j];
              if (avisit[nbr] == 0 || bidx == bprev)
                  continue; // ignored
              else if (avisit[nbr] < 0)
                  markRings(nbr, bidx);
              else if (avisit[nbr] < avisit[idx])
                  rbnds[bidx] = -1; // ring closure
          }
      }
docs: Recursively marks ring closures (back edges) in the {@link #rbnds}
  array in a depth first order.
  
  @param idx   atom index
  @param bprev previous bond