Puzzles and Search (part of exam 1/3) Flashcards

1
Q

What is necessary when defining a search problem?

A
  • state description: an abstract representation of the current state of the puzzle
  • goal function: checks whether a state description satisfies the goal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a state space, in the context of a search problem?

A

a collection of all state descriptions of a puzzle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Simple Exhaustive Search? How does it work?

A

it means you try out every single possible state of a puzzle and check them all with the goal function. you don’t use heuristics, nor constraints to reduce the number of states.
you do this until you’ve found the solution or until all states have been checked (if all have been checked and non satisfy the goal function, then there is no solution to the puzzle).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Local Search? How does it work?

A

you choose one state and try to improve it by maximizing a heuristic evaluation. similar to solving a puzzle by hand.
if you keep track of the solutions you’ve tried, you will either find a solution or the certainty that there is not solution. without keeping track, if there is no solution, the program might run forever.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the advantages of the Local Search?

A
  • uses very little memory
  • quick
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the disadvantages of the Local Search?

A
  • no guarantee for completeness (unless you keep track of the tried solutions)
  • no guarantee for optimality (that best/shortest solution is found)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the 8 Queen Problem?

A

it’s a puzzle where you need to put 8 queens on a chess board.
considering that a queen can move any number of tiles in horizontal, vertical and diagonal direction, all queens must be placed without them being in the hit-path of any of the other 7 queens.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an heuristic?

A

comes from the greek. is like a “rule of thumb”, some knowledge that may be helpful in solving a puzzle. they can also go wrong though.

in search algorithms, it’s often a function that estimates how close to the goal a certain state is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

On the example of the 8-Queens-Problem, how does the basic idea of an heuristic work?

A

heuristic = the number of queens, that are in each others hit paths is calculated for each state.
the algorithm follows the state where the heuristic is getting smaller until it reaches the goal (zero).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a different name for Hill-climbing Search?

A

Greedy Local Search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the Hill-Climbing Search work?

A

starting with the current state, the algorithm calculates all possible states that can exist, if one move is made. from these possible states it chooses the one with the higher evaluation (the best one). it does this until all possible future states would be worse than the current one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the main problem of the Hill-Climbing Search?

A

Local Optima: the algorithm stops as soon as it has reached the top of a hill, even if it isn’t the highest hill there is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Random Restart Hill-Climbing?

A

its a randomized variant of the Hill-Climbing Search. once the algorithm has reached a top, it starts again with a different starting position. after x iterations of this, a solution should be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Stochastic Hill-Climbing?

A

it is a randomized variant of the Hill-Climbing Search. Instead of always moving the the state with the best evaluation, you select a random state to move to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Beam Search? How does it work?

A

it is similar to the Hill-Climbing Search, but instead of moving to the one best possible future state, the algorithm moves to the k best possible future states.
k = number of states it should move to = beam size
the information from different beams is combined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a problem of the Beam Search?

A

it suffers from lack of diversity of the k-number of states.
means: if one state has better successors, it’s chosen more often than other states.
therefore, it is often no more effective than Hill-Climbing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is Stochastic Beam Search?

A

randomized variant of the Beam Search. it chooses k-number of successors at random.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the term “Annealing” mean? Where does it come from?

A

it’s comes from metallurgy and material science. it’s a heat treatment of materials to change its properties like strength and hardness, and then cooling it very slowly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is Simulated Annealing Search? How does it work?

A

the idea is to escape local maxima by throwing in random moves. the frequency of the random moves gradually decreases.
used in VLSI layouts, airline scheduling,…

20
Q

What is a Genetic Algorithm? How does it work?

A

similar to Stochastic Beam Search, except that new nodes always have two predecessors.

  • the algorithm starts with k-amount of randomly generated states (population).
  • each state is represented as a string and evaluated by a fitness function (how fit is this state? how close to the goal?)
  • the next generation of states is produced by selection, cross-over, and mutation.
21
Q

In regards to Genetic Algorithms, what is Selection?

A

basically: best one wins.
two possible future states are compared, the better one is moved to.

22
Q

In regards of Genetic Algorithms, what is Mutation?

A

the next state is generated by taking one parent state and modifing a random value.

comparable to a stochastic hill-climbing step.

23
Q

In regards to Genetic Algorithms, what is Cross-Over?

A

the next state is generated by taking both parent strings, cutting them at a cross-over point and recombining the pieces.

24
Q

What are the advantages of Genetic Algorithms?

A

they are popular, easy to implement, easy to explain, perform well (other randomized algorithms perform equally well or better)

25
Q

Who popularized Genetic Programming?

A

John R Koza

26
Q

Who is John R Koza?

A

he popularized Genetic Programming

27
Q

What is Genetic Programming?

A

applies Genetic Algorithms to program trees, and added special operations like inventing/deleting a subroutine, deleting/adding an argument,…

