175
Next: Structure and Local Search http://bit.ly/3GEMok7

Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Next: Structure and Local Search

http://bit.ly/3GEMok7

Efficient Solution of CSPs

Local Search

Page 2: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Next: Structure and Local Search

http://bit.ly/3GEMok7

Efficient Solution of CSPs

Local Search

Page 3: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Next: Structure and Local Search

http://bit.ly/3GEMok7

Efficient Solution of CSPs

Local Search

Page 4: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Reminder: CSPs

http://bit.ly/3GEMok7

CSPs:t Variablest Domainst Constraintst Implicit (provide code to compute)t Explicit (provide a list of the legal tuples)t Unary / Binary / N-ary

Goals:t Here: find any solutiont Also: find all, find best, etc.

Page 5: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Reminder: CSPs

http://bit.ly/3GEMok7

CSPs:t Variablest Domainst Constraintst Implicit (provide code to compute)t Explicit (provide a list of the legal tuples)t Unary / Binary / N-ary

Goals:t Here: find any solutiont Also: find all, find best, etc.

Page 6: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Reminder: CSPs

http://bit.ly/3GEMok7

CSPs:t Variablest Domainst Constraintst Implicit (provide code to compute)t Explicit (provide a list of the legal tuples)t Unary / Binary / N-ary

Goals:t Here: find any solutiont Also: find all, find best, etc.

Page 7: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Structure

http://bit.ly/3GEMok7

Page 8: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 9: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 10: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 11: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 12: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in n

t E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 13: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20

t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 14: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sec

t (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 15: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Problem Structure

http://bit.ly/3GEMok7

Extreme case: independent subproblemst Example: Tasmania and mainland do notinteract

Independent subproblems are identifiable asconnected components of constraint graph

Suppose a graph of n variables can be brokeninto subproblems of only c variables:t Worst-case solution cost is O((n/c)(dc)),linear in nt E.g., n = 80, d = 2, c =20t 280 = 4 billion years at 10 million nodes/sect (4)(220) = 0.4 seconds at 10 million nodes/sec

Page 16: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Theorem: if the constraint graph has no loops,the CSP can be solved in O(nd2) timet Compare to general CSPs, where worst-casetime is O(dn).

This property also applies to probabilisticreasoning (later): an example of the relationbetween syntactic restrictions and thecomplexity of reasoning

Page 17: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Theorem: if the constraint graph has no loops,the CSP can be solved in O(nd2) timet Compare to general CSPs, where worst-casetime is O(dn).

This property also applies to probabilisticreasoning (later): an example of the relationbetween syntactic restrictions and thecomplexity of reasoning

Page 18: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Theorem: if the constraint graph has no loops,the CSP can be solved in O(nd2) timet Compare to general CSPs, where worst-casetime is O(dn).

This property also applies to probabilisticreasoning (later): an example of the relationbetween syntactic restrictions and thecomplexity of reasoning

Page 19: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 20: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:

t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 21: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order:

Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 22: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variable

and order variables so that parent precedes childrent Remove backward:For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:

For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 23: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes children

t Remove backward:For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:

For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 24: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 25: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 26: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )

t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 27: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:

For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 28: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 29: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

http://bit.ly/3GEMok7

Algorithm for tree-structured CSPs:t Order: Choose root variableand order variables so that parent precedes childrent Remove backward:

For i = n : 2, apply RemoveInconsistent(Parent(Xi ),Xi )t Assign forward:For i = 1 : n, assign Xi consistently with Parent(Xi )

Runtime: O(nd2) (why?)

Page 30: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 31: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 32: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 33: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 34: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 35: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 36: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 37: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree-Structured CSPs

Claim 1: After backward pass, all root-to-leaf arcs are consistent

Proof: Each X ← Y was made consistent at one point and Y’s domaincould not have been reduced thereafter (because Y’s children wereprocessed before Y)

Claim 2: If root-to-leaf arcs are consistent, forward assignment willnot backtrack

Proof: Induction on position

Why doesn’t this algorithm work with cycles in the constraint graph?

Note: we’ll see this basic idea again with Bayes’ nets

Page 38: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Improving Structure

Page 39: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Nearly Tree-Structured CSPs

Conditioning: instantiate a variable, prune its neighbors’ domains

Cutset conditioning: instantiate (in all ways) a set of variables suchthat the remaining constraint graph is a tree

Cutset size c gives runtime O((dc)(n−c)d2), very fast for small c

Page 40: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Nearly Tree-Structured CSPs

Conditioning: instantiate a variable, prune its neighbors’ domains

Cutset conditioning: instantiate (in all ways) a set of variables suchthat the remaining constraint graph is a tree

Cutset size c gives runtime O((dc)(n−c)d2), very fast for small c

Page 41: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Nearly Tree-Structured CSPs

Conditioning: instantiate a variable, prune its neighbors’ domains

Cutset conditioning: instantiate (in all ways) a set of variables suchthat the remaining constraint graph is a tree

Cutset size c gives runtime O((dc)(n−c)d2), very fast for small c

Page 42: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Nearly Tree-Structured CSPs

