code: protected boolean[][] modifyDependencyMatrix(boolean M[][], double u, Random r) {
          //List<int[]> L = new ArrayList<int[]>();
          for (int j = 0; j < M.length; j++) {
              for (int k = j + 1; k < M[j].length; k++) {
                  if (/*
                           * !hasCycle(L) &&
                           */r.nextDouble() <= u) {
                      M[j][k] ^= true;
                      //L.add(new int[]{j,k});
                  }
              }
          }
          return M;
      }
docs: ModifyDependencyMatrix. A certain number of values will be altered. @NOTE
  a future improvement would be to detect cycles, since this may lead to
  inconsistencies. However, due to the rarity of this occurring, and the
  minimal problems it would cause (and considering that inconsistencies
  also occr in real datasets) we don't implement this.
  
  @param	M[][]	a boolean matrix
  @param	u	the probability of changing the relationship M[j][k]
  @param	r	for random numbers
  @return	the modified M