The texts are available at the Hargrave. The main text is about $100.
Check the online list of books for an idea of things to read if you want.
So that's problem solving... [the prev lecture]
Greedy search is the simplest kind of heuristic search.
We have the Travelling Salesman Problem (TSP)
Constraints
You want to minimise distance.
You only visit each city once.
You can make either of the constraints soft or hard.
SAT stands for satisfiablity.
Given a Boolean expression, is there an assignment of variables which makes the expression true?
Can you plug in values to make the evaluation of the expression true?
In order to solve this problem, you need to not leap through the SEARCH SPACE but go through it bit by bit by flipping itty bitty bits.
If you were going to start a search tree it would look like
You can change an expression into this form easily (polynomial time)
Then you do a few tricks and hey presto you've got something to put in your eval function for this problem ;-)
NLP
That's the messy mathematical one, but I think I actually kind of like it I was looking at it and imagining it. Sweet I think I'm finally 'getting' math.
Next Lecture. Ahem.
WHY analyse Algorithms?
You need to know how fast it's going to go, and how much space it's going to take.
It's part of the science of computer science.
There are different and common Orders for algorithms.
Constant Can't really do much with this. Return 3. bleh.
Logarithmic
Linear
Log Linear
Polynomial Generally speaking, here's the balance of useful / reasonable in terms of time and space.
Exponential
Superexpodential
So we usually want to know which one our algorithm falls into.
When we have to look at everything, we have something like O(n).
We can also think of the average case.
U[1,n] (Uniformly distributed across the list)
It's going to be (intuitively) somewhere in the middle. We can prove it mathematically but we're not going to bother.
What about an ordered list?
Someone's gone to all the trouble of ordering it. But with the same algorithm, the worst case won't change. Still linear. But in some cases the average will change.
"Logs come from Trees"
If you can look down one branch, can have log. It's also called 'divide an conquer'
When the algorithms are easy the analysis are easy.
So here's an algorithm to analyse algorithms.
You've found your problem, you've modelled it, and made your algorithm to solve it... then you want to know if it's any good.
We measure process time, not calendar time, and you only have the one process running. You track what the input sizes are, and then you come up with this crude kind of graphing mapping. And then later we'll use this to think about big O notation etc.
Empirical Program Testing.
There are problems where the analysis is far too difficult, so this is the only way to do it.
This
The best exact solutions are exponential.
0 Responses to “Lecture 2”
Leave a Reply