Lec 1 - Introduction
Lec 1 - Introduction
Artificial Intelligence
Methods
Lecture 1
Introductory
Learning Outcomes
WHAT
• Module Content
• Artificial Intelligence Method ?
1. Basic terminologies
2. Stages of decision making
3. What a model is
IDENTIFY 4. The need for heuristic search/optimisation techniques in decision
support
5. The different heuristic search paradigms and be able to identify
topology of a given heuristics
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
SECRETs Revealed!
Educational Aims
YOU will have a sound YOU will understand the YOU will be acquainted
understanding of the methods and techniques with a number of
selected modern that are available as an applications and will
(heuristic) search aid in automated understand how software
techniques in Artificial decision tools are designed to
Intelligence. making/optimisation. solve them.
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Module
IMPORTANT!
• Lecture notes can be reached from the module Moodle web page
• Link to relevant papers will be provided.
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
• do automated timetabling
• decrease carbon emissions and other costs of routing
• reduce operational cost of supply chains
• increase energy production via drawing wind-farm layouts
• improve packing and scheduling workflow for additive manufacturing
• optimise multifunctional structures combining composite and porous layers
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Agricultural Lands
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Exam Timetabling
Routing
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Decision Making
Every decision-making process produces a final choice.
The output can be an action or an opinion of choice.
- wikipedia
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
▪ Iconic Models
- Least abstract - a physical replica of a system: e.g., 3D car.
▪ Analog models
- More abstract - a symbolic representation of reality
- Behaves like the real system but does not look like it: e.g., cardboard cutouts, 2D charts.
▪ Mathematical Models
- Most abstract - mathematical relationships in the problem
- Easier to model than manipulate real systems
- Low cost of the analysis
- Cost of making mistakes is less than mistakes on real system
- Can model risk and uncertainty
- A very large number of solutions can be analysed
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
- efficiently finding a set of actions that will move from a given initial
state to a given goal
Search for
- central to many AI problems (e.g., game playing, path finding)
paths to goals
- typical algorithms are the depth first search, breadth * first search,
uniform cost search, branch and bound, A*
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
“Consider everything. Keep the good. Avoid evil whenever you notice it.''
maximize/minimize 𝑧 = 𝑓(𝑿)
given one or more equality (𝑔𝑖(𝑿) = 𝑐𝑖) or inequality constraints (ℎ𝑗(𝑿) 𝑑𝑗)
Vs.
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Vs.
Real-valued (parameter)/
Continuous Optimisation
Organising tour busses
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Example goal:
pack all items into minimum number of bins
Bins
Vs.
Items
minimum
Function Optimisation
Bin Packing
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Many real-world
problems are in
here
[1] http://cs.stackexchange.com/questions/9556/what-is-the-definition-of-p-np-np-complete-and-np-hard
[2] http://cs.stackexchange.com/questions/9556/what-is-the-definition-of-p-np-np-complete-and-np-hard/18666#18666
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Broadly classified
as:
• Exact/Exhaustive/Systematic
• Inexact/Approximate/Local Search
Methods
Methods
- E.g., Dynamic Programming,
- E.g., heuristics, metaheuristics,
Branch & Bound, Constraint
hyper- heuristics,...
Satisfaction,...
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
▪ Constructive
- partial solutions
▪ Perturbative
- complete solutions
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
deterministic ←→ stochastic
sequential ←→ parallel
▪ Dynamic Programming
◼ Branch & Bound
▪ Constraint Satisfaction
▪ Math programming
- ILP
- MILP
Limitations:
• Only work if the problem is structured and deterministic
– in many cases for small problem instances
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
• Quite often used to solve sub-problems
COMP2024 / COMP2039 Introduction 34
Example – Bin Packing Problem
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
▪ V=524
▪ n=33
▪ Item sizes (33 items to pack): 85, 442, 10,
10, 10, 10, 10, 10, 252, 252, 252, 252, 252,
252, 252, 9, 9 , 127, 127, 127, 127, 127,
106, 106, 106, 106, 12, 12, 12, 84, 46, 37
How can we solve this problem using
an exact method?
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM itemSize = #[ 1: 85, 2: 442, 3: 10, 4: 10, …, 32: 37, 33: 37 ]#;
binCapacity = #[ 1: 524, 2: 524, 3: 524, …, 33: 524 ]#;
COMP2024 / COMP2039 Introduction 37
Example
Performance Comparison of Different Branch & Bound Algorithms for Optimal Bin Packing
25 days
See http://www.aaai.org/Papers/AAAI/2002/AAAI02-110.pdf
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
▪ V=524
▪ n=33
▪ Item sizes (33 items to pack): 85, 442, 10,
10, 10, 10, 10, 10, 252, 252, 252, 252, 252,
252, 252, 9, 9 , 127, 127, 127, 127, 127,
106, 106, 106, 106, 12, 12, 12, 84, 46, 37
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
city2
4
city1
10
11
5 6
city4 city3
7
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
<city2>
city2
Select a starting city randomly
city1
city4 city3
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
<city2, >
choose the nearest
city2 unvisited city as the next
4 move
city1
10
6
city4 city3
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
5
city4 city3
7
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
city4 city3
7
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
• Other Heuristics
• Christofides' algorithm (1976)
• Match Twice and Stitch [doi:10.1016/j.orl.2004.04.001]
• Lin–Kernighan [doi:10.1016/S0377-2217(99)00284-2]
• Exact algorithm – Concorde:
http://www.math.uwaterloo.ca/tsp/concorde/index.html
• TSP benchmark data: [University of Waterloo]
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
• Shorter than expected periods for some seed states; such seed
states may be called 'weak' in this context.
1000th entry
E.g., 1000th entry
seed(12345): <0.19, 0.03, ..., 0.19, 0.03 ...>
• Lack of uniformity of distribution. E.g., 0.17 appears 100 times in
10000 successive numbers while 0.29 appears 5 times more
• Correlation of successive values.
• The distances between where certain values occur are distributed
differently from those in a random sequence distribution
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
2
1 1. Basic terminologies
2. Stages of decision making
• Module Content 3. What a model is
• Artificial Intelligence Method 4. The need for heuristic search/optimisation
techniques in decision support
5. The different heuristic search paradigms and be
able to identify topology of a given heuristics
ACK: Prof. Ender Özcan, UNUK, Dr Tomas Maul & Dr Chen ZhiYuan, UNM
Components of Heuristics
Search Methods and Hill
Climbing