Dijkstra's Algorithm Exercise: Find the Solution!

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion revolves around a proposed exercise related to Dijkstra's algorithm, focusing on finding the least costly route for a character named Grandpa navigating through various obstacles with different point costs. The scope includes conceptual application of the algorithm in a hypothetical scenario.

Discussion Character

  • Exploratory
  • Conceptual clarification
  • Mathematical reasoning

Main Points Raised

  • One participant requests a challenging exercise related to Dijkstra's algorithm.
  • Another participant describes a scenario where Grandpa must navigate from the top right to the top left, detailing the point costs associated with various actions (moving, eating candy, encountering monsters, etc.).
  • A participant questions whether revisiting a previously visited spot incurs additional costs, presenting a hypothetical sequence of moves and their associated point costs.
  • Another response suggests that returning to a previous spot would indeed cost additional points, indicating a cumulative cost based on the actions taken.

Areas of Agreement / Disagreement

The discussion contains multiple viewpoints regarding the costs associated with revisiting spots and the application of Dijkstra's algorithm, indicating that there is no consensus on these aspects.

Contextual Notes

Participants express uncertainty about the rules governing point costs for revisiting spots and how these rules interact with the application of Dijkstra's algorithm.

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)
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
14
Views
3K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
9
Views
3K
  • · Replies 46 ·
2
Replies
46
Views
7K
Replies
3
Views
2K