title: Alpha-beta move ordering
body: <p>I have a basic implementation of alpha-beta pruning but I have no idea how to improve the move ordering. I have read that it can be done with a shallow search, iterative deepening or storing the bestMoves to transition table.</p>
  
  <p>Any suggestions how to implement one of these improvements in this algorithm?</p>
  
  <pre><code> public double alphaBetaPruning(Board board, int depth, double alpha, double beta, int player) {
      if (depth == 0) {
          return board.evaluateBoard();
      }
  
      Collection&lt;Move&gt; children = board.generatePossibleMoves(player);
      if (player == 0) {
          for (Move move : children) {
              Board tempBoard = new Board(board);
              tempBoard.makeMove(move);
              int nextPlayer = next(player);
              double result = alphaBetaPruning(tempBoard, depth - 1, alpha,beta,nextPlayer);
              if ((result &gt; alpha)) {
                  alpha = result;
                  if (depth == this.origDepth) {
                      this.bestMove = move;
                  }
              }
              if (alpha &gt;= beta) {
                  break;
              }
          }
          return alpha;
      } else {
          for (Move move : children) {
              Board tempBoard = new Board(board);
              tempBoard.makeMove(move);
              int nextPlayer = next(player);
              double result = alphaBetaPruning(tempBoard, depth - 1, alpha,beta,nextPlayer);
              if ((result &lt; beta)) {
                  beta = result;
                  if (depth == this.origDepth) {
                      this.bestMove = move;
                  }
              }
              if (beta &lt;= alpha) {
                  break;
              }
          }
          return beta;
      }
  }
  
  public int next(int player) {
      if (player == 0) {
          return 4;
      } else {
          return 0;
      }
  }
  </code></pre>