Graph - find a path from A to B with path constraints
- From: pwu@xxxxxxxxxxxxx
- Date: Thu, 14 Jun 2007 23:46:44 -0700
Hi,
I am given:
Start Point
End Point
Graph showing From City, To City, and Airline or Airline with flight
number
"adjacency list" & "list of nodes"
List of flights (Airline with flight number or just an Airline).
This is to used in getting from A to B.
Order of flights given must be met.
I have to find:
The cities that are to traversed to get from A to B using the
flights given.
Graph will have many connections between nodes and there can be
multiple connections between any 2 ports.
For example the relevant connections in the graph are:
Adelaide Sydney Airline A Flight730
Sydney Bangkok Airline A Flight1
Sydney Bangkok Airline A Flight730
Bangkok London Airline A Flight1
Sydney London Airline A Flight1
London Amsterdam Airline B
Bangkok Amsterdam Airline B
Assume all flight routes have the SAME LENGTH.
You will be given:
Adelaide
Amsterdam
Airline A,Flight730
AirlineA,Flight1
AirlineB
The shortest path would be (which the Dijstra's algorithm would
produce):
Adelaide -> Sydney Airline A Flight730
Sydney -> Bangkok Airline A Flight730
Bangkok -> Amsterdam Airline B
But this does not fit the given flights.
So the correct path would be:
Adelaide -> Sydney Airline A Flight730
Sydney -> Bangkok Airline A Flight1
Bangkok -> London Airline A Flight1
London -> Amsterdam Airline B
Of course this example is simple but the real graph is much more
complicated.
Can you suggest an algorithm to use?
Are there any web sites/newsgroup articles that can assist - ideally
with examples in Oracle's PL/SQL?
Thanks for any help
.
- Follow-Ups:
- Re: Graph - find a path from A to B with path constraints
- From: Zhu Guohun
- Re: Graph - find a path from A to B with path constraints
- Prev by Date: Re: Does anyone have a copy of this paper? Knuth's Fast pattern matching in strings
- Next by Date: Re: Finding longest path between two vertices
- Previous by thread: Does anyone have a copy of this paper? Knuth's Fast pattern matching in strings
- Next by thread: Re: Graph - find a path from A to B with path constraints
- Index(es):
Relevant Pages
|