Conditioning: instantiate a variable, prune its neighbors’ domains

Cutset conditioning: instantiate (in all ways) a set of variables suchthat the remaining constraint graph is a tree

Cutset size c gives runtime O((dc)(n−c)d2), very fast for small c

Page 43: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Conditioning

Choose a cutset.

Instantiate the cutset(all possible ways).

Compute residualCSP for eachassignment.

Solve the residualCSPs (treestructured).

Page 44: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Conditioning

Choose a cutset.

Instantiate the cutset(all possible ways).

Compute residualCSP for eachassignment.

Solve the residualCSPs (treestructured).

Page 45: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Conditioning

Choose a cutset.

Instantiate the cutset(all possible ways).

Compute residualCSP for eachassignment.

Solve the residualCSPs (treestructured).

Page 46: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Conditioning

Choose a cutset.

Instantiate the cutset(all possible ways).

Compute residualCSP for eachassignment.

Solve the residualCSPs (treestructured).

Page 47: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Conditioning

Choose a cutset.

Instantiate the cutset(all possible ways).

Compute residualCSP for eachassignment.

Solve the residualCSPs (treestructured).

Page 48: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Quiz

Find the smallest cutset for the graph below.

Page 49: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Quiz

Find the smallest cutset for the graph below.

Page 50: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Cutset Quiz

Find the smallest cutset for the graph below.

Page 51: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 52: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 53: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 54: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 55: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 56: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 57: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 58: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 59: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .}

