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.

Suppose we have a connected undirected graph with a positive integer cost assigned to each edge.

Given two verticies, how do we find the set of minimal cost paths between those two nodes? Does this problem have a name? What algorithm should we use?

share|improve this question
3  
this is shortest path problem, here you can find answers Shortest Path Problem –  com Apr 6 '12 at 13:11

1 Answer 1

up vote 1 down vote accepted

If you looking for algorithm for all possible shortest paths between two vertices, I'd say that unfortunately this problem has exponential output size, assume graph with $n$ distinct cycles: $C_1,C_2,...C_n$, such that each cycle has $4$ vertices, $\forall i\in [1,n-1]$ $C_i$ is connected to $C_{i+1}$ by one edge $e_i$. internal edges in each cycles are:$v_{i_1}v_{i_2},v_{i_2}v_{i_3},v_{i_3}v_{i_4},v_{i_4}v_{i_1}$ and $e_i = v_{i_3}v_{i+1_1}$. number of shortest path between $v_{1_1}$ and $v_{n_3}$ is $O(2^{n \over 2})$. and because size of graph is $4n$, this causes to exponential number of paths.

share|improve this answer

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.