Re: Demo: Modelling Cost of Travel Paths Between Towns

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 10 Nov 2004 12:03:01 -0800
Message-ID: <4b5394b2.0411101203.5d1ba318_at_posting.google.com>


neo55592_at_hotmail.com (Neo) wrote in message news:<4b45d3ad.0411081928.6a6907a4_at_posting.google.com>...
> > 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.

I thought YOU were the Original poster, at least that's how it looks in google.

[]
> > 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;

Understood, I just wanted to make sure others saw that clearly.
>
> 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.

Again, I understood this. I am just making sure misused terms do not confuse other readers.

>
> > > // 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.

You still did not answer the question about signed numbers. How does the language distinquish between the operation or changing the value to +1 from the operation of adding a new instance with the value 1.

>
> > 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?

Well, given your reputation in this group I almost expected you to claim Xdb1 could solve this in something shorter than the brute force exhaustive search.

Matching that model in a Relational data model is easy enough. (Joe Celko already posted a SQL model.)

I guess I'm asking: Is there is a point to this thread?

  Ed Received on Wed Nov 10 2004 - 21:03:01 CET

Original text of this message