Skip to main content

finding Finding lowest cost path - dynamic

I have to write a dynamic algorithm for finding lowest cost path. So I have a pointspoint that I have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 I can skip).

Can you guys give me so hints, how to program it dynamiclydynamically? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution  (1->5 also there is a solution 1->3->5 but that's gonnagoing to cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know I can make greedy algorithm, but that's not the point of the task... Can you give me any hints? How to start? How to keep solutions? and find the best ones?

finding lowest cost path - dynamic

I have to write a dynamic algorithm for finding lowest cost path. So I have a points that I have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 I can skip).

Can you guys give me so hints, how to program it dynamicly? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution(1->5 also there is a solution 1->3->5 but that's gonna cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know I can make greedy algorithm, but that's not the point of the task... Can you give me any hints? How to start? How to keep solutions? and find the best ones?

Finding lowest cost path - dynamic

I have to write a dynamic algorithm for finding lowest cost path. So I have a point that I have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 I can skip).

Can you give me so hints, how to program it dynamically? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution  (1->5 also there is a solution 1->3->5 but that's going to cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know I can make greedy algorithm, but that's not the point of the task... Can you give me any hints? How to start? How to keep solutions? and find the best ones?

Fix case
Source Link
user40980
user40980

fniding finding lowest cost path - dynamic

this is my first post here, well i have a problem. I have to write a dynamic algorithm for finding lowest cost path. So iI have a points that iI have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 iI can skeepskip).

Can you guys give me so hints, how to program it dynamicly? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution(1->5 also there is a solution 1->3->5 but that's gonna cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know iI can make greedy algorithm, but that's not the point of the task... Can uyou give me any hints? How to start? How to keep solutions? and find the best ones?

fniding lowest cost path - dynamic

this is my first post here, well i have a problem. I have to write a dynamic algorithm for finding lowest cost path. So i have a points that i have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 i can skeep).

Can you guys give me so hints, how to program it dynamicly? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution(1->5 also there is a solution 1->3->5 but that's gonna cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know i can make greedy algorithm, but that's not the point of the task... Can u give me any hints? How to start? How to keep solutions? and find the best ones?

finding lowest cost path - dynamic

I have to write a dynamic algorithm for finding lowest cost path. So I have a points that I have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 I can skip).

Can you guys give me so hints, how to program it dynamicly? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution(1->5 also there is a solution 1->3->5 but that's gonna cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know I can make greedy algorithm, but that's not the point of the task... Can you give me any hints? How to start? How to keep solutions? and find the best ones?

Source Link

fniding lowest cost path - dynamic

this is my first post here, well i have a problem. I have to write a dynamic algorithm for finding lowest cost path. So i have a points that i have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for example (1 3 5 10 15 20 21 22). Each move cost me 1. So the best path will be to move 1->5->15->20->22 (3 and 21 i can skeep).

Can you guys give me so hints, how to program it dynamicly? I was thinking to make something like this: Find the solution for array[0] and array[1] (that's easy there is only one solution from to 1 (1->3)) then add array[2], and find the best solution(1->5 also there is a solution 1->3->5 but that's gonna cost me 2 moves) then for 4 points, 5 etc.

But don't know how to start to make my algorithm to be written correct and dynamic. I know i can make greedy algorithm, but that's not the point of the task... Can u give me any hints? How to start? How to keep solutions? and find the best ones?