Brute-force search
Brute-force search systematically tests many or all candidates in a defined search space, without relying on selective shortcuts to narrow it.
Optimization Algorithms: AI techniques for design, planning, and control problems
A graph-search strategy that explores states without using problem-specific information to prioritize promising alternatives.
- How it is used
- Uses blind graph search to explore states and find paths when no goal-directed search-space information is available.
- How deep it goes
- Defines exhaustive search and compares traversal and shortest-path rules, including their stopping conditions and practical trade-offs.
- Examples
- Compares BFS, DFS, Dijkstra’s algorithm, uniform-cost search, and bidirectional Dijkstra’s on a Toronto routing problem.
- What you can do after
- Apply it via NetworkX or optalgotools to compare routes, then diagnose parallel-edge and self-loop problems in map graphs.
Advanced Algorithms and Data Structures
Brute-force search exhaustively examines the available candidates to find results without using an indexing or pruning strategy.
- How it is used
- Uses exhaustive evaluation to solve constrained selection problems and assign points to their nearest k-means centroids.
- How deep it goes
- Explains enumeration, filtering, and selection, then contrasts repeated point-centroid comparisons with k-d-tree acceleration.
- Examples
- Uses Mars food packing and k-means point-to-centroid classification, supported by combination counts, pseudocode, and runtime comparisons.
- What you can do after
- Apply it via exhaustive enumeration for small candidate sets and evaluate when indexing or pruning is necessary.
Read how Advanced Algorithms and Data Structures explains brute-force search →
Grokking AI Algorithms, Second Edition
A brute-force approach systematically evaluates every possible combination or candidate in a problem's search space.
- How it is used
- Frames exhaustive search as a baseline for navigating trees, networks, web pages, social connections, and constrained combinations.
- How deep it goes
- Explains traversal order, visited-state tracking, iterative tree generation, and exhaustive knapsack evaluation, but avoids implementation code.
- Examples
- Uses maze paths, network routing, web crawling, social connections, and knapsack item combinations as concrete examples.
- What you can do after
- Evaluate small search spaces exhaustively while preventing cycles and comparing valid candidates for an optimal result.
Read how Grokking AI Algorithms, Second Edition explains brute-force search →
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
Brute-force search systematically examines many or all possible candidates until a valid solution is found.
- How it is used
- Solves small or moderate search and constraint problems by enumerating candidates and testing them.
- How deep it goes
- Explains candidate representation, recursive permutation generation, backtracking, validation, and result selection, while showing poor scalability.
- Examples
- Uses a five-city traveling salesman instance and the SEND+MORE=MONEY cryptarithmetic puzzle.
- What you can do after
- Build it from scratch in Swift by generating permutations, evaluating routes, and enforcing puzzle constraints.
Hacking Cryptography
A brute-force search systematically tests possible candidates until one satisfies the required conditions.
- How it is used
- Uses exhaustive candidate testing to simplify an LFSR-recovery exploit when a more efficient algorithm is harder to understand.
- How deep it goes
- Demonstrates candidate enumeration, matrix inversion, decryption, and validation, stopping short of deriving the more efficient Berlekamp–Massey algorithm.
- Examples
- Demonstrates recovery from an ATTACK AT prefix and validates the decrypted timestamp against a concrete test message.
- What you can do after
- Diagnose and exploit recoverable LFSR ciphertext by testing lengths, reconstructing taps, and validating decrypted plaintext.
Machine Learning Algorithms in Depth
Complete search is a problem-solving technique that traverses an entire search space to find a solution, optionally pruning parts known not to contain one.
- How it is used
- Uses exhaustive enumeration as a general problem-solving paradigm and as a foundation for implementing algorithms from scratch.
- How deep it goes
- Defines exhaustive traversal, pruning, recursion, and iteration, then demonstrates both implementations for subset generation.
- Examples
- Demonstrates recursive and bit-sequence subset generation and exact inference by complete enumeration over probability tables.
- What you can do after
- Build it from scratch using recursive branching, termination checks, pruning, backtracking, or bit-sequence enumeration.
Read how Machine Learning Algorithms in Depth explains brute-force search →
Natural Language Processing in Action, Second Edition
A brute-force search algorithm evaluates candidates directly, typically examining all available possibilities to find a match or optimum.
- How it is used
- Uses direct comparison to select chatbot responses or retrieve semantically closest documents.
- How deep it goes
- Explains candidate comparison, similarity measures, and O(N) scaling, but defers efficient indexing and approximate-search implementations.
- Examples
- Uses ChatterBot statement–response matching and document-vector comparison as concrete applications.
- What you can do after
- Evaluate when exact candidate comparison is practical and recognize when corpus size makes approximate retrieval preferable.
Read how Natural Language Processing in Action, Second Edition explains brute-force search →
Related concepts
- similarity searchkind of · Similarity search is a retrieval technique that finds or ranks items by comparing their representations with a query according to a similarity or distance measure.
- local searchcontrasts with · Local search is an optimization technique that iteratively modifies a candidate solution by exploring neighboring alternatives according to an improvement rule.
- informed searchcontrasts with · Informed search is a search strategy that uses problem-specific knowledge or heuristic estimates to prioritize promising states or paths.
- uniform-cost searchincludes · Uniform-cost search is a graph-search algorithm that repeatedly expands the frontier node with the lowest accumulated path cost.
- Dijkstra's algorithmincludes · Dijkstra's algorithm computes shortest paths from a source vertex in a weighted graph with nonnegative edge weights.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