{(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 60: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 61: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 62: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:

(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 63: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Tree Decomposition*

Idea: create a tree-structured graph ofmega-variables

Each mega-variable encodes part of theoriginal CSP

Subproblems overlap to ensureconsistent solutions

{(WA = r ,NT = g,SA = b), . . .} {(NT = r ,SA = g,Q = b), . . .}

Agree:(M1,M2) ∈ {((WA = r ,SA = g,NT = b),(SA = g,NT = b,Q = r)), . . .}

Page 64: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Improvement

Page 65: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6=

6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 66: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6=

6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 67: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraints

t Operators reassign variable values

6=

6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 68: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6=

6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 69: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6=

6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 70: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 71: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 72: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 73: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,

t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 74: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variable

t Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 75: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:

t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 76: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraints

t I.e., hill climb with h(n) = total number of violated constraints

Page 77: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 78: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Iterative Algorithms for CSPs

Local search methods typically work with “complete” states, i.e., allvariables assigned

To apply to CSPs:t Take an assignment with unsatisfied constraintst Operators reassign variable values

6= 6=

t No fringe! Live on the edge.

Algorithm: While not solved,t Variable selection: randomly select any conflicted variablet Value selection: min-conflicts heuristic:t Choose a value that violates the fewest constraintst I.e., hill climb with h(n) = total number of violated constraints

Page 79: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 80: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 81: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 82: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 83: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 84: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: 4-Queens

States: 4 queens in 4 columns (44 = 256 states)

Operators: move queen in column

Goal test: no attacks

Evaluation: c(n) = number of attacks

Demo: n-queens – iterative improvement (L5D1) Demo: coloring – iterative improvement

Page 85: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Video of Demo Iterative Improvement – n Queens

Page 86: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Video of Demo Iterative Improvement – Coloring

Page 87: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Performance of Min-Conflicts

Given random initial state, can solve n-queens in almost linear timefor arbitrary n with high probability (e.g., n = 10,000,000)!

The same appears to be true for any randomly-generated CSPexcept in a narrow range of the ratio

Page 88: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Performance of Min-Conflicts

Given random initial state, can solve n-queens in almost linear timefor arbitrary n with high probability (e.g., n = 10,000,000)!

The same appears to be true for any randomly-generated CSPexcept in a narrow range of the ratio

Page 89: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Performance of Min-Conflicts

Given random initial state, can solve n-queens in almost linear timefor arbitrary n with high probability (e.g., n = 10,000,000)!

The same appears to be true for any randomly-generated CSPexcept in a narrow range of the ratio

Page 90: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 91: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignments

t Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 92: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 93: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 94: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 95: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Ordering

t Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 96: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filtering

t Structure

Iterative min-conflicts is often effective in practice

Page 97: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 98: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 99: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Summary: CSPs

CSPs are a special kind of search problem:t States are partial assignmentst Goal test defined by constraints

Basic solution: backtracking search

Speed-ups:t Orderingt Filteringt Structure

Iterative min-conflicts is often effective in practice

Page 100: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Page 101: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 102: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 103: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 104: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 105: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 106: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Local Search

Tree search keeps unexplored alternatives on the fringe (ensurescompleteness)

Local search: improve a single option until you can’t make it better(no fringe!)

New successor function: local changes.

Generally much faster and more memory efficient (but incompleteand suboptimal)

Page 107: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 108: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherever

t Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 109: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring state

t If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 110: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 111: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 112: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?

t Optimal?

What’s good about it?

Page 113: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 114: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 115: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing

Simple, general idea:t Start wherevert Repeat: move to the best neighboring statet If no neighbors better than current, quit

What’s bad about this approach?t Complete?t Optimal?

What’s good about it?

Page 116: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing Diagram

Page 117: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing Quiz

Starting from X, where do you end up ?

Starting from Y, where do you end up ?

Starting from Z, where do you end up ?

Page 118: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing Quiz

Starting from X, where do you end up ?

Starting from Y, where do you end up ?

Starting from Z, where do you end up ?

Page 119: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing Quiz

Starting from X, where do you end up ?

Starting from Y, where do you end up ?

Starting from Z, where do you end up ?

Page 120: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Hill Climbing Quiz

Starting from X, where do you end up ?

Starting from Y, where do you end up ?

Starting from Z, where do you end up ?

Page 121: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Idea: Escape local maxima by allowing downhill movest But make them rarer as time goes on

Page 122: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Idea: Escape local maxima by allowing downhill movest But make them rarer as time goes on

Page 123: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 124: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kT

t If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 125: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,

t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 126: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 127: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 128: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 129: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a row

t People think hard about ridge operators whichlet you jump around the space in better ways

Page 130: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 131: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Simulated Annealing

Theoretical guarantee:t Stationary distribution: p(x) ∝ eE(x)/kTt If T decreased slowly enough,t will converge to optimal state!

Is this an interesting guarantee?

Sounds like magic, but reality is reality:t The more downhill steps you need to escape alocal optimum, the less likely you are to evermake them all in a rowt People think hard about ridge operators whichlet you jump around the space in better ways

Page 132: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Genetic Algorithms

Genetic algorithms use a natural selectionmetaphort Keep best N hypotheses at each step(selection) based on a fitness functiont Also have pairwise crossover operators, withoptional mutation to give variety

Possibly the most misunderstood, misapplied(and even maligned) technique around

Page 133: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Genetic Algorithms

Genetic algorithms use a natural selectionmetaphort Keep best N hypotheses at each step(selection) based on a fitness function

t Also have pairwise crossover operators, withoptional mutation to give variety

Possibly the most misunderstood, misapplied(and even maligned) technique around

Page 134: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Genetic Algorithms

Genetic algorithms use a natural selectionmetaphort Keep best N hypotheses at each step(selection) based on a fitness functiont Also have pairwise crossover operators, withoptional mutation to give variety

Possibly the most misunderstood, misapplied(and even maligned) technique around

Page 135: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Genetic Algorithms

Genetic algorithms use a natural selectionmetaphort Keep best N hypotheses at each step(selection) based on a fitness functiont Also have pairwise crossover operators, withoptional mutation to give variety

Possibly the most misunderstood, misapplied(and even maligned) technique around

Page 136: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Genetic Algorithms

Genetic algorithms use a natural selectionmetaphort Keep best N hypotheses at each step(selection) based on a fitness functiont Also have pairwise crossover operators, withoptional mutation to give variety

Possibly the most misunderstood, misapplied(and even maligned) technique around

Page 137: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: N-Queens

Why does crossover make sense here?

When wouldn’t it make sense?

What would mutation be?

What would a good fitness function be?

Page 138: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: N-Queens

Why does crossover make sense here?

When wouldn’t it make sense?

What would mutation be?

What would a good fitness function be?

Page 139: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: N-Queens

Why does crossover make sense here?

When wouldn’t it make sense?

What would mutation be?

What would a good fitness function be?

Page 140: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: N-Queens

Why does crossover make sense here?

When wouldn’t it make sense?

What would mutation be?

What would a good fitness function be?

Page 141: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: N-Queens

Why does crossover make sense here?

When wouldn’t it make sense?

What would mutation be?

What would a good fitness function be?

Page 142: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 143: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 144: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?

t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 145: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?

t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 146: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 147: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 148: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)

t Simplest causet All possible causest What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 149: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest cause

t All possible causest What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 150: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causes

t What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 151: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?

t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 152: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 153: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Example: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 154: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 155: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 156: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 157: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 158: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 159: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 160: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 161: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 162: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Beam Search

Like greedy hillclimbing search, but keep K states at all times:

Variables: beam size, encourage diversity?

The best choice in MANY practical settings

Complete? Optimal?

Why do we still need optimal methods?

Greedy Search

Beam Search

Page 163: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 164: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 165: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?

t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 166: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?

t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 167: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 168: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 169: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)

t Simplest causet All possible causest What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 170: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest cause

t All possible causest What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 171: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causes

t What test is most useful?t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 172: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?

t Prediction: cause to effectWe’ll see this idea again with Bayes’ nets.

Page 173: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 174: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

CSP Formulation: Fault Diagnosis

Fault networks:t Variables?t Domains?t Constraints?

Various ways to query, givensymptomst Some cause (abduction)t Simplest causet All possible causest What test is most useful?t Prediction: cause to effect

We’ll see this idea again with Bayes’ nets.

Page 175: Next: Structure and Local Searchcs188/sp20/assets/...t280 = 4 billion years at 10 million nodes/sec t(4)(220)=0:4 seconds at 10 million nodes/sec Tree-Structured CSPs Theorem: if the

Next Time: Adversarial Search!

Best strategy against opponent.