1. Home
  2. Explore
  3. Computer Science
  4. Optimization Problems in AI

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Optimization Problems in AI

  • 38Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Optimization and Local Search Basics

What is the key difference between local search and classical search algorithms?

38 questions

  1. 1

    What is the key difference between local search and classical search algorithms?

    Model answer

    Local search maintains a single node and moves to neighbors, while classical search maintains multiple paths simultaneously.

    Explanation

    Local search focuses on a single current state and iteratively moves to a neighboring state, whereas classical search explores many paths at once.

  2. 2

    Define an optimization problem.

    Model answer

    An optimization problem involves choosing the best option from a set of possible options, often by maximizing an objective function or minimizing a cost function.

    Explanation

    Optimization is about finding the best solution from all feasible solutions, typically guided by a function that quantifies quality or cost.

  3. 3

    Explain the difference between an objective function and a cost function.

    Model answer

    An objective function is maximized to find the best state, while a cost function is minimized to find the best state.

    Explanation

    In optimization, we may either maximize a measure of goodness (objective) or minimize a measure of badness (cost), depending on the problem.

  4. 4

    In the context of a state-space landscape, what is a global maximum?

    Model answer

    A global maximum is a state whose value, according to the objective function, is higher than all other possible states.

    Explanation

    It is the best possible state overall in the entire state space.

  5. 5

    What is a neighbor in local search?

    Model answer

    A neighbor is a state that is close to the current state and slightly different, often defined by a small change (e.g., moving one hospital one square).

    Explanation

    The definition of neighbor varies by problem but always represents a small modification to the current state.

  6. 6

    Describe the basic hill climbing algorithm.

    Model answer

    Start at an initial state, repeatedly move to the highest-valued neighbor (if maximizing) until no neighbor is better, then stop.

    Explanation

    Hill climbing greedily improves the state by always moving to the best neighbor, terminating at a peak.

  7. 7

    What is a local maximum in hill climbing?

    Model answer

    A local maximum is a state whose value is higher than all its neighbors but not necessarily the global maximum.

    Explanation

    Hill climbing can get stuck at a local maximum because it only considers immediate neighbors.

  8. 8

    Define steepest-ascent hill climbing.

    Model answer

    Steepest-ascent hill climbing chooses the neighbor with the highest value (if maximizing) among all neighbors.

    Explanation

    It greedily picks the best immediate move, which may not always lead to the global optimum.

  9. 9

    How does stochastic hill climbing differ from steepest-ascent?

    Model answer

    Stochastic hill climbing chooses randomly from among all higher-valued neighbors, rather than always picking the best.

    Explanation

    This randomness can help escape plateaus but still never makes a move that is worse.

  10. 10

    What is first-choice hill climbing?

    Model answer

    First-choice hill climbing selects the first neighbor that is better than the current state, without evaluating all neighbors.

    Explanation

    It improves efficiency by not considering all neighbors, but still suffers from local optima.

  11. 11

    Explain random-restart hill climbing.

    Model answer

    Random-restart hill climbing performs hill climbing multiple times from random initial states and returns the best solution found.

    Explanation

    Repeating the process reduces the risk of getting stuck in a poor local optimum.

  12. 12

    What is local beam search?

    Model answer

    Local beam search keeps track of k current states, generates all their neighbors, and selects the k best neighbors to continue.

    Explanation

    It explores multiple paths in parallel, increasing the chance of finding a global optimum.

  13. 13

    What is a plateau in a state-space landscape?

    Model answer

    A plateau is a flat region where all neighboring states have the same value, making it hard for hill climbing to make progress.

    Explanation

    Plateaus can cause hill climbing to get stuck because no neighbor is better.

  14. 14

    What is a shoulder in hill climbing?

    Model answer

    A shoulder is a flat area where progress can still be made because there is a path to a higher value, unlike a plateau.

    Explanation

    Shoulders are not local optima but can still slow down the algorithm.

  15. 15

    Describe the core idea of simulated annealing.

    Model answer

    Simulated annealing sometimes accepts worse states to escape local optima, with probability decreasing over time (temperature).

    Explanation

    It mimics the physical annealing process where high temperature allows random moves, and cooling focuses on improvement.

  16. 16

    In simulated annealing, how is the acceptance probability of a worse neighbor calculated?

    Model answer

    The probability is eΔE/Te^{\Delta E / T}eΔE/T, where ΔE\Delta EΔE is the change in energy (negative if worse) and TTT is the temperature.

    Explanation

    A higher temperature or a smaller negative ΔE\Delta EΔE (less worse) increases the chance of accepting a worse state.

  17. 17

    What is the temperature schedule in simulated annealing?

    Model answer

    The temperature starts high and decreases over time, often as the proportion of remaining time.

    Explanation

    Early on, high temperature allows exploration; later, low temperature favors exploitation.

  18. 18

    How is the traveling salesman problem (TSP) formulated as a local search problem?

    Model answer

    A state is a route visiting all cities and returning to the start; the cost is total distance; a neighbor can be formed by swapping two edges.

    Explanation

    TSP is NP-complete, so local search finds good approximations by iteratively improving routes.

  19. 19

    What is linear programming?

    Model answer

    Linear programming optimizes a linear cost function subject to linear equality and inequality constraints.

    Explanation

    It involves minimizing or maximizing a linear function with variables and constraints that are linear equations or inequalities.

  20. 20

    Name two algorithms used to solve linear programs.

    Model answer

    The simplex algorithm and interior-point algorithms.

    Explanation

    These are classical methods for solving linear optimization problems efficiently.

  21. 21

    In the factory example, what is the objective function?

    Model answer

    Minimize 50x1+80x250x_1 + 80x_250x1​+80x2​, where x1x_1x1​ and x2x_2x2​ are hours running machines 1 and 2.

    Explanation

    The cost per hour for each machine is multiplied by the hours run.

  22. 22

    What are the components of a constraint satisfaction problem (CSP)?

    Model answer

    A set of variables, a domain for each variable, and a set of constraints.

    Explanation

    The goal is to assign each variable a value from its domain such that all constraints are satisfied.

  23. 23

    Give an example of a hard constraint and a soft constraint.

    Model answer

    Hard: two exams must not be on the same day. Soft: a preference that exam A is earlier than exam B.

    Explanation

    Hard constraints must be satisfied; soft constraints express preferences that can be violated at a cost.

  24. 24

    Define a unary constraint and give an example.

    Model answer

    A unary constraint involves a single variable, e.g., A ≠ Monday.

    Explanation

    It restricts the value of one variable independently.

  25. 25

    Define a binary constraint and give an example.

    Model answer

    A binary constraint involves two variables, e.g., A ≠ B.

    Explanation

    It specifies a relationship between two variables.

  26. 26

    What is a constraint graph?

    Model answer

    A constraint graph has variables as nodes and edges representing binary constraints between them.

    Explanation

    It visually represents the relationships in a CSP.

  27. 27

    What does it mean for a CSP to be node consistent?

    Model answer

    Every value in each variable's domain satisfies all unary constraints on that variable.

    Explanation

    Node consistency is achieved by removing any value that violates a unary constraint.

  28. 28

    How do you make a variable node consistent?

    Model answer

    Remove from its domain any values that violate its unary constraints.

    Explanation

    For example, if A ≠ Monday, remove Monday from A's domain.

  29. 29

    Define arc consistency for variable X with respect to Y.

    Model answer

    For every value in X's domain, there exists a value in Y's domain that satisfies the binary constraint between X and Y.

    Explanation

    Arc consistency ensures that each choice for X has a compatible choice for Y.

  30. 30

    What does the revise function do in arc consistency?

    Model answer

    Revise(X, Y) removes values from X's domain that have no compatible value in Y's domain for the binary constraint.

    Explanation

    It returns true if the domain changed, false otherwise.

  31. 31

    Describe the AC-3 algorithm.

    Model answer

    AC-3 maintains a queue of arcs. It repeatedly dequeues an arc (X, Y), revises X with respect to Y, and if changes occur, enqueues arcs (Z, X) for all neighbors Z except Y.

    Explanation

    AC-3 enforces arc consistency throughout the entire CSP.

  32. 32

    Why does AC-3 add arcs back to the queue after revising a domain?

    Model answer

    Because reducing X's domain may affect the arc consistency of other variables that were previously consistent with X.

    Explanation

    Other variables might now have values that were compatible only with the removed values.

  33. 33

    What is backtracking search?

    Model answer

    Backtracking search incrementally assigns values to variables, and if a dead end is reached, it undoes the last assignment and tries another value.

    Explanation

    It is a depth-first search for CSPs that backtracks on failure.

  34. 34

    In the backtrack function, what happens if the assignment is complete?

    Model answer

    The assignment is returned as the solution.

    Explanation

    A complete assignment means all variables have a value and all constraints are satisfied.

  35. 35

    How does maintaining arc consistency interleave with backtracking search?

    Model answer

    After each assignment, AC-3 is called (starting with arcs involving the assigned variable) to reduce domains and detect inconsistencies early.

    Explanation

    This inference step prunes the search space and can avoid unnecessary backtracking.

  36. 36

    What is the Minimum Remaining Values (MRV) heuristic?

    Model answer

    MRV selects the unassigned variable with the smallest domain.

    Explanation

    Choosing a variable with few remaining values reduces branching and can detect dead ends sooner.

  37. 37

    What is the degree heuristic?

    Model answer

    The degree heuristic selects the variable involved in the most constraints (highest degree).

    Explanation

    It helps reduce the search space by quickly constraining other variables.

  38. 38

    What is the least constraining value heuristic?

    Model answer

    It orders values by how few constraints they impose on neighboring variables, choosing the value that restricts others the least.

    Explanation

    This leaves more options for future assignments, increasing the chance of finding a solution.

1 of 38
Question 1 of 38

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent