![]() | |
#11
| |||
| |||
|
|
There is no such time as 24:00 Hrs; read ISO-8601. |
|
... SQL Script .... |
#12
| |||
| |||
|
|
There is no such time as 24:00 Hrs; read ISO-8601. You are correct |
#13
| |||
| |||
|
|
That gets all the (travel_cost = 1) edges in the graph. Next, use Warshall's algorithm to fill in travel costs on ('c', 'a'), ('d', 'b') and so forth. This will work for any adjacency list model. I would do the matrix multiplications in a host language like FORTRAN, C or Pascal, but I can do it in pure SQL if I have to (see that section in SQL FOR SMARTIES). |
#14
| |||
| |||
|
|
There is no such time as 24:00 Hrs; read ISO-8601. You are correct ... Really - who read ISO 8601? |
I didn't. And yes I assumed Mr Celko was correct. Regardless of
#15
| |||
| |||
|
|
--CELCO-- wrote ... Neo wrote: There is no such time as 24:00 Hrs; read ISO-8601. You are correct Really - who read ISO 8601? Section 5.3 (of FDIS for 2000 edition): Time of the Day |
#16
| |||
| |||
|
|
There is no such time as 24:00 Hrs; read ISO-8601. You are correct Really - who read ISO 8601? Section 5.3 (of FDIS for 2000 edition): Time of the Day LOL. Nice double-catch :-) |
#17
| |||||
| |||||
|
|
Incomplete problem description. What is the costs for travel on other days? In order to keep the example simple, the script only showed the cost of travel between two towns (a to b) in one direction during a specific day of the week (monday), during a specific time period (00:00 to 24:00). The updated script at the end has 4 such entries and should allow one to deduce how to enter additional ones. If you or the original problem poster would like to present more representative data, I can enter it. |
|
Actually all the so-called paths are unidirectional. You never created a bidirectional "goto" verb. Didn't need to create a bi-directional verb because two opposite uni-directionals paths form a bi-directional path as in: CREATE2 a.goto = b; CREATE2 b.goto = a; |
|
If I had created a bi-directional verb, it would be difficult to specify a one way street and different cost/period for each uni-direction. |
|
// Create it cost 1.00 to go from town a to town b // on monday between 00:00 and 24:00 CREATE2 (a.goto=b).weekday = +monday; weird operators...is there such a thing as a negative monday? The + indicates that if monday does not already exist as an instance of the verb (weekday), go ahead and create it. The above script is equivalent to below which doesn't use the "+" sign: CREATE2 *; // aka it CREATE2 it.name = monday; // short cut to relating to each symbol CREATE2 it.cls = weekday; CREATE2 (a.goto=b).weekday = monday; // or "(a.goto=b).weekday = it;" I am open to suggestions for improving XDb2's scripting language. |
|
Now that you have a design, what problems do you think you can solve with it? (You are not really so uninformed as to suggest this might solve the travelling salesman problem, are you?) I assumed that people would understand the example only represents the things needed in a db to calculate best path and not the algorithms to do so. However I believe I could code the algorithm. Are you saying that no one has solved this type of problem with RM thus far? |
#18
| |||
| |||
|
|
There is no such time as 24:00 Hrs; read ISO-8601. You are correct Really - who read ISO 8601? Section 5.3 (of FDIS for 2000 edition): Time of the Day LOL. Nice double-catch :-) Upon further reflection, while not taking away from the apparent fact (I haven't verified it) that ISO-8601 mentions the existance of 24:00, there is no 24th hr in a day and therefore ISO-8601 is wrong! The time in a day can be described by t, where 0:00 <= t < 24:00, and does not include 24:00. |
#19
| |||
| |||
|
|
Upon further reflection, while not taking away from the apparent fact (I haven't verified it) that ISO-8601 mentions the existance of 24:00, there is no 24th hr in a day and therefore ISO-8601 is wrong! If you haven't verified it, how can you know that ISO-8610 is wrong? |
|
The time in a day can be described by t, where 0:00 <= t < 24:00, and does not include 24:00. Whow, you are a genius. Thank you for pointing out that t<24:00 does not |
#20
| |||
| |||
|
|
neo55592 (AT) hotmail (DOT) com (Neo) wrote: There is no such time as 24:00 Hrs; read ISO-8601. You are correct Really - who read ISO 8601? Section 5.3 (of FDIS for 2000 edition): Time of the Day LOL. Nice double-catch :-) Upon further reflection, while not taking away from the apparent fact (I haven't verified it) that ISO-8601 mentions the existance of 24:00, there is no 24th hr in a day and therefore ISO-8601 is wrong! The time in a day can be described by t, where 0:00 <= t < 24:00, and does not include 24:00. It can be, but that does not mean it has to be. Besides, what day does not have twenty-four hours? Well, of course, if you live in a country where daylight savings |
![]() |
| Thread Tools | |
| Display Modes | |
| |