Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

If I have a graphic

$A\rightarrow B$ weight $10$
$B\rightarrow A\qquad 11$
$B\rightarrow C\qquad 20$
$C\rightarrow D\qquad 5$
$D\rightarrow C\qquad 16$
$D\rightarrow B\qquad 9$
$D\rightarrow A\qquad 7$

then, if start from any one of the node, I want to know the shortest path to another. Does anyone what kind of algorithms can do it?

Thanks.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

Dijkstra's Algorithm

share|improve this answer
add comment

A lot depends on what sort of solution you need. If you absolutely need a global one regardless of the time needed, use Dynamic programming. If you are happy with a local one, any sort of heuristic algorithms would do (e.g. Evolutionary Algorithms, Simulated Annealing, etc)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.