I’m really struggling with this graph problem because the hard part is how to model the maze as a graph.
Please help me solve it in C++ or Python preferably with a known graph algorithm, the expected input and output of this graph problem will be explained below:
One of the attached images explains the graph problem and reads:
Our story so far: In Maze 7, Dastardly Dan had tried to sabotage Jumping Jim’s act by restringing all his trampolines. But Dan’s actions had the opposite effect. The audience was so delighted by Jim’s leaping about trying to reach the goal, that his act became the most popular of the circus. The circus owner decided to commission Dastardly Dan to create another, even harder maze for Jim to solve. Dan added more trampolines, restrung them, and painted large numbers on each to indicate how far Jim will move when he bounces off each trampoline. The painted numbers would allow the audience to study the maze and try to find a solution before Jim did. Dan also added a new rule that Jim had to follow. Certain of the numbers were painted in red and enclosed in circles. When Jim begins his act, he can move only vertically or horizontally through the maze of trampolines; he cannot move diagonally. However, if he lands on a red number in a circle, he must then start moving only diagonally, now he can’t move vertically or horizontally. Jim must continue moving diagonally until he again lands on a red number. He then switches back to moving only vertically or horizontally. And he switches each time he lands on a red number. Here’s an example to show how that works. Jim begins on the 4 at the northwest comer of the maze. From there he might move south four squares to the red 3. Now he must start moving diagonally. He might go three squares northeast to a 4. On the next move he would continue moving diagonally. He could move four squares southeast to a red I (i). That red number would cause him to switch back to moving only horizontally or vertically. Can you find a route that would let Jim land on the trampoline marked GOAL?
Please complete what the upload images request for the input and output of the program.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more