Click here to Skip to main content
15,560,126 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Routing algorithm Pin
Rocks10028-Jan-20 12:36
Rocks10028-Jan-20 12:36 
AnswerRe: Routing algorithm Pin
Gerry Schmitz29-Jan-20 4:34
mveGerry Schmitz29-Jan-20 4:34 
QuestionAnalysis of Algorithm Pin
Zain Shoukat Sadozai22-Jan-20 20:46
Zain Shoukat Sadozai22-Jan-20 20:46 
GeneralRe: Analysis of Algorithm Pin
Richard MacCutchan22-Jan-20 23:03
mveRichard MacCutchan22-Jan-20 23:03 
AnswerRe: Analysis of Algorithm Pin
phil.o23-Jan-20 0:04
mvephil.o23-Jan-20 0:04 
QuestionComputing FIRST and FOLLOW sets in LL(k) parse tables for k>1? I need resources Pin
honey the codewitch29-Dec-19 1:31
mvahoney the codewitch29-Dec-19 1:31 
QuestionFinding best knapsack solver Pin
Member 1469867124-Dec-19 0:42
Member 1469867124-Dec-19 0:42 
QuestionOptimal path searching question Pin
nameless reborn5-Dec-19 20:45
nameless reborn5-Dec-19 20:45 
Here is the question requirement:
There is a map shown in below

WWWWWWWWWWDW
WWWW    S  W
WWWW WWWW  W
WWWWSWWWW  S
WWWW WWWW  W
B   ES  E  W
WWWWWWWWWWWW


W is the wall that the player cannot move to
S is the score can the player option
E is the energy can gain
B is beginning point
D is the ending point

First, player has 0 energy and they need to go to E to gain energy first. Then when they gain energy, they can go to S to gain score. However, every E and S contains different energies, energies required and scores. Here is the clear description of the map:

<5 0> is B (Begining point)
<5 4> is E (energy point, contain 20 energy)
<3 4> is S (Score, require 6 energy to gain and contain 30 scores)
<5 5> is S (Score, require 2 energy to gain and contain 230 scores)
<5 8> is E (energy, contain 30 energy)
<3 10> is S (Score, require 16 energy to gain and contain 30 scores)
<1 8> is S (Score, require 8 energy to gain and contain 10 scores)

The final score is in this formula:

energy + scores - steps*2

The best path is B -> <5 4> -> <3 4> -> <5 5> -> <5 8> -> <3 10> -> D

The key point is that how to let the program or algorithm detect the optimal path (With the minimum steps and know which score should get as in the above example, the <1 8> Score is ignored.)

I am now figuring how can let the computer know going the <3 4> and go back the <5 4> and go to <5 5> is the best path instead of going to <5 5> -> <5 4> -> <3 4> -> <5 5>. I know the later one is a stupid path. But what I can think of is that to do the best path, we may need to search all path with factorial times loop which is not accepted in term of running time.
AnswerRe: Optimal path searching question Pin
Patrice T7-Dec-19 7:45
mvePatrice T7-Dec-19 7:45 
AnswerRe: Optimal path searching question Pin
Gerry Schmitz7-Dec-19 8:47
mveGerry Schmitz7-Dec-19 8:47 
QuestionMaking a Class Schedule Using a Genetic Algorithm Pin
ali galavi3-Dec-19 2:10
ali galavi3-Dec-19 2:10 
AnswerRe: Making a Class Schedule Using a Genetic Algorithm Pin
Richard Deeming3-Dec-19 3:10
mveRichard Deeming3-Dec-19 3:10 
QuestionFind the best path Pin
Member 146753785-Dec-19 20:45
Member 146753785-Dec-19 20:45 
AnswerRe: Find the best path Pin
Patrice T2-Dec-19 13:28
mvePatrice T2-Dec-19 13:28 
AnswerRe: Find the best path Pin
Member 146753785-Dec-19 20:45
Member 146753785-Dec-19 20:45 
QuestionHelp w/ recursive algorithm Pin
Member 1466815525-Nov-19 17:03
Member 1466815525-Nov-19 17:03 
AnswerRe: Help w/ recursive algorithm Pin
Gerry Schmitz26-Nov-19 7:58
mveGerry Schmitz26-Nov-19 7:58 
GeneralRe: Help w/ recursive algorithm Pin
Member 1466815526-Nov-19 16:12
Member 1466815526-Nov-19 16:12 
QuestionAlgorithm homework - Kruskal’s algorithm Pin
Member 1465409213-Nov-19 0:41
Member 1465409213-Nov-19 0:41 
AnswerRe: Algorithm homework - Kruskal’s algorithm Pin
OriginalGriff13-Nov-19 0:44
mveOriginalGriff13-Nov-19 0:44 
QuestionAlgorithm homework Pin
Member 1465409213-Nov-19 0:41
Member 1465409213-Nov-19 0:41 
AnswerRe: Algorithm homework Pin
OriginalGriff13-Nov-19 0:43
mveOriginalGriff13-Nov-19 0:43 
QuestionHelp to draw recursive shape inside 2d array javascript Pin
Member 146476277-Nov-19 0:00
Member 146476277-Nov-19 0:00 
AnswerRe: Help to draw recursive shape inside 2d array javascript Pin
Richard MacCutchan7-Nov-19 0:24
mveRichard MacCutchan7-Nov-19 0:24 
Questionanyone know how to implement arden's theorem or the state removal method to convert an FA to a regex expression? Pin
honey the codewitch21-Sep-19 8:54
mvahoney the codewitch21-Sep-19 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.