The old Google Groups will be going away soon, but your browser is incompatible with the new version.
How to modelize roads with constraints?
 There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic. There was an error processing your request. Please try again. Standard view   View as tree
 2 messages

From:
To:
Cc:
Followup To:
Subject:
 Validation: For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon.

More options Aug 14 2012, 4:41 am
From: Benoît Lafontaine <joel1...@gmail.com>
Date: Tue, 14 Aug 2012 01:41:34 -0700 (PDT)
Local: Tues, Aug 14 2012 4:41 am
Subject: How to modelize roads with constraints?

Hi,

I have to modelize roads. And I have the following problem

/
\

A, C and D are points like cities, B is an intersection.
The constraint is that is not allowed to turn to C when you come from D. So
you can drive from A to C, from A to D, but you can't drive from D to C.

What's the best way to modelize such graph with this constraint?

Tx

To post a message you must first join this group.
You do not have the permission required to post.
More options Aug 14 2012, 6:46 am
From: Craig Taverner <cr...@amanzi.com>
Date: Tue, 14 Aug 2012 12:46:41 +0200
Local: Tues, Aug 14 2012 6:46 am
Subject: Re: [Neo4j] How to modelize roads with constraints?

Here's an idea:

Model intersection nodes like B as as a set of entry/exit points to the
intersection. In your case there would be three such nodes, BA, BC and BD,
each representing the entry/exit to the road to destinations A, C and D.
The relationships between the different nodes of B would all be of a
different type than the road relationships. Traversing the graph needs a
rule that you can *never traverse two intersection relationships in a
row*(cannot drive round and round in the intersection). Then all you
need to
add is a direction constraint to the intersection relationships, and you

BC---C
/|
/ |
A---BA |
\ |
\|
BD---D

Intersection:

- BA---BD, bi-directional
- BA---BC, bi-directional
- BC-->BD, only one direction - you cannot turn from D to C, only from C
to D

So, as long as your traversal algorithm respects the direction of the
relationships (both road and interesection) and also enforces the rule that
you can never traverse two intersection relationships in a row, then you
will not be able to take a right turn from D to C through the intersection.

On Tue, Aug 14, 2012 at 10:41 AM, Benoît Lafontaine <joel1...@gmail.com>wrote: