Hi all,
I am trying to formulate an algorithm that gives me reasonable connections in an airline network. The input is the timetable of an airline. To do so, I use some set-operations to find possible direct or connecting flights between an O&D pair.
The problem is, that the algorithm creates sometimes inefficient connections (e.g. flying from Paris to Madrid via Los Angeles). Therefore based on some rules I want to delete these members from the set.
One example:
The original set ist described as:
Set All_connections:=
...
(Paris,Madrid,dep_time:290, arr_time:390)
(Paris,Madrid,dep_time:190, arr_time:990)
...
As you can see, connection 2 doesn't make sense. My plan is an algorithm of the following form:
{Check for each i and j in O&D-pair
if dep_time(i)<=dep.time(j) && arr_time(i)>arr_time(j)
delete i from the set.}
My main problem is: How can I delete members from an existing set based on some business rule as explained in the example?
Hope you can help me :)