Professional Documents
Culture Documents
Wikipedia says: In computer science, a heuristic is a technique designed to solve a problem that ignores whether the solution can be proven to be correct, but which usually produces a good solution or solves a simpler problem that contains or intersects with the solution of the more complex problem.
Heuristics are intended to gain computational performance or conceptual simplicity, potentially at the cost of accuracy or precision.
Huh?
Basically heuristic algorithms solve really difficult problems reasonably well (which is pretty subjective) in a reasonable amount of time (also pretty subjective). Examples of problems that are tackled with heuristic algorithms (more on these in Matts lecture on Friday):
2D packing an example
2D packing an example
1 2 3 4 5
Sequence = 1,2,3,4,5
2D packing an example
1 4 3 2 5
Sequence = 1, 4, 3, 2, 5
For 5 pieces there are 5 x 4 x 3 x 2 x 1 different orderings for the placement = 120 combinations Piece of cake for a computer to try each combination in (nearly) no time at all
(50 pieces)
Heuristic algorithms
Cast your mind all the way back to the second slide. Maybe a heuristic algorithm would be good for tackling this type of problem? (commonly known as a combinatorial optimi[s,z]ation problem) I hope so! (my PhD depends on it)
My current research
The 3-D strip packing problem Given a container (a big box, a lorry, an aeroplane cargo hold etc) and a number of boxes to load inside the container what is the best way to place them all so that they take up the shortest (height) space as possible?
Gap
1 Gap
Gap 1 X
2 1
Gap
X
2 1
3
X
Gap
Gap 2 1
X X
4 2 1
3 3
X X X
Gap 9 12 10 6 11 4 3 7 5
8 32
1 9 12 10 6 11 4 3 7 5
8 32
9 12 10 6 11 4 3 7
8 32
5
1 9 12 10 6 11 4 3 7 5
8 32
old height
Improvement new height 1 9 12 10 6 11 4 3 7 5
8 32
A) 4 x 3 x 2 x 1 = 24 different orders
Examples of metaheuristics
Hill climbing / Greedy search Tabu search Simulated Annealing Genetic algorithms Ant colony optimisation many more
Explanation part 1
Explanation part 2
Explanation part 3
Advantage of metaheuristics:
Generally produce higher quality results (given enough time) than simple heuristics
They take a lot longer as they have to generate and evaluate many solutions rather than just one
Disadvantage:
So now we have g (the harder function to define in this case) lets define f
f() simply returns the highest location in the packing when placed in a bottom right way E.g. f([1,2,3,4]) = 6
4 2 1 3 6 units high
6)
7) 8)
9)
Iteration 2: g([1,2,5,4,3]) = [2,1,5,4,3] f([2,1,5,4,3]) = 13, worse than our current best so ignore this order Iteration 3: g([1,2,5,4,3]) = [1,4,5,2,3] f([1,4,5,2,3]) = 10, our best so far so we keep this Return [1,4,5,2,3] as our best solution
Demonstration/Questions?
http://www.cs.nott.ac.uk/~sda/viewer.zip