 So, in the previous video, I introduced two separate heuristics, H1, which looked at sort of this idea of how many tiles are in a misplaced location for our sliding puzzle problem. So if, for example, I had my three tile, my eight tile, my seven tile, four, one, two, five, one, two, three, four, five, and six in this place, again, if we're looking at it from this first H1 heuristic, we're simply counting the number of tiles in the wrong place. So one, two, this should be a two, that should be three. I think all of them are in the mis-wrong places, that one doesn't count. So we would get an H1 equaling an eight. But then we also looked at a second heuristic, this idea of using Manhattan distance and the summation of how far it would take to get all of these tiles into their respective locations. So again, if I just quickly run through them, right, an eight's already in the right spot here, so this is technically a seven. So again, if we look at sort of that one position, that would take one plus six, six needs to go, let's see, down one, two, three, four needs to go one, seven needs to go down one, two needs to go up one, three needs to go up one, five needs to go up one, and eight can stay. So what we're dealing with is one, two, three, four, five, six. So an H2 equaling nine. Okay, once again, I've created these numbers, right? I have a seven, I have a nine, but which one do I pick? That's the ultimate goal, right? I have these different heuristics that I could work off of, which one do I select? And, you know, there's really only one way we can find out and that's by implementing both of these and then testing them out. And what we would actually see if we were to run through both our H2 and our H1 is that over time, H2 almost always outperformed H1 when we were working off of an A star search. And just to see this in action, this is from sort of the textbook, you can see again, we had H1, if that was the heuristic we were doing with A star, you know, at the start, when we have a very small, easy solution, then, you know, right now, there's not a major difference between H1 and H2. But notice as these steps increase as we get into more complex problems, that just counting how many tiles are in a misplaced space is going to, you know, ask us and require us to do hundreds of thousands of considerations. Whereas if we look at H2 using the Manhattan distance formula, that's actually going to only kind of take us into the tens of thousands. And so, yeah, we now have run our different heuristics, we see that H2 is the better of the two. And that's the one we would go with. Ta da, we're done. That that that seems odd. And it doesn't really help. And in fact, what you can actually recommend is what if you just combine them. And the idea here is if we think about this, again, we had that H1 spitting out a seven, and then we had some H2 spitting out a nine. But what happens if I had another heuristic, I figure out, you know, I can program if Jupiter is in retrograde with Mars. And that turns out to be a heuristic and that turns out to make, I don't know, a 13. Well, the big idea is when we're looking at these heuristics, the key thing is we simply don't want to overestimate. Do not overestimate. And if our sliding puzzle problem, again, if we sort of dig through my older video, if it had a move set of roughly speaking 22 steps to find the solution, each one of these is, you know, technically going to get me there, if especially if the, you know, Jupiter in the retrograde one can figure out ways to get towards the solution. My point being is I have all of these potential solutions, and one may be better than the other or maybe underestimating a little too much. And so one solution that we could do is rather than just working off of one single solution, right, I know that that's how you want to do it for like assignments because grades. But if we're looking at it from I need to use this in a real world situation, what if I simply say, let me take the max, whatever the biggest number is of my heuristics, and that's the one we work off of. A good way to think about this, it's kind of like the price is right, especially in this sort of part of the game where part of the show where contestants come down, and they have to bid on the price of some thing, you know, a dishwasher, a car, I never think it's a car, an armoire, whatever, my point being is the game at this state is to guess as close to the price as possible without going over. Now, if we assume that each one of these people are a perfectly good heuristic and they would never go over, right, I know that's not how the game works in real life and people are not good heuristics. But if each one of these are trying to get as close as possible, and they know, you know, a certain number to not go over, because again, we would consider them admissible, then each one of these, again, if we're taking the max of these sort of estimations, oh, well, you know, this 825 is getting me super close to our goal without going over. And so we would select this individual who is clearly happy that I think they won. I don't know. My point being is, again, if we're starting to look at this, again, we're looking at the big idea of not overestimating. So this approach of a 700, all right, we have 700 steps that we have to take to get to our goal, that's pretty good. But again, another heuristic saying, well, we have 800. And one more is saying that we have 825. And if that's again, how many steps it takes, that's perfectly fine. One thing to take note of is obviously, you know, we've got the one person in the price is right, who always bets $1. Technically, it's a an admissible heuristic, you know, it may not be the best one. But you can see that again, it's not overestimating how many steps it's going to take us to the goal. It's underestimating to some degree. But again, if I'm taking sort of the max of all of these, you know, in this situation, sure, they're not the best one to pick this time around. But again, we've got one that we can work off of. And so again, that allows us to sort of get us closer, utilizing this max approach. Now, one thing to sort of think about is again, I sort of introduced, oh, you know, what happens if I have some H3 that works off of, you know, retrogrades of planets in astrology? Okay, that's not realistic. But what if I want to create some other types of heuristics, because I may not always be working off of a star, right? I may not may not be working on distance. That's really what we're kind of looking at here. Sometimes the problem is not this just how far away I am in traveling kind of perspective, right? The grids doing even the airport algorithm or example, those were again, working off of a distance. But what if I wanted to work off of that sliding puzzle, it's not 100% distance, we're starting to kind of break away from just a straight kind of shoot. And so that's where we look at this idea of relaxing out our problem. The entire idea to relaxing and what all this text is kind of stating is remove some of the restrictions. When we think about any sort of puzzle, right, where we typically have some restrictions or constraints, which we'll see a little later on in videos. But the entire idea is, well, to make a heuristic, what if we just strip away some of those constraints, because again, that's producing some estimate if we're in sort of this perfect world. Here's a good example, right? If we're thinking about the sliding puzzle problem, there's sort of the real world kind of definition of what it means for a tile or a particular tile to move to another tile. So in that sense, right, again, we're making sort of the rule, a tile can only move from one tile to another, right, this two can only move to be if the two following statements are in place. A is horizontally or adjacently or vertically adjacent to B, aka B could only be sort of in these separate locations, because a has to only work in a horizontal or vertical direction. It's like a rook in a chess game. That's the only way it moves. The second rule was B has to be blank. And again, we can think about that in that sense of like, you know, if there was a five here, or even if let's arbitrarily say, if B was here, and there's a five, I can't move there. Something's already in the way. So those are sort of at least some simple rules or restrictions that the sliding puzzle problem has. But again, what we can do is we can say, let's strip away some of these restrictions, let's strip away that B has to be blank. Now, again, if we're looking at that same idea that we have a two here, we have a five here, I want to move here. Well, that's perfectly fine. I'm perfectly allowed to move and have two numbers in the same location. Again, this isn't the real world sliding puzzle problem where it's a physical thing blocking, but it's just sort of relaxing out our problem. We still say that two can only move in sort of the cardinal directions left, right, up and down. But we've just said it can move into places that are perfectly already filled. That's perfectly fine. That's one sort of relaxation. Well, if you can sort of take this relaxation, you might already have an idea of what else we can do. What if the only restriction is B has to be blank. Now, we've removed sort of that cardinality rule. And so two, as long as say this portion, this center portion is blank, two can move there. It's perfectly, we're just saying, yeah, it can move there. It's kind of like now it's a queen, or rather a superpowered queen, because two could technically also move to this location. There's, you know, we're not restricting it by any sort of dimensions. We're just saying it can move to these spots. And sort of the last little one that we could operate off of is what if both of those were stripped out? Then, you know, again, a tile can move from A to B. There is no if going on there. All of these are again, just sort of relaxing out our problems. And what we can start to think about is those turn into heuristics. Each one of those is turning into their own heuristic. So if we said that again, that that first one is still working off of the idea of adjacency, right? Well, if you think about that for a moment, that's very similar to how the Manhattan distance problem is working. You know, we're just looking to see based on some kind of going up and down or going up or down and then left or right. That's it. It as long as we're adjacent, it's perfectly fine. It doesn't matter that B is filled already. So we've already sort of seen this approach. And just to jump a little down here, this one where we strip out everything, that's technically just our H1 number of misplaced tiles. Again, what we're looking at in this context is again, if tiles are just free to move around, then it's just a matter of which tiles need to be swapped. And then finally, that last one where we're sort of only worried about B being blank. Well, that could be sort of a mythical new heuristic that I would call very similar to our straight line heuristic that we saw in the A star problem. Again, we're just kind of operating with this idea that this tile needs to be moved into this tile. As long as B is blank, it can. And so let's make the B line for it. So each one of these, again, I have a new heuristic that I've been kind of brewing. The only way to see if H1 is better than H2 or if H3 is better than H2 is to test them out or build all of them. Just build them all. Again, it's not the end of the world. If you do it, and then take out the max, whatever that max happens to be, that is your H.