In the small Village of Know Where. The village is made of 13 houses (nodes) and 18 roads (edges) with distances (weights) which total to 404 kilometeers.
Each node is a House, or a company, or viewing center or shop. The edges are the roads that lead to those edges and the weights represents the distance of the roads in Kilometers.
The village is small with but the people in there are so lazy, that each person delivering his/her parcels to their neighbours seems pretty much like a big job even taking their mails to the Post office for delivery is no do. The citizens like to be alone doing what they like best, all best known to them.
Even most Post Office officers ( Postmen ) seems lazy except me though 😂🤣 the manager of the Robot Brain Program ( RBP ) a subsidiary of Robotic Company ( RC ) the other is Robot Brawn Building ( RBB ) (they build the Robot Body). Which are all located beside the Post Office.
Our job in this company is to build robots that go to each house, shop etc, carry every parcel, goods, presents and deliver them at their respective addresses.
This takes the burden of the villagers taking their mails, parcels even presents and gifts to the Post Office and the postmen delivering them.
Since the launch of the first Robot. Both the postmen and the villagers have become more lazy.
Because all what the Villagers do is lodge in into the Robot App. ( Which was built by the RBB department ).
register their parcels, provide the location and the delivery address of the parcel.
Then the Robot after reading the registered parcels in Robotic App.
Firstly Robot decides to go out to the locations of every parcel and carry it. It might deliver some on the way but its aim is to first carry and gather all the parcels before trying to deliver them to their respective addresses. Normally, it cannot deliver what it hadn't carried. Secondly the Robot decides to go deliver all parcels at their respective addresses.
We've programmed four Robot's Brain so far.
This is really an inefficient Robot in that:
The Robot Brain was programmed based on the assumption that at one point in time the robot after wandering the whole village multiple times would get to location and address of the parcel.
It implements the Math.random() function. This make it move to a random (or any ) location making it very unpredictable.
Although, it had the data about the locations of the parcels and even the total number of parcel to be delivered, it did not have the memory about perfect route to get to its destination.
It did not have the memory of its last visit for example it might move from Market to Farm and back several times (which is pretty, pretty far) before deciding to go somewhere else. Which would usually lead to great a number of turns and distance moved. Whereas other villagers would be waiting for parcels to picked or/and delivered.
The above disadvantages usually lead to villagers not receiving their mails and parcels on time. This gave us thousands of negative feedbacks
This Robot Brain was developed to solve the negative feedback we were recieving from the villagers.
Normally, before the advent of any these robots. The postmen had a fixed route around the Village. This make their movement to be predicted ( The villagers knew where they would be at given time of the day).
All we did was make the Robot simulate this behaviour. The Robot would move around the Village two times. With the knowledge that it would carry, and gather the parcels in its first movement around the village and would deliver them the second time. These reduced the turns of the Robot to a maximun of 26 turns and 2 x 402 = 804 Kilometer distance.
Moreso, the Robot Brain make the Robot remember its previous visit and would know its next visit due to the memory installed but it could not get its own Route around the Village beacuase the route had been hard coded in its memory.
Although, the feedbacks from the villagers were positive at least they got the simulation of the postmen service, which make us happy for a while. But this would be cut short as new buildings (a lot of them --new Nodes--) were been built in the Village. The Village got advanced, more infrastructure. The map (Graph) of the Village got more advanced in terms of size.
These give even more problems than R.R.R in that:
Still though the F.R.R would move at a much lesser turns and distance than R.R.R to get the Job under the same conditions.
This problem got us to the program room for new ideas.
After so much deep learning (I'm kidding right 😂🤣) we built a Robot Brain that could learn by it self (please flow with the vibe 😂). This Brain would later be one of the two most efficient Robot Brain. It learns by using the data of the Village map (graph). This Robot Brain was pretty advanced in that:
This was a mind blowing program which was almost perfect and was loved by the Villagers but it had a short coming. let's face it. A Robot that gives no regards to numbers (distances) is no efficient robot at all. This would lead us to program another Robot Brain to resolve this issue.
S.R.R does what G.R.R does but better. It is currently the Robot used by the Know where Villagers. It generates shortest route to its destinaton from its location by considering each next house (node) and the distance between its location and these next houses (nodes).
This was so because the Robot implements BFS and Dijkstra's Algorithms. Making it the most efficient Robot Brain for now.
For example: Given a parcel at location of Market and delivery address to be Farm which is 100 kilometer far from each other.
G.R.R will move thus:
Post Office ==> Market (carry the parcel) then head straight to Farm to deliver it. thus traveling a total distance of 105 Km and with 2 turnings.
S.R.R on the other hand will move thus:
Post Office ==> Market (carry the parcel) ==> Emmy's House then to Farm to deliver it. thus traveling a total distance of 23 km with 3 turnings.
The Know Where Villagers are praising us because we've solved their problem. And I'm Happy.