SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 SQL Store Routes of Hiking
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

swissivan
Starting Member

30 Posts

Posted - 03/10/2014 :  05:05:50  Show Profile  Reply with Quote
Dear All

Thank you for your attention.

I am writing a hiking guide system that helps user to find out if they go wrong path.

I need to build a sytem that indicate the routes of hiking.

The hiking rules will be set by the chairman using an interface, so I need to store the rules in database.

I would like to use linked list to store the hiking routes before.


Path Previous Current Next
1 NULL 1 2
1 1 2 3
1 2 3 4
1 3 4 NULL

However, I underestimated the situations that may happen.

For example, I got the following rules come together

a) Multiple Possible Checkpoints

A > B or A > C (After checkpoint A, you can go to either B or C)

b) Skip CheckPoint

D > (E) > F or D > F (checkpoint E can be skipped)

c) Repeated Checkpoints

G > H > I > G > H > I > ... (If the action in checkpoint I is not passed, then you need to go back to checkpoint G again)

d) Group Optional Checkpoints

J > { K / L / M} > O (After checkpoint J, you can either go to K or L or M which is in the same group, let say checkpoints K, L and M are belongs to 'Water Area')

I need to let the chairman to define 'Water area' = { K / L / M }

and the the rules J > 'Water area' > O


My Search
I can think of using linked list to handle the above situations, but it is really complicated

e.g. to store the following rule P > Q / R / S > (T) > U / V > W > X > (P > ... W)

I need build many records

P > Q, P > R, P > S, P > Q > T, P > R > T, P > S > T, Q > T > U, ....

and it seems difficult to query and it is not a good database structure, anyone got ideas or experience on storing route like data? Any suggesstion? Many thanks

Best Regards

Ivan
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000