MHB Dijkstra's Algorithm Exercise: Find the Solution!

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread Summary
The discussion revolves around creating a challenging exercise based on Dijkstra's algorithm, focusing on a scenario where a character, Grandpa, navigates a grid to reach a parking spot. Each movement has associated costs: moving costs 1 point, encountering monsters costs 5 points, moving through coffins costs 2 points, and passing through jelly costs 10 points. Eating candy restores 3 points. A key question raised is whether revisiting a previously visited spot incurs additional costs. The consensus suggests that returning to a previous spot does cost points, as it adds to the overall movement cost, emphasizing the need for careful route planning to minimize expenses. The conversation highlights the application of Dijkstra's algorithm to determine the least costly path in this context.
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hi! (Smile)

Could you give me a difficult exercise that is related to the Dijkstra's algorithm? (Blush)
 
Technology news on Phys.org
evinda said:
Hi! (Smile)

Could you give me a difficult exercise that is related to the Dijkstra's algorithm? (Blush)

Hey! (Blush)

gz1.jpg


Grandpa starts at the right top and wants to reach his parking spot on the left top.

Each step costs 1 point.
Eating candy restores 3 points.
Running into a monster costs 5 points.
Moving through the spot with the coffin takes 2 points.
And if grandpa tries to move through the spot with the jelly, it takes him 10 points to get through the sticky goo.

How should we apply an algorithm to find the least costly route? (Wondering)
 
I like Serena said:
Hey! (Blush)
Grandpa starts at the right top and wants to reach his parking spot on the left top.

Each step costs 1 point.
Eating candy restores 3 points.
Running into a monster costs 5 points.
Moving through the spot with the coffin takes 2 points.
And if grandpa tries to move through the spot with the jelly, it takes him 10 points to get through the sticky goo.

How should we apply an algorithm to find the least costly route? (Wondering)

Does it cost points to visit a spot you'e previously visited. So if you go from $a$ to $b$ to $c$ that would be $-3$ but if you went back to $b$ from $c$ would that cost another point? ($-4$) or no?
 
shamieh said:
Does it cost points to visit a spot you'e previously visited. So if you go from $a$ to $b$ to $c$ that would be $-3$ but if you went back to $b$ from $c$ would that cost another point? ($-4$) or no?

Riding from $a$ to $b$ to $c$ would be $-2$, since it's 2 steps.
Riding back from $c$ to $b$ will tire grandpa more, so it will indeed cost another point ($-3$). (Mmm)
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
Back
Top