Click here to Skip to main content
15,899,314 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: pumping lema and regular languages Pin
Luc Pattyn8-May-09 6:51
sitebuilderLuc Pattyn8-May-09 6:51 
AnswerRe: pumping lema and regular languages Pin
Alan Balkany11-May-09 3:35
Alan Balkany11-May-09 3:35 
QuestionAlgorithm to sort list Pin
TheConfusedGuy7-May-09 11:27
TheConfusedGuy7-May-09 11:27 
AnswerRe: Algorithm to sort list Pin
harold aptroot7-May-09 12:24
harold aptroot7-May-09 12:24 
AnswerRe: Algorithm to sort list Pin
Luc Pattyn7-May-09 12:56
sitebuilderLuc Pattyn7-May-09 12:56 
AnswerRe: Algorithm to sort list Pin
Luc Pattyn7-May-09 13:55
sitebuilderLuc Pattyn7-May-09 13:55 
AnswerRe: Algorithm to sort list [modified] Pin
dybs7-May-09 17:55
dybs7-May-09 17:55 
GeneralRe: Algorithm to sort list (Reply to All) Pin
TheConfusedGuy7-May-09 18:27
TheConfusedGuy7-May-09 18:27 
Thanks all for the input. The ideas are pretty good, but, I need to take the scenario further I think to hammer down an algorithm, so bear with me Smile | :) The real world application of this is to calculate train run time over a section of track. I'll use real world examples with explanation to clarify. Here we go:

1. The section of track is called a "subdivision".

2. The 'initial' speed profile for the subdivision is defined by what are called 'zone speeds'.

3. A subdivision can contain many zone speeds, but, the zone speeds do not overlap each other, instead, they run sequentially from one end to the other.

NOTE: to this point, the analysis is simple - it gets tricky with the 4th and 5th point.

4. When the condition of the rail deteriorates to a point where train operation at zone speed is not safe then mechanisms called "temporary slow orders" (TSO) are put in place to restrict the speed until repairs can be made. These mechanisms can be in place for months at a time.

5. These temporary slow orders can, and often do, overlap zone speeds, further, they can, but don't often, overlap each other.

Therefore, consider this scenario:

1. Subdivision length is 50 miles
2. Zone speed 1 exists from mile 0 to mile 28 at 40 MPH
3. Zone speed 2 exists from mile 28 to mile 31 at 20 MPH
4. Zone speed 3 exists from 31 to mile 50 at 25 MPH

NOTE: again, analysis of train speed is simple with this scenario, it gets complicated when the following is added to the scenario:

5. TSO A exists from mile 25 to 29 at 15 MPH
6. TSA B exists from mile 30 to mile 34 at 10 MPH

The data would be presented as it is above as I sort by Zone and TSO and by low mile for both when extracting from the database. So, the question becomes, how do I take that data, as presented above, and create the following list:

1. Mile 0 to 25 @ 40 MPH
2. Mile 25 to 29 @ 15 MPH
3. Mile 29 to 30 @ 20 MPH
4. Mile 30 to 34 @ 10 MPH
5. Mile 34 to 50 @ 25 MPH

??

In terms of the ideas presented above, I have considered using a tree sort, however, does the fact that the children nodes (TSO) can overlap the parent nodes (Zones) present a problem in execution? I had not thought of using a linked list, I think that mechanism might suit the problem, however, I want to think on that a bit more. I wonder if the overlap might cause a problem?

LOL! This problem is killing me. It's been 9 years since I completed my computer science program, and, there is a lot of rust accumulated over the years. The help given thus is greatly appreciated, any other thoughts and or help would also be appreciated.

Lyle.
GeneralRe: Algorithm to sort list (Reply to All) Pin
dybs7-May-09 19:01
dybs7-May-09 19:01 
GeneralRe: Algorithm to sort list (Reply to All) Pin
TheConfusedGuy7-May-09 19:07
TheConfusedGuy7-May-09 19:07 
Questionbearing angle calculation Pin
ranjanguru6-May-09 22:45
ranjanguru6-May-09 22:45 
AnswerRe: bearing angle calculation Pin
molesworth6-May-09 23:38
molesworth6-May-09 23:38 
GeneralRe: bearing angle calculation Pin
ranjanguru6-May-09 23:48
ranjanguru6-May-09 23:48 
GeneralRe: bearing angle calculation Pin
molesworth7-May-09 0:06
molesworth7-May-09 0:06 
GeneralRe: bearing angle calculation Pin
molesworth8-May-09 3:13
molesworth8-May-09 3:13 
AnswerRe: bearing angle calculation Pin
OriginalGriff6-May-09 23:52
mveOriginalGriff6-May-09 23:52 
GeneralRe: bearing angle calculation Pin
ranjanguru6-May-09 23:57
ranjanguru6-May-09 23:57 
AnswerRe: bearing angle calculation Pin
Stuart Cox7-May-09 11:01
Stuart Cox7-May-09 11:01 
AnswerRe: bearing angle calculation Pin
cp98768-May-09 15:30
cp98768-May-09 15:30 
QuestionPolygon Rendering Performance Optimization Pin
StarBP6-May-09 11:27
StarBP6-May-09 11:27 
QuestionWhich language is this Urgent help required Pin
Sanjaykalsi5-May-09 22:55
Sanjaykalsi5-May-09 22:55 
AnswerRe: Which language is this Urgent help required Pin
OriginalGriff5-May-09 23:03
mveOriginalGriff5-May-09 23:03 
QuestionTrying to create a for loop that gives all Unique combinations without using recursive process. Pin
luke.orun5-May-09 13:49
luke.orun5-May-09 13:49 
AnswerRe: Trying to create a for loop that gives all Unique combinations without using recursive process. Pin
Luc Pattyn5-May-09 14:41
sitebuilderLuc Pattyn5-May-09 14:41 
GeneralRe: Trying to create a for loop that gives all Unique combinations without using recursive process. Pin
luke.orun5-May-09 22:09
luke.orun5-May-09 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.