 So one of the things that we want to do with our agents is essentially this big fancy $5 word called problem-solving and We want to do this in a number of different ways, but the first one we're going to focus in on is sort of a little bit of a review from 316, but this idea of Searching and specifically as you can sort of see from the terminology It's something that I'm calling an uninformed search The way you can think about this is that I have some kind of goal that I want to achieve I want to find the best configuration. I want to pick the best move You know some type of goal condition to be met, but the problem is I'm at some form of a starting point and when we look at that idea of something being an uninformed search the issue is that when I'm looking around I don't actually have sort of General sense of where that goal could be this starting point and this search may actually have Branches out that are leading down their own Pathways that aren't getting me to the goal and so I have to kind of do this And so when we think about that idea of problem-solving just very quickly, you know Some problems are already solved. You know the distance between two points you plug in this formula It takes care of it But when we're dealing with that searching sort of mechanism One of the biggest issues is that it can become very large or even infinite a way to think about this is again let's think about the idea of just a Rook in chess for a second There a rock how many different moves can a Rook do well it can go to the left It can go to the right it can go down it can go Forward or up and it can do this any you know amount of times as long as it doesn't hit another Marker and if it does and it's the other team obviously you take the piece But more to my point when we think about sort of that that pathway and specifically when we are dealing with something being infinite a Rook could go up and then for whatever reason, you know The opponent does a move then the Rook goes down and you know Ignoring other parts of chess where you know stalemates can occur The Rook can just do this back and forth for the rest of eternity And so that's kind of a big issue especially when we're trying to find again that mythical Goal that we have to somehow search all the possible Moves that pieces can do to find and so that's actually where we start to kind of get some terminology to at least kind of focus in on this idea of our search space and then specifically our goal Condition again that idea is that the search space is everything from the starting point and all of what we would call It's branching out points so all of those possible moves that I could be doing at chess and then Specifically when we think about so again chess that idea of the goal would be a checkmate But more specifically a checkmate in sort of my favor rather than not my favor And so again, we want to search until we find some pathway From that start to that goal a good example of this is let's use this as an Simple example This is all of the airports in America for the sake of my example I'm not going to build this graph for all of them. That would be insane But more specific to my point. I want to get a pathway from Raleigh Durham all The way over to Seattle now. What are all the different paths that I could take well We could take sort of the one that's intuitive to us as people and typically is the one a lot of people take And that would be oh well I can take sort of this Transition flight from rdu into Charlotte, which is then going to take me all the way to Chicago And then I just sort of take a four-hour flight from Chicago to Seattle Yeah, that is one solution, but that's not the only possible solution And in fact, this is technically a solution going from rdu down to South Carolina Charleston then into Jacksonville, Florida Why not stay in Florida for a little bit? Do you know what I mean? Where we hit Panama City and Pensacola, then we jump back to Atlanta to Tulip. Oh, Tulip. Oh What? Memphis Dallas Denver Salt Lake City and then finally Seattle Both of those are going to get me there. And so both of those paths Are Valid they took me from my starting position and led me to my goal condition Now when we think about sort of our Agents and designing out intelligent Systems that's actually where sort of that performance measure starts to come into play again If we're thinking about sort of that real-world circumstance of I want to book a flight from The East Coast to the West Coast some of the things that I might think about are something being the shortest possible route And you know, I only want to be in the air for eight hours out of you know 16 right, I don't want a lot of layover. So obviously this route Takes me there again. This one also would help out if the goal condition was to minimize the number of hops So I don't like to be in layover. So again, I want to try my best to do a non-stop I don't have that option here. And so again The best I can do is only having to stop into two airports along the way but sort of the Counter to that is, you know, some people it's about cheap I don't mind if I have to go from rdu to Charlotte to Memphis to Kansas City to Denver to Salt Lake City then to Seattle because it's $200 less and I Got time on my my plate. So again, that is another Potential solution that I could be where are you? There you are. That is another possible solution that I could work towards and so again when we start to think about this idea of Searching it's sort of a cat and mouse game. Think about it like the Options that you learned about when we were dealing with linear versus a binary search Both of them are gonna get you sort of to that ultimate path Again, if we're thinking about this from searching a list I want to see if an item exists in a list and where it is. Well, both of these will do it linear will do it in O of in and if our list happens to be sorted we might be able to achieve some sort of Sort of boost in efficiency through that binary search and we'll see a few of these different sort of points along the way So when we start to think about that idea of search and one of the things you've seen a number of times already is I have driven I've drawn out these different little lines sort of coming out of my starting point And what we look at that is sort of what I'm forming is something that we call the search Tree now the search tree again is all the possible sort of actions or moves of our agents so moves as well and Again, we're just exploring them almost as if this is the next action I'm doing During the search process one big thing that you may have noticed is that? Technically speaking I can go back to rdu. I could hop over from rdu to Charlotte and then right back again This is that Rook and here's just a minimalist design of a Rook That's that Rook design where I could go up and then I could proceed right back to my starting location Because there's no nothing stopping me from doing that in the system Again, it depends on what your sort of strategy is in a game of chess You may want to go back to places versus when you're dealing with airports and trying to get from one Side of the states to the other you don't really want to go back At all and I don't think many airports will let you it then unless you do a round-of-trip either way My point being is at least for the sake of my demonstrations I'm going to work off of an assumption that we don't have sort of those moves available So I don't have sort of the ability to go to rdu in the case of many of the examples I'll be working off of So just a little bit of a different kind of look we've seen sort of that idea of chess We've seen that idea of sort of the airport But one that I would like to present is this idea of something known as the in Queen Problem now in Queen problem and what you could probably see from the pictures is I have some number of Queens in this case I've got four Queens and I happen to have an in by in board or in my case a four by four board The sole purpose of sort of this problem this little thought experiment is can I position those Queens in such a way that? They're not going to be able to attack each other and if you look at sort of this good Example again that Queen can go up Down left and right or in a diagonal motion and in each one of the possible moves that this One piece can make again. You can see it's not going to attack or hit any of those other Queens Versus sort of a bad configuration. This would not meet our goal condition We do have two Queens that could collide with each other But one of the things is again if we're trying to design an agent to solve this out It becomes a search and so what we're looking for rather than it being sort of that goal of I need to find a Particular location is more this idea of something becoming a target location. I could start with sort of my I'll use a three by three just for the example sake. I could start with sort of this three by three Board and maybe that first Branch in my search is deciding which one of the I don't know I'll say rows do I work off of so this could be row one this could be row two and this could be row three and Then all of the branches Sort of at this level could be referencing column one Well, let's arbitrarily say that I have selected sort of this first pathway So column one is going to say let's see what happens if I explore How do I there's a queen row one well, can I then branch out could I put in column two Row one or could I put in column two row two or could I put in column three? Row three so or sorry column two Row one row two row three. Well, let's see I couldn't do this this one is going to be invalid I couldn't do this one because again, that's also going to be invalid But I could potentially put it here at the bottom where sort of my left and middle Queens aren't going to hit if I keep on panning this out. You'll see that I actually can't solve it on a three by three grid, but it's good enough for demonstration sake and that actually sort of presents me with sort of my last little takeaway to start is We're going to be seeing a lot of grids in sort of this course. They they present a good Novel way to help wrap our brains around things and you can tell oh, well, you know I could move to this location to this location to this location tile tile tile I'm at my goal tada But one of the things that you could think about is when we're dealing with say for example Sort of these two points the starting point and sort of that that b6 What we're really dealing with here is an idea of it being Sort of two different tiles one of them happens to be my tile My starting point and then there's some kind of relationship Going on between these where in this case they are neighbors. Oh, I have an edge suddenly Going on between them and then you could see that there's technically another edge Going to the up neighbor And then let's say from b6 b6 also has its own up and to the right so up and to the right And that's a different way we could explore things So the way you could think about that again taking that same grid idea These lines are just sort of represent representing the idea of something being a Neighbor And one of the things that you can also think about is again I'm working off of the idea that these are all weighted as a one But there's nothing saying that oh, well, you know if I'm dealing with Different terrains and say a video game sense. There's nothing saying that this terrain Transition couldn't be two and then this transition couldn't be four and this couldn't be five Maybe i'm going up a hill and then now i'm going Down a hill so three and then a two Two One one right i have to traverse this giant mountain before i can get the goal Or i could take sort of this scenic route where uh, it's a nice little koreen Maybe a two here just to change it up Right i can have different pathways and we'll see sort of this action a little later on but both of these paths will again lead me to Sort of my route