void mutate(){
  do {
    int iBit;
    do {
      iBit=m_random.nextInt(m_nNodes * m_nNodes);
    }
 while (isSquare(iBit));
    m_bits[iBit]=!m_bits[iBit];
  }
 while (hasCycles());
  calcGlobalScore();
}

void mutate ( ) { do { int iBit ; do { iBit = m_random . nextInt ( m_nNodes * m_nNodes ) ; } while ( isSquare ( iBit ) ) ; m_bits [ iBit ] = ! m_bits [ iBit ] ; } while ( hasCycles ( ) ) ; calcGlobalScore ( ) ; }
apply mutation operation to bayesnet calculate score and as a side effect sets bayesnet parent sets .
