liveBook · Manning

Search space

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

A search space is the set of candidate states or solutions that an optimization or search procedure may consider.

A search space is the set of candidate states or solutions an algorithm may consider. Decision variables describe a candidate; an objective function scores it; constraints rule out candidates that are not feasible. The feasible search space contains only solutions satisfying all constraints. Search then aims for a feasible solution with the best—or a sufficiently good—objective value. section 1.3 section 1.5

The space determines both what can be found and how hard finding it may be:

  • A global optimum is best across the feasible space; a local optimum is best only among nearby candidates. A search that improves nearby solutions can therefore miss a better region. section 1.3
  • Exploration investigates new regions. Exploitation concentrates on a promising region. Balancing them helps avoid both premature focus and excessive searching. section 1.5
  • A clearly defined space can still be too large for naive enumeration: a 13-city traveling salesman problem has 13! possible routes. section 1.4.3

States in a robot task

For a pick-and-place robot, a state can include arm position and speed plus gripper orientation and status. Motion and gripper commands lead to successor states. The goal is to move a defective workpiece into a waste box and return home; duration can evaluate the resulting path. Defining states, allowable moves, a goal, and an evaluation criterion makes the search problem concrete. section 1.4.1

When the space grows or changes

Dispatching four elevators across ten floors involves roughly 10²¹ possible states when positions and button states are considered. New calls also change the situation after a decision is made. A fixed optimum is difficult to identify when the search space is both enormous and only partly observable. section 1.4.2

In practice, define the candidate representation and constraints before choosing a search method. For a 20-city traveling salesman problem, a genetic algorithm represents routes as permutations and minimizes round-trip distance. A repair operator rotates each offspring route to start at city index 0, keeping the algorithm focused on the intended feasible representation. Population size, sampling, crossover, and mutation are parameters to experiment with rather than guarantees of an optimum. section 8.6

problem = TravelingSalesman(cities,distance_matrix)                          #1
 
algorithm = GA(
    pop_size=20,
    sampling=PermutationRandomSampling(),
    mutation=InversionMutation(),
    crossover=OrderCrossover(),
    repair=StartFromZeroRepair(),
    eliminate_duplicates=True
)                                                                             #2
 
termination = DefaultSingleObjectiveTermination(period=300, n_max_gen=np.inf) #3
 
res = minimize(
    problem,
    algorithm,
    termination,
    seed=1,
    verbose=False
)                                                                              #4

The solver configuration connects the search space to permutation sampling, crossover, mutation, repair, and a stopping rule. section 8.6

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines feasible space, distinguishes global from local minima, and illustrates scale; stops short of a general search-space construction procedure.
Examples
Uses robot pick-and-place states, elevator dispatching, and traveling salesman routes to show representation, scale, and feasible search.
What it assumes
Introduces decision variables, objectives, and constraints as basic ingredients without requiring prior optimization expertise.
What you can do after
Apply it via pymoo to represent traveling salesman routes and constrain a genetic algorithm’s search with repair.
How it connects
Connects decision variables, objective functions, constraints, local optima, and the exploration–exploitation trade-off.

Also explained in

Compare how 11 books explain search space →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.