28
Q

What are the Towers of Hanoi?

A

it’s a mathematical puzzle by Eduoard Lucas, where a number of disks need to be placed from one peg to another. only one disk at a time may be moved. every disk may only be place on top of a bigger disk or the table.

29
Q

What is Divide-and-Conquer in regards to problem solving?

A

strategy with many applications.

basic idea:
* divide the problem into simpler partial problems
* solve the simpler problems (possibly again by division (=recursive programming))
* combine the partial solutions

30
Q

What are Constraint Satisfaction Problems?

A

they’re a special type of search problem, where
* the state is defined by variables X with d values from Domain D
* the goal test is a set of constraints specifying allowable combinations of values for subsets of variables

31
Q

What are some examples of Constraint Satisfaction Problems in the real world?

A
  • assignment problems (who teaches what class?)
  • timetable problems (which class is offered when and where?)
  • hardware configuration
  • spreadsheets
  • job scheduling (constraints are start and end times for each job)
  • transportation scheduling
  • floor planning
    *…
32
Q

What is a Constraint Graph?

A

visual representation of a state in a Constraint Satisfaction Problem.
* nodes are variables
* edges are constraints between nodes

33
Q

What types of constraints are there for the Constraint Satisfaction Problem?

A
  • unary: involves one variable
  • binary: involves a pair of variables
  • higher-order: involves 3 or more variables
34
Q

What are hard and soft constraints (in Constraint Satisfaction Problems)?

A
  • soft constraint (preferences): not binding but and many as possible need to be respected –> constrained optimization problems
  • hard constraints: have to be satisfied
35
Q

When solving Constraint Satisfaction Problems, how does the principle of Search work?

A
  • assign value to one variable
  • check if the constraints are satisfied
  • if yes: assign value to next variable and check again
  • if not: try a different value and check again. if all values were tried and failed, go back one variable and try a different value there. check again (backtrack)
36
Q

When solving Constraint Satisfaction Problems, how does the principle of Constraint Propagation work?

A
  • maintain a set of possible values D for each variable X
  • try to reduce the size of D by identifying values that violate constraints
37
Q

How do you calculate the number of possibilities in Naive Search?

A

Assumptions:
* we have n variables
* all solutions are at depth n in the search tree
* all variables have v possible values

Then:
* there are n! * (v^n) possibilities to go through before finding the solution

38
Q

How can the complexity of Naive Search be reduced?

A

with Commutative Variable Assignments.
if we already checked if a = blue and b = red violates any constraints, then we don’t have to check if a = red and b = blue violates any.
total complexity of search tree reduces to v^n.

39
Q

What is Backtracking Search?

A

it’s the basic search algorithm for Constraint Satisfaction Problems.
* assign value to one variable
* check if the constraints are satisfied
* if yes: assign value to next variable and check again
* if not: try a different value and check again. if all values were tried and failed, go back one variable and try a different value there. check again (backtrack)

domain-independent heuristics for selecting variables and for ordering values can improve practical performance.

40
Q

What types of heuristics are there for Constraint Satisfaction Problems?

A
  • domain-specific heuristics: depend on the particular characteristics of the puzzle
  • general-purpose heuristics: should work for all kinds of CSPs
41
Q

What types of General-purpose heuristics are there?

A
  • minimum remaining values heuristic: choose the variable with the fewest consistent values
  • degree heuristic: choose the variable with the most constraints on the other variables
  • least constraining value heuristic: for a variable, choose the value that rules out the fewest values in the other variables
42
Q

What is Constraint Propagation?

A

the passing on of constraint information (if I put value 3 to variable x, how does that effect other variables and their possible values?)

example Sudoku: if I put a 3 in this box, i can’t put a 3 in any box in the same row, column or square.

43
Q

What is Node Consistency?

A
  • all possible values of a variable must conform to all unary constraints

Example Sudoku: some boxes are already filled out, they are constrained to a single value

44
Q

What is Local Consistency?

A

making each node in the constraint graph consistent with its neighbors by iteratively enforcing the constraints corresponding to the edges

45
Q

What is Forward Checking?

A

while choosing values for variables, keep track of the remaining valid values for other variables.
terminate search when any variable has no more valid values.

46
Q

What is Arc Consistency?

A

every domain must be consistent with the neighbors:

a variable x(i) is arc-constistent with a variable x(j) if
* for every value in its domain D(i)
* there is some value in D(j)
* that satisfies the constraint on the arc ( X(i), X(j) )

after each new assignment of a value to a variable, possible values of the neighbors have to be updated and again, their neighbors need to be checked too because they might have lost a possible value as well.

47
Q

What is Min-Conflicts Heuristic?

A
  • randomly select a conflicted variable
  • choose the value that violates the fewest constraints