Creating a graph

Topics: algorithm, graph
Jun 5, 2011 at 3:02 PM

Hello,

 

I'm Really new to this library, and i'd like to know how to create a graph with edges likes this:

My datas are:

AIRPORT DEPARTURE CODE:
AIRPORT TIME OF DEPARTURE

AIRPORT ARRIVAL CODE:
AIRPORT TIME OF ARRIVAL:

PRICE

i'd like to build a graph from the airport A to the airport Z, but the nodes aren't the airports but the airports with hours. i don't know if it's clear. I can have many many flights, and one user could go from airport B at 5pm and take a flight (1) at 6 pm to airport C, an other one could go from airport B at 7pm and take a flight (2) at 9 pm to airport D
Meaning that there will be one node with flight (1) and (2), and the other one only with (2).

Any clue how to build such a tree?

The fact is that all same flight arrow are pointing to the same node. That's the only property i found about my graph.

That's for a school work

 

The goal of this is to find out the minimum price from airport A to airport Z, knowing a lot lot lot of flights, by applying Djikstra


Thanks a lot !