code: @Override
      public boolean cyclic(int u, int v) {
  
          final int[] colors = vertexColor();
  
          // if either vertex has no color then the edge can not
          // be cyclic
          if (colors[u] < 0 || colors[v] < 0) return false;
  
          // if the vertex color is 0 it is shared between
          // two components (i.e. spiro-rings) we need to
          // check each component
          if (colors[u] == 0 || colors[v] == 0) {
              // either vertices are shared - need to do the expensive check
              for (final long cycle : cycles) {
                  if (isBitSet(cycle, u) && isBitSet(cycle, v)) {
                      return true;
                  }
              }
              return false;
          }
  
          // vertex is not shared between components check the colors match (i.e.
          // in same component)
          return colors[u] == colors[v];
      }
docs: {@inheritDoc}