Professional Documents
Culture Documents
T. Mihoc
Overview and
Historical
Perspective
Introduction
T. Mihoc1
1 Department of Computer Science
20 February 2019
Introduction
Outline
T. Mihoc
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
WHY?
Introduction
What is Intelligence?
T. Mihoc
Overview and
Historical
Perspective
I Learning
Introduction
What is Intelligence?
T. Mihoc
Overview and
Historical
Perspective
I Learning
I Reasoning
Introduction
What is Intelligence?
T. Mihoc
Overview and
Historical
Perspective
I Learning
I Reasoning
I Problem Solving
Introduction
What is Intelligence?
T. Mihoc
Overview and
Historical
Perspective
I Learning
I Reasoning
I Problem Solving
I Perception
Introduction
What is Intelligence?
T. Mihoc
Overview and
Historical
Perspective
I Learning
I Reasoning
I Problem Solving
I Perception
I Language
Introduction
Learning
T. Mihoc
Generalization
involves applying past experience to analogous new situations
Introduction
Learning
T. Mihoc
Generalization
involves applying past experience to analogous new situations
Example:
I a program that learns the past tense of regular English
verbs by rote will not be able to produce the past tense
of a word such as jump unless it previously had been
presented with jumped
Introduction
Learning
T. Mihoc
Generalization
involves applying past experience to analogous new situations
Example:
I a program that learns the past tense of regular English
verbs by rote will not be able to produce the past tense
of a word such as jump unless it previously had been
presented with jumped
I a program that is able to generalize can learn the add
ed rule and so forms the past tense of jump based on
experience with similar verbs
Introduction
Reasoning
T. Mihoc
Overview and
Ability to draw inferences appropriate to the situation! Historical
Perspective
Overview and
Ability to draw inferences appropriate to the situation! Historical
Perspective
Overview and
Ability to draw inferences appropriate to the situation! Historical
Perspective
Overview and
Ability to draw inferences appropriate to the situation! Historical
Perspective
Overview and
Ability to draw inferences appropriate to the situation! Historical
Perspective
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
Introduction
Problem solving
T. Mihoc
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
I special purpose – tailor-made for a particular problem
and often exploits very specific features of the situation
in which the problem is embedded
Introduction
Problem solving
T. Mihoc
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
I special purpose – tailor-made for a particular problem
and often exploits very specific features of the situation
in which the problem is embedded
I general purpose – is applicable to a wide variety of
problems
Introduction
Problem solving
T. Mihoc
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
I special purpose – tailor-made for a particular problem
and often exploits very specific features of the situation
in which the problem is embedded
I general purpose – is applicable to a wide variety of
problems
Example: means-end analysis: a step-by-step, or
incremental, reduction of the difference between the current
state and the final goal.
Introduction
Problem solving
T. Mihoc
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
I special purpose – tailor-made for a particular problem
and often exploits very specific features of the situation
in which the problem is embedded
I general purpose – is applicable to a wide variety of
problems
Example: means-end analysis: a step-by-step, or
incremental, reduction of the difference between the current
state and the final goal.
I for a robot the program selects actions from a list {PICKUP, PUTDOWN,
Overview and
In AI is a systematic search through a range of possible Historical
Perspective
actions in order to reach some predefined goal or solution.
State space search
I special purpose – tailor-made for a particular problem
and often exploits very specific features of the situation
in which the problem is embedded
I general purpose – is applicable to a wide variety of
problems
Example: means-end analysis: a step-by-step, or
incremental, reduction of the difference between the current
state and the final goal.
I for a robot the program selects actions from a list {PICKUP, PUTDOWN,
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
algorithms that mimic natural phenomena State space search
...
Introduction
Short History
T. Mihoc
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Identifying a solution
I in mathematics → optimisation process
profits, the time of arrival of a vehicle at a specified destination, or the vote share of a political
candidate
Introduction
Optimisation problems
T. Mihoc
collection of mathematical principles and methods used for
Overview and
solving quantitative problems in many disciplines Historical
Perspective
I a single numerical quantity, or objective function, that
State space search
is to be maximized or minimized
Example: the expected return on a stock portfolio, a company’s production costs or
profits, the time of arrival of a vehicle at a specified destination, or the vote share of a political
candidate
profits, the time of arrival of a vehicle at a specified destination, or the vote share of a political
candidate
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
Historical
Perspective
I Search space organises similar with an abstract data
State space search
type (ADT)
I ADT list → linear structure
I ADT tree → hierarchic structure
I ADT graph → graph-based structure
I aspects to consider:
I representation
I domain and operations
I types:
I informed search strategies (ISS)
I uninformed search strategies (USS)
Introduction
Uninformed Search strategies
T. Mihoc
Overview and
Historical
Perspective
Overview and
Historical
Perspective
Overview and
classification based on topology Historical
Perspective
I A∗ + versions of A∗
I Hill Climbing
I Simulated Annealing
I Tabu search
Introduction
Informed search strategies (ISS)
T. Mihoc
Overview and
Historical
Perspective
I Characteristics
Overview and
I Etymology: heuriskein (gr) Historical
Perspective
I to find, to discover
State space search
I study of methods and rules of discovering and invention
I Utility
I Evaluation of the state potential (in the search space)
I Estimation of paths cost from the current state to the
final state
I Characteristics
I Depends on the problem to be solved
I New functions for new problems
I A specific state is evaluated (instead of operators that
map a state into another one)
I Positive functions for each node n
I h(n) ≥ 0 for all states n
I h(n) = 0 for final state
I h(n) = ∞ for a state that is dead end
Introduction
Examples of heuristic functions
T. Mihoc
Overview and
Historical
I Missionary and cannibal problem Perspective
I 8-puzzle
* h(n) - no of pieces that are in wrong places
* h(n) - sum of Manhattan distance (of each piece
relative to the final position)
Overview and
Historical
Perspective
Basic Elements State space search
I Best first search = first, the best element is processed
I Each state is evaluated by a function f
I The best evaluated state is explored
I Example of a SS that depends on evaluation function:
I Uniform cost search (from USS)
I f = pathcost
I ISSs use heuristic functions
I 2 possible BFS strategies
I Expand the closest node to the objective state
I Expand the best evaluated (best cost) node
Introduction
Best First Search (BFS)
T. Mihoc
Overview and
Evaluation function f (n) = h(n) Historical
Perspective
I cost path estimation from the current state to the final State space search
one - h(n)
I cost minimization for the path that must be followed
visited to visit
∅ A
A D, B, C
A, D E, F, G, B, C
A, D, E H, I, F, B, C
A, D, E, H ∅
Introduction
Greedy
T. Mihoc
function Greedy(elem,list)
Overview and
found = false Historical
visited = ∅ Perspective
toVisit = {start} . FIFO sorted list (priority queue) State space search
while ((toVisit! = ∅)&&(!found)) do
if (toVisit == ∅) then return false
end if
node = pop(toVisit)
visited = visited ∪ {node}
if (node == elem) then found = true
else
aux = ∅
end if
for first unvisited child of node do
aux = aux ∪ {child}
end for
toVisit = aux ∪ toVisit . adding best one in the front
according to h(n)
end while
return found
end function
A∗
Introduction
T. Mihoc
Basic Elements
Overview and
Historical
Perspective
I Combination of positive aspects from:
State space search
I Uniform cost search
I Optimality and completeness
I sorted queues
I Greedy Search
I Speed
I Sorted based on evaluation
I Evaluation function f(n)
I Cost estimation of the path that passes though node n
f (n) = g (n) + h(n)
I g (n) - cost function from the initial state to the current
state n
I h(n) - cost heuristic function from the current state to
the final state
I Minimisation of the total cost for a path
A∗
Introduction
T. Mihoc
Example – Knapsack problem
Overview and
Historical
capacity W , n objects o1 o2 o3 o4 Perspective
(o1 , o2 , ..., on ) each of then pi 10 18 32 14 State space search
having a profit pi , i = 1, 2, ..., n Wi 1 2 4 3
T. Mihoc
function BestFS(elem, list)
Overview and
found = false Historical
visited = ∅ Perspective
toVisit = {start} . FIFO sorted list (priority queue) State space search
while ((toVisit! = ∅)&&(!found)) do
if (toVisit == ∅) then return false
end if
node = pop(toVisit)
visited = visited ∪ {node}
if (node == elem) then found = true
else
aux = ∅
end if
for all unvisited children of node do
aux = aux ∪ {child}
end for
toVisit = toVisit ∪ aux . adding a node based on its
evaluation f (n) = g (n) + h(n) (best one in the front of list)
end while
return found
end function
A∗
Introduction
T. Mihoc
I Complexity analyse
Overview and
I Time complexity Historical
Perspective
I b - ramification factor
I dmax - maximal length (depth) of an explored tree State space search
I T (n) = 1 + b + b 2 + ... + b dmax => O(b dmax )
I Space complexity
I d - length (depth) of solution
I T (n) = 1 + b + b 2 + ... + b d => O(b d )
I Completeness: yes
I Optimality:yes
I Advantages
I Expands the fewest nodes of the tree
I Disadvantages
I Large amount of memory
I Applications:
I Planning problems
I Problems of partial sums
I Puzzles
I Optimal paths in graphs
A∗
Introduction
T. Mihoc
Overview and
Historical
Perspective
climbing)
I Search advances to improved states until an optimal
one is identified
I How a possible solution is accepted
I Best neighbour of the current solution better than the
current solution
I Improvement by:
I Maximisation of states quality → steepest ascent HC
I Minimisation of states quality → gradient descent HC
I HC 6= steepest ascent/gradient descent (SA/GD)
I HC optimises f (x) with x ∈ R n by changing an element
of x
I SA/GD optimises f (x) with x ∈ R n by changing all the
elements of x
Introduction
Hill climbing (HC) I
T. Mihoc
Example - Construct towers from different geometrical shapes
Overview and
Historical
Perspective
I Solution representation
I State x - vector of n pairs (i, j), where i is the index of
the piece (i = 1, 2, ..., n) and j is the index of the stack
(j = 1, 2, 3)
Introduction
Hill climbing (HC) II
T. Mihoc
Example - Construct towers from different geometrical shapes
I initial state - vector of initial tower Overview and
Historical
Perspective
I State evaluation
I f1 = no.ofcorrectlylocatedpieces → maximisation
I f2 = no.ofwronglylocatedpieces → minimisation
I f = f1 f2 → maximization
I Neighbourhood
I Possible moves – Move a piece i from stack j1 on stack
j2
I How a possible solution is accepted: Best neighbour of
the current solution better than the current solution
Introduction
Hill climbing (HC)
T. Mihoc
Algorithm
Overview and
Historical
function HC(S) Perspective
x = s1 State space search
x∗ = x
k=0
while (not termination criteria) do
k =k +1
N = all neighbours of x
s = best solution from N
if (f (s) is better than f (x)) then
x =s
else
State
end if
end while
x∗ = x
return x ∗
end function
Introduction
Hill climbing (HC)
T. Mihoc
I Stochastic HC
I The next state is randomly selected
I First-choice HC
I Randomly generation of successors until a new one is
identified
I Random-restart HC → beam local search
I Successors of the current state are randomly selected State space search
o f (s2 ) = 1 + 1 + 1 = 3
Introduction
Simulated Annealing
T. Mihoc
Algorithm
Overview and
Historical
function SA(S) Perspective
x = s1 . initial state State space search
x∗ = x . best solution found until a given moment
k=0 . iteration number
while (not termination criteria) do
k =k +1
generate a neighbour s of x
if f (s) is better than f (x) then
x =s
else
pick a random number r ∈ (0, 1)
if r < P(∆E ) then
x =s
end if
end if
end while
x ∗ = x return x ∗ ;
end function
Introduction
Simulated Annealing
T. Mihoc
I Search analyse
Overview and
I Convergence (complete, optimal) through global optima is slowly Historical
Perspective
I Advantages
State space search
I Statistic-based algorithm → it is able to identified the optimal solution, but it requires
many iterations
I Easy to implement
I Generally, if find a good (global) solution
I Can solve complex problems (with noise and many constraints)
I Disadvantages
I Slowly algorithm convergence to solution takes a long time
I Trade-off between the solutions quality and the time
required to find it
I Depends on some parameters (temperature)
I The provided optimal solution could be local or global
I The solutions quality depends on the precision of variables involved in the algorithm
I Applications
I Combinatorial optimisation problems → knapsack problem
I Design problems → digital circuits design
I Planning problems → production planning, tennis game planning
Introduction
Tabu Search
T. Mihoc
Basic elements
Overview and
I Tabu → things that cannot be touched because they are sacred Historical
Perspective
I Proposed in 1970 by F. Glover
State space search
I Main idea
I starts with a state that violates some constraints and
I Performs changes for eliminating them (the search moves into the best neighbour
I Current state
I Visited states and performed moves (limited list of states that must be avoided)
I Tabu moves (T) determined by a non-Markov process that uses information obtained
Overview and
I Stop conditions Historical
Perspective
I Fix number of iterations State space search
I A given number of iterations without improvements
I Sufficient proximity to the solution (if it is known)
I Depletion un-visited elements of a neighbourhood
I Search analyse
I Quickly convergence to global optima
I Advantages
I The algorithm is general and can be easy implemented
I Quickly algorithm (can find in a short time the optimal
solution)
I Disadvantages
I Identify the neighbours in continuous search spaces
I Large number of iterations
I Global optima identification is not guaranteed
Introduction
Tabu Search
T. Mihoc
Example
Overview and
I Statement: pay a sum S by using n coins of values vi , Historical
Perspective
as many as possible (each coin has bi copies)
State space search
I Solution representation:
I State x - vector of n integers x = (x1 , x2 , ..., xn ) with
xi ∈ {0, 1, 2, ..., bi }
I Initial state randomly
I State evaluation:
I f1 = S - total value of selected coins → minimisation
I If the total value of coins > S → penalisation (eg. 500
units)
I f2 = number of selected coins → maximisation
I f = f1 f2 → minimisation
I neighbourhood
I Possible moves
I Including in the sum of j copies of coin i (plus)
I Eliminating from the sum of j copies of coin i (minus)
I Tabu list retains performed moves of an iteration
I - move = the added/eliminated coin
Introduction
Tabu Search
T. Mihoc
Example
Overview and
Historical
Perspective
S = 500 m1 m2 m3 m4 m5 m6 m7
vi 10 50 15 20 100 35 5
bi 5 2 6 5 5 3 10
S = 50 m1 m2 m3 m4 m5 m6 m7
vi 10 50 15 20 100 35 5
bi 5 2 6 5 4 3 10
Overview and
Historical
Perspective
I Applications
I Determination of three-dimensional structure of proteins
in amino acid sequences
I Traffic optimisation in communication networks
I Planning in production systems
I Network design in optical telecommunication
I Automatic routing of vehicles
I Graph problems (partitioning)
I Planning in audit systems