Re: Shortest path with intermediate nodes algorithm
- From: Luis Quesada <luque@xxxxxxxxxxxxxx>
- Date: Mon, 28 Aug 2006 10:40:54 +0200
acamposr@xxxxxxxxx wrote:
Patricia Shanahan wrote:Well, Dijkstra's algorithm gives you back a shortest path tree. So, you only need to run it once per intermediate node.acamposr@xxxxxxxxx wrote:In that case, isn't it equivalent to traveling salesman?All of them in any order (the shortest order).All of them or some of them?...And if more than one of them, is the order fixed?
A.L.
First calculate the shortest paths between each pair of mentioned nodes,
using e.g. an all-pairs shortest paths algorithm.
I am not sure it will be efficient, because I will have thousands of
nodes and arcs. An all-pairs algorithm would calculate the paths
between one source to *all* the nodes in the graph (if I am wrong,
please tell me). Using an point-to-point algorithm (like Dijkstra's or
A*) implies I will have to run it for each pair of intermediate nodes.
If have 20 intermediate nodes or more, it could be very very long.
Isn't there any specific algorithm for this problem? I liked your idea,
but I see those disadvantages. However, the second part (traveling
salesman) can be very fast with an heuristic algorithm, but the first
one...
IMHO, a O(|IN|*|N|^2) preprocessing phase (where IN is the set of intermadiate node) is reasonable if we take into account that the problem is NP-hard.
The real problem I see is if you are constrained to visit each node of the original graph once. In that case, the reduction that Patricia is suggesting may lead to visiting a node twice.
Gregoire Dooms has implemented a global constraint that can be used for solving this particular problem. Path(G,n1,n2,I,w) holds if G is a simple path from n1 to n2 which total weight is I under the weight function w (http://cpgraph.info.ucl.ac.be/).
The idea would be to reduce the upper bound until no solution is found. Then, you will know that the last solution you found is the best one.
Luis
.
- Follow-Ups:
- Re: Shortest path with intermediate nodes algorithm
- From: acamposr
- Re: Shortest path with intermediate nodes algorithm
- References:
- Shortest path with intermediate nodes algorithm
- From: acamposr
- Re: Shortest path with intermediate nodes algorithm
- From: A . L .
- Re: Shortest path with intermediate nodes algorithm
- From: Patricia Shanahan
- Re: Shortest path with intermediate nodes algorithm
- From: acamposr
- Re: Shortest path with intermediate nodes algorithm
- From: Patricia Shanahan
- Re: Shortest path with intermediate nodes algorithm
- From: acamposr
- Shortest path with intermediate nodes algorithm
- Prev by Date: Re: A graph theory terminology challenge
- Next by Date: Re: A graph theory terminology challenge
- Previous by thread: Re: Shortest path with intermediate nodes algorithm
- Next by thread: Re: Shortest path with intermediate nodes algorithm
- Index(es):
Relevant Pages
|