Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|cite|improve this question
up vote 0 down vote accepted

Dijkstra's Algorithm

share|cite|improve this answer

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|cite|improve this answer

Your Answer


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.