ArticleslgStudy

computer science

Move ordering

Move ordering is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Move ordering rather than just read about it. In short: Move ordering refers to the practice of selecting the most promising moves first during game-tree search (especially in computer chess). In minimax searches with alpha–beta pruning, good move ordering is important, examining stronger moves early causes cutoffs that eliminate subtrees, vastly reducing the number of nodes searched.

Key takeaways

  • Move ordering belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Move ordering to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Move ordering from memory before moving on to harder problems.

Reference excerpt

Move ordering refers to the practice of selecting the most promising moves first during game-tree search (especially in computer chess). In minimax searches with alpha–beta pruning, good move ordering is important, examining stronger moves early causes cutoffs that eliminate subtrees, vastly reducing the number of nodes searched. In the ideal case of perfect move ordering the search complexity drops from O ( b d ) {\displaystyle O(b^{d})} to approximately O ( b d / 2 ) {\displaystyle O(b^{d/2})} , effectively halving the effective branching factor to b {\displaystyle {\sqrt {b}}} and allowing roughly twice the search depth for a given computational effort. Claude Shannon observed that although a typical chess position may have on the order of 30 legal moves, effective pruning and heuristics reduce the useful branching factor to only a few.

History The idea of ordering moves came before computers. In his 1950 seminal paper "Programming a Computer for Playing Chess", Claude Shannon noted the enormous size of the full game tree (estimated at 10 120 {\displaystyle 10^{120}} nodes) and suggested that a simple evaluation coupled with search all variations to a fixed depth would be impractical. Shannon saw that any chess program would need to focus on selected moves and prune aggressively to be useful. The formal alpha–beta algorithm appeared in the late 1950s and 1960s as a way to prune branches without changing the minimax result. Early on, it was noted that alpha–beta's pruning power depends entirely on the order in which moves are examined. In 1963, Alexander Brudno independently described alpha–beta-like search and noted that best-case node counts occur when moves are tried in the right order; by the 1970s researchers such as Donald Knuth and Ronald Moore had mathematically analyzed alpha–beta and shown that under perfect ordering its time is O ( b d / 2 ) {\displaystyle O(b^{d/2})} . In the 1970s and 1980s the major practical heuristics for move ordering were introduced. The use of iterative deepening was rediscovered in chess programs and found to significantly improve move ordering for deeper searches. The idea was to use the best move found at shallow depth as the first move in the next deeper search. Transposition tables (Mac Hack by Richard Greenblatt in 1966 first used a hash) allowed the program to store the best move for each position and reuse it as the first choice on subsequent visits. In 1968 Barbara Liskov and others independently suggested storing moves that caused beta cutoffs. This eventually became known as the killer heuristic. In 1983 Jonathan Schaeffer proposed the history heuristic. Schaeffer showed that the history scores outperformed simpler heuristics.

Theoretical background The efficiency of a chess engine's search is almost entirely dependent on its ability to ignore "bad" moves as quickly as possible. Theoretically, if an engine could always examine the best move first, the search space would effectively be reduced to its square root. This is achieved through a combination of game theory and heuristic-based pruning. A pure minimax game-tree search explores all moves to a fixed depth, which is exponentially expensive. Alpha–beta pruning improves this by carrying two bounds which are Alpha (α) and Beta (β). Alpha is the minimum score the maximizing player is assured of, and Beta is the maximum score the minimizing player can permit. Whenever a node's value cannot possibly influence the final decision because it is worse than a previously examined move, the branch is cut off. This has a probability to have the same result as full minimax but with fewer nodes. Iterative deepening depth-first search is commonly used. The engine repeatedly searches with increasing depth limits, using the best move from depth d {\displaystyle d} as the first move to try at depth d + 1 {\displaystyle d+1} . This almost produces a strong initial bound (alpha or beta) on the first move, which narrows the window for the rest of the search. Iterative deepening converts a depth-first search into something akin to a best-first search by leveraging past results. When a transposition table contains an entry for the current position, its stored best move is tried first. After a transposition move is considered, typical ordering heuristics prioritize captures and checks, since forcing tactical moves often lead to large advantages or immediate cut offs. Engines sort capture moves by the Most Valuable Victim–Least Valuable Aggressor (MVV-LVA) heuristic. To avoid obviously losing trades, a static exchange evaluation (SEE) is often applied to prune captures that reduce material balance. If the forcing moves do not produce a cutoff, the engine then tries its stored killer moves, which are tried at early depth. If a non-killer move causes a cutoff, it becomes a new killer. Finally, any remaining quiet moves are ordered by their history heuristic scores, which accumulate bonuses when a move causes a cutoff. Each time a move causes a cutoff anywhere in the search, its history score increases. Thus moves that have historically caused cutoffs rank higher in future ordering.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Move ordering

Start with the simplest possible case. Write down what Move ordering claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Move ordering before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Move ordering ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Move ordering

In research
Move ordering appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Move ordering in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Move ordering is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer chess, Game theory, so understanding it makes those chapters shorter.
In everyday life
Look for Move ordering outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Move ordering” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Move ordering in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Move ordering means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Move ordering out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Move ordering in simple terms?

Move ordering refers to the practice of selecting the most promising moves first during game-tree search (especially in computer chess). In minimax searches with alpha–beta pruning, good move ordering is important, examining stronger moves early causes cutoffs that eliminate subtrees, vastly reduci…

Why does Move ordering matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Move ordering?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Move ordering.

Tags

  • Computer chess
  • Game theory

Keep exploring