 Hi guys Suppose you want to visit all the city all the capitals in Europe so we want to visit a Reykjavik and Brussels and Moscow and all of the others in between and we want to do this in the shortest routes possible of course because if we would do a route something like this then we would have to do a distance of over 690,000 and This is just nuts of course You're not going to fly to Moscow just to get back to Amsterdam and just to go to Somewhat later you you won't do something like this, right? so this is a tour of all this of all those capitals and It's pretty good solution already because we have we now have to do a distance of about 254,000 the question is is there isn't there anything shorter to do that and The problem is that unlike finding the fastest route between two cities say from Brussels to Rome There isn't really an optimal Algorithm for this which can do that in we could find which can find an optimal solution in feasible time independent of the solution size and the number of constraints really so That's why the rules planner helps you find the find a good solution And it actually has several algorithms which can do that for you And you can basically play with all of them and see which one fits bets for your solution for your solution size as well as your Solution constraints, so let's take a look So let's start from an empty solution. Let's let planners solve this as you can see it pretty finds the constriction solution pretty fast, but it's actually improving upon that with meta heretics and As we give it more time you can see that the distance to travel to visit all the cities actually lessons, so that's fuel we save and which is also the environment that we save of course because we because we lower our ecological footprint Now given it enough time given some time for a couple of seconds. We're already at 215,000 which is a lot less than 250,000 There's actually not going to get any better than this. So let's let's stop it now The thing is of course that If you if these well that the reality changes, of course the thing is of course that the reality changes So for example while we're solving It could be that we decide to visit a couple of other cities too So let's say we want to go get a tan in Marseille, which is about there So if you click on there, it's just going to add that real time So let's say you want to do Barcelona too. No problem Now as you can see the rules planner actually picks it up and adds it to the route without the problem Let's go to Edinburgh too My hometown Ghent right here and of course Bruno, which is also a big city for redhead and Here we go. No problem. So this is the quickest tour to visit all the capitals and those few extra cities I've been thinking about so Let's stop that and let's start again and Let's suppose we Did the rules change? Let's suppose we don't want to find the shortest route to visit all these cities But we want to find the shortest route Given the fact that we have a free ticket from anywhere in Europe to fly to a wreck like a big So it doesn't matter where we come from we can come from Athens or Kiev we and the flight to Reykjavik is free And it also There's no environmental. Let's suppose. There's no environmental impact either. So Let's go to our program our our code and What we have is here we have the Pogio for the city so city has a certain latitude and longitude and certain name from example Brussels or Reykjavik is the name and Then we have an Appearance so an appearance is a place where the salesman Appears so a city where he appears. So there are two Forms of the appearance. This is basically the domicile. That's a place where the salesman actually lives and the Visit that's the place where the salesman visits. So if you look at our Map right here, we can see that Brussels is a domicile It's in red and all the other places are just visits for the salesman Now if you look back at the visits, you'll see that that doesn't only have a city But it also has a previous appearance. So that's a link to the appearance coming before it And that's the thing that we want drills planner to change To find the best order in which to visit them, of course Now if you look at the rules, which basically There are two rules and the first rule is basically every time we visit a city We're going to have to pay the distance to travel to that visits really so That that's pretty obvious for all of for each visit that we do we have to get a plane there And then the second thing is The second rule is from the last visit. So from the visit which has no visits After it you have to fly back home, of course to the salesman have to get has to go home again So back to its domicile. So and then we're going to then we're going to add that distance to of course now let's suppose That we can fly from anywhere in the world to from anywhere in Europe to wreck with it for free So we don't want to pay so we don't need to pay that distance if We're going to Reykjavik. So if the visit the city we're visiting is The is different from Reykjavik then we have to pay it. Otherwise, we don't have to pay it So let's see what that was the result of that. So I'm going to close this and I'm going to start the example again I'm going to Start again and we're starting going to start solving it now The first thing that you can notice here is because we changed the rules of the game That is giving us a different solution and it's quite clear what's happening here as you can see the There's a trip from Moscow to Reykjavik and that's the trip. He he doesn't have to pay So so that the trip we don't have to pay. So he's going to and apparently Toolspanner found out that if you just take that from Moscow to Reykjavik then that's Probably the best the optimal solution now if we can give it more time, maybe it's the site to Really to change it to Nikolaus Nikosia or Istanbul or something but Given these cities that he needs to visit he apparently decides it that it's far better to go To Reykjavik and let's try it. Let's see if we can add a couple of City cities to make him change his Mind like this rank. Here you go. Now it's going to Nikosia so because of course we need to visit these cities to and then it's more interesting take it from Nikosia So that's a real spanner now if you want to have more information learn more about that. Well, just Go to the website. It's On the on jables.org, of course, and it's a Java open source and then under the Apache license. Thanks for watching