G52AIP Artificial Intelligence Programming - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

G52AIP Artificial Intelligence Programming

Description:

Not complete. Not guarantee to find (optimal) solution ... UNTIL a (no) complete solution is found. G52AIP AI Programming. 21 of 36 ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 37
Provided by: rxq
Category:

less

Transcript and Presenter's Notes

Title: G52AIP Artificial Intelligence Programming


1
G52AIPArtificial Intelligence Programming
Dr Rong Qu
  • Introduction to CP Techniques Search Tree

2
CSP Formal Definition
  • A constraint satisfaction problem (CSP) consists
    of
  • a set of variables x1, x2, xi
  • a finite set of domain D (possible values) for
    each variable
  • a set of constraints C restricting the values
    that the variables can simultaneously take
  • CSP is to assign values to variable so that all
    constraints are satisfied

3
CSP Approaches
  • Constraint programming techniques
  • Systematic search on search trees constraint
    based techniques
  • Content of AI Programming G52AIP
  • Based on basic search techniques on search tree
  • Part of content of Introduction to AI G51IAI
  • Artificial intelligence search algorithms
  • move within search space to promising solutions
  • Content of AI Methods G52AIM

4
CSP Approaches
  • Four criteria to evaluate how good search
    techniques are
  • Completeness
  • Time complexity
  • Space complexity
  • Optimality

5
CSP Approaches
  • AI Search algorithms
  • Not complete
  • Not guarantee to find (optimal) solution
  • Work well on large scale problems (when good
    enough rather than optimal solutions are needed)
  • Usually difficult to evaluate time and space
    complexity
  • Based on search space of possible solutions
    approachable by neighborhood moves
  • Partially explored by searching algorithms

6
CSP Approaches
  • AI Search algorithms
  • Start (usually) from complete solutions
  • Modify the solutions by changing and accepting
    the new solution
  • Return the best/satisfactory solution

7
CSP Approaches
  • AI Search algorithms
  • Search space
  • all possible solutions approachable by
    neighborhood moves
  • Neighborhood moves
  • operators that modify values of certain elements
    in complete solutions

8
CSP Approaches
  • AI Search algorithms
  • Search space
  • all possible solutions approachable by
    neighborhood moves
  • Neighborhood moves
  • Operators that modify values of certain elements
    in complete solutions

9
CSP Approaches (AI algorithms)
10
CSP Approaches
  • AI Search algorithms
  • Simulated Annealing
  • accept worse solutions by probability, which is
    higher at the beginning and lower at the end of
    the search
  • Tabu Search
  • use memory to remember previous moves, so as not
    go back revisit visited solutions

11
CSP Approaches
  • AI Search algorithms
  • Genetic Algorithms
  • simulate the evolution process by crossover and
    mutation within populations of individuals
    (solutions)
  • Ant Algorithms
  • use pheromone as guidance of search towards
    promising and better solutions

12
CSP Approaches
  • Constraint programming techniques
  • It is complete
  • Guarantee to find the (optimal) solution(s) if
    one exists
  • Computational time and space may be expensive for
    large scale problems
  • Based on systematically organised search tree
    consists of all solutions

13
CSP Approaches (CP)
  • Constraint programming techniques
  • Search tree
  • All possible solutions systematically organised
    and explored

14
Constraint Programming
  • Well concentrate on CP in this module
  • Theory of CP (lectures)
  • Practical of CP (case study and demos in ILOG
    Solver using OPL)
  • Research on constraint based scheduling
  • Slight touch on AI Search algorithms to make the
    context complete
  • Recent research
  • hybridise AI search algorithms with constraint
    based techniques

15
Constraint Programming
  • Constraint programming techniques solve CSPs by
    using the combination of
  • Systematic search
  • and
  • Constraint satisfaction techniques

16
Constraint Programming
  • Systematic search
  • Generate and Test
  • Search tree
  • Backtracking

17
Constraint Programming
  • Constraint satisfaction techniques
  • Constraint propagation
  • Consistency check
  • Search strategies
  • Look back
  • Forward checking
  • Search orders
  • B B (for constraint optimisation problems)

18
Systematic Search
  • Search space
  • All possible states (solutions) which a search
    could arrive at
  • Systematically search through a search space of
    all possible assignment of values to variables
  • It is complete
  • Either a solution is guaranteed
  • Or no solution exist

19
Systematic Search GT
  • Generate-and-test (GT)
  • enumerate all possible combinations of values for
    variables one by one and see if they satisfy all
    constraints


20
Systematic Search GT
  • Generate-and-test (GT)
  • REPEAT
  • Select the next variable
  • Assign a value to the variable
  • If current assignment lead to a failure
    (dead-end no values are consistent with previous
    values)
  • Backtrack (replace the value assigned for
    previous variable with a new value)
  • UNTIL a (no) complete solution is found

21
Systematic Search Search Tree
  • Search Tree represent the state of search
  • Node partial solution
  • Branch possible assignment of values to
    variables
  • Labelling assign one value to a variable (taking
    one branch)
  • Dead-end no further values can be assigned to
    the variable

We can now find the solution by searching on the
search tree
22
Systematic Search Search Tree






23
Systematic Search Search Tree


nd


nd(n-1)d
nd(n-1)d(n-2)d


n!dn
24
Systematic Search Search Tree
  • How is the size of CSP measured
  • Number of variables
  • Size of domains for the variables
  • Number of constraints
  • Number of leaves in the search tree n!dn

25
Systematic Search Search Tree
  • Properties of CSPs search tree
  • The depth of the tree is fixed
  • Solution will always be at the nth level
  • The graph coloring example
  • The size of domains
  • Branching factor average number of branches

26
Systematic Search Search Tree
  • Properties of CSPs search tree
  • Sub-trees are similar
  • This is useful for learning during the search
  • Same failure could be avoided at similar sub-trees

27
Systematic Search Search Tree
  • Properties of CSPs search tree
  • The size of the search space for a problem is
    finite
  • Total number of leaves is fixed for a problem
  • However the internal nodes are different
  • Try the graph coloring problem search tree with
    different orderings of variables labelled

28
Systematic Search Search Tree
  • Depth first search

?
29
Systematic Search Backtracking
  • Backtracking

?
30
Systematic Search Backtracking
  • Revising past labels
  • Label one variable at a time
  • If current value is incompatible
  • Take an alternative value
  • If all values are tried
  • Un-assign the last variable
  • Until
  • All variable labelled
  • No more label to backtrack to

31
CP Backtracking
Systematic search with backtracking Tsang. (1996)
Foundations of Constraint Satisfaction
32
Systematic Search Backtracking
  • Pure backtracking
  • is very inefficient
  • complexity is exponential
  • may explore branches which likely lead to
    infeasible solutions (dead-ends)

33
Systematic Search Backtracking
  • Pure backtracking
  • Thrashing repeat the same failed assignment
  • Redundant conflict values of variables not
    remembered
  • Detection of conflict at later stage after
    exploring large number of branches

34
Constraint Satisfaction Techniques
  • Aim at
  • Avoid as much as possible backtrackings
  • Speed up the search
  • Idea search backtrack free

35
Constraint Satisfaction Techniques
  • Constraint propagation
  • Consistency enforcing
  • Arc consistency, path consistency
  • Search strategies
  • Back and forward checking
  • Variable and Value ordering
  • Branch bound (BB)
  • Constraint optimisation techniques

36
Summary
  • Solving CSP using CP
  • Systematic search
  • Search tree
  • Backtracking
  • Techniques
Write a Comment
User Comments (0)
About PowerShow.com