E
Eder Andres
Hello:
Recently I’m migrating from data structures to databases. I’ve converted a
Customers, Products and PendingOrders collections into a Microsoft Access
2003 data base. But I must convert many other data structures.
Now, the problem is a graph. In this project, there are cities and
transportation means. Traveling to one city to another we must use a car, a
bus, a train, an airplane, or a boat but we can’t travel between two if the
transportation mean is not available, this is there are cities unreachable
using a car (like cities located in islands) , a airplane (the destination
city does not have airplane) and so on.
I’ve used the graph data structure as solution. The nodes are the cities and
the arcs are a relation between the city and the transportation mean. In
math, this is
Destination (city, transportation mean) = {city1, city2}
I’ve implemented this relation between two sets.
C: the set of cities
T: the set of transportation means
D: the set of destination cities given a city and transportation mean. It is
a subset of C.
For this purpose, the arc, called destination, is of the form
(startCity, transportationMean, destinationCities)
For implementation I’ve used list structures:
City1-------|---------Ã Mean1---------------- Ã {city1, city2}
|-------Ã Mean2---------------- Ã {city1, city3, city5}
Recently I’m migrating from data structures to databases. I’ve converted a
Customers, Products and PendingOrders collections into a Microsoft Access
2003 data base. But I must convert many other data structures.
Now, the problem is a graph. In this project, there are cities and
transportation means. Traveling to one city to another we must use a car, a
bus, a train, an airplane, or a boat but we can’t travel between two if the
transportation mean is not available, this is there are cities unreachable
using a car (like cities located in islands) , a airplane (the destination
city does not have airplane) and so on.
I’ve used the graph data structure as solution. The nodes are the cities and
the arcs are a relation between the city and the transportation mean. In
math, this is
Destination (city, transportation mean) = {city1, city2}
I’ve implemented this relation between two sets.
C: the set of cities
T: the set of transportation means
D: the set of destination cities given a city and transportation mean. It is
a subset of C.
For this purpose, the arc, called destination, is of the form
(startCity, transportationMean, destinationCities)
For implementation I’ve used list structures:
City1-------|---------Ã Mean1---------------- Ã {city1, city2}
|-------Ã Mean2---------------- Ã {city1, city3, city5}