OPTIMIZATION Flashcards

1
Q

choosing the best option from a set of possible options

A

Optimization

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

a search algorithm that maintains a single node and searches by moving to a neighboring node.

A

local search

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

a function that we use to maximize the value of the solution.

A

objective function

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

a function that we use to minimize the cost of the solution

A

cost function

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

the state that is currently being considered by the function

A

current state

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

a state that the current state can transition to

A

neighbor state

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

one type of a local search algorithm

A

hill climbing

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

In this algorithm, the neighbor states are compared to the current state, and if any of them is better, we change the current node from the current state to that neighbor state.

A

hill climbing

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

hill climbing pseudocode

A

function Hill-Climb(problem):

current = initial state of problem
repeat:
neighbor = best valued neighbor of current
if neighbor not better than current:
return current
current = neighbor

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

a state that has a higher value than its neighboring states

A

local maximum (plural: maxima)

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

a state that has the highest value of all states in the state-space.

A

global maximum

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

a state that has a lower value than its neighboring states.

A

local minimum (plural: minima)

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

a state that has the lowest value of all states in the state-space.

A

global minimum

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

problem with hill climbing

A

they may end up in local minima and maxima

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

multiple states of equal value are adjacent, forming a plateau whose neighbors have a worse value

A

flat local maximum/minimum

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

where multiple states of equal value are adjacent and the neighbors of the plateau can be both better and worse

A

shoulder

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

hill climbing variants

A

Steepest-ascent
Stochastic
First-choice
Random-restart
Local Beam Search

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

choose the highest-valued neighbor

A

Steepest-ascent

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

choose randomly from higher-valued neighbors

A

stochastic

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

choose the first higher-valued neighbor

A

First-choice

21
Q

conduct hill climbing multiple times

A

random-restart

22
Q

chooses the k highest-valued neighbors

A

local beam search

23
Q

allows the algorithm to “dislodge” itself if it gets stuck in a local maximum.

A

Simulated annealing

24
Q

simulated annealing algorithm

A

starts with a high temperature, being more likely to make random decisions, and, as the temperature decreases, it becomes less likely to make random decisions, becoming more “firm.” This mechanism allows the algorithm to change its state to a neighbor that’s worse than the current state, which is how it can escape from local maxima.

25
simulated-annealing pseudocode
function Simulated-Annealing(problem, max): current = initial state of problem for t = 1 to max: T = Temperature(t) neighbor = random neighbor of current ΔE = how much better neighbor is than current if ΔE > 0: current = neighbor with probability e^(ΔE/T) set current = neighbor return current
26
a family of problems that optimize a linear equation
linear programming
27
Linear programming will have the following components:
- A cost function that we want to minimize - A constraint that’s represented as a sum of variables that is either less than or equal to a value - Individual bounds on variables of the form lᵢ ≤ xᵢ ≤ uᵢ.
28
a class of problems where variables need to be assigned values while satisfying some conditions.
constraint satisfaction problems
29
Constraints satisfaction problems have the following properties:
- Set of variables (x₁, x₂, …, xₙ) - Set of domains for each variable {D₁, D₂, …, Dₙ} - Set of constraints C
30
a constraint that must be satisfied in a correct solution.
hard constraint
31
a constraint that expresses which solution is preferred over others.
soft constraint
32
a constraint that involves only one variable
unary constraint
33
a constraint that involves two variables
binary constraint
34
when all the values in a variable’s domain satisfy the variable’s unary constraints.
node consistency
35
when all the values in a variable’s domain satisfy the variable’s binary constraints
arc consistency
36
revise pseudocode
function Revise(csp, X, Y): revised = false for x in X.domain: if no y in Y.domain satisfies constraint for (X,Y): delete x from X.domain revised = true return revised
37
ac-3 which uses revise pseudocode
function AC-3(csp): queue = all arcs in csp while queue non-empty: (X, Y) = Dequeue(queue) if Revise(csp, X, Y): if size of X.domain == 0: return false for each Z in X.neighbors - {Y}: Enqueue(queue, (Z,X)) return true
38
a type of a search algorithm that takes into account the structure of a constraint satisfaction search problem
backtracking search
39
it is a recursive function that attempts to continue assigning values as long as they satisfy the constraints. If constraints are violated, it tries a different assignment
backtracking search
40
backtrack pseudocode
function Backtrack(assignment, csp): if assignment complete: return assignment var = Select-Unassigned-Var(assignment, csp) for value in Domain-Values(var, assignment, csp): if value consistent with assignment: add {var = value} to assignment result = Backtrack(assignment, csp) if result ≠ failure: return result remove {var = value} from assignment return failure
41
interleaving backtracking search with inference (enforcing arc consistency), so we can get at a more efficient algorithm.
Maintaining Arc-Consistency algorithm
42
This algorithm will enforce arc-consistency after every new assignment of the backtracking search.
Maintaining Arc-Consistency algorithm
43
Backtrack algorithm that maintains arc-consistency pseudocode:
function Backtrack(assignment, csp): if assignment complete: return assignment var = Select-Unassigned-Var(assignment, csp) for value in Domain-Values(var, assignment, csp): if value consistent with assignment: add {var = value} to assignment inferences = Inference(assignment, csp) if inferences ≠ failure: add inferences to assignment result = Backtrack(assignment, csp) if result ≠ failure: return result remove {var = value} and inferences from assignment return failure
44
types of heuristic
minimum remaining values heuristic degree heuristic least constraining values heuristic
45
For which of the following will you always find the same solution, even if you re-run the algorithm multiple times? Assume a problem where the goal is to minimize a cost function, and every state in the state space has a different cost.
Steepest-ascent hill-climbing, each time starting from the same starting state
46
Consider this optimization problem: A farmer is trying to plant two crops, Crop 1 and Crop 2, and wants to maximize his profits. The farmer will make $500 in profit from each acre of Crop 1 planted, and will make $400 in profit from each acre of Crop 2 planted. However, the farmer needs to do all of his planting today, during the 12 hours between 7am and 7pm. Planting an acre of Crop 1 takes 3 hours, and planting an acre of Crop 2 takes 2 hours. The farmer is also limited in terms of supplies: he has enough supplies to plant 10 acres of Crop 1 and enough supplies to plant 4 acres of Crop 2. Assume the variable C1 represents the number of acres of Crop 1 to plant, and the variable C2 represents the number of acres of Crop 2 to plant.
500 * C1 + 400 * C2
47
Consider the same optimization problem as in Question 2. What are the constraints for this problem?
3 * C1 + 2 * C2 <= 12; C1 <= 10; C2 <= 4
48
Consider the below exam scheduling constraint satisfaction graph, where each node represents a course. Each course is associated with an initial domain of possible exam days (most courses could be on Monday, Tuesday, or Wednesday; a few are already restricted to just a single day). An edge between two nodes means that those two classes must have exams on different days. After enforcing arc consistency on this entire problem, what are the resulting domains for the variables C, D, and E?
C’s domain is {Mon}, D’s domain is {Mon, Wed}, E’s domain is {Tue, Wed}