[AccessD] Possible Route Between 2 Points

David Emerson newsgrps at dalyn.co.nz
Sat Nov 11 22:29:24 CST 2023


Brilliant Stuart.  Just the pointers I needed.

-----Original Message-----
From: AccessD <accessd-bounces+newsgrps=dalyn.co.nz at databaseadvisors.com> On
Behalf Of Stuart McLachlan
Sent: Sunday, November 12, 2023 11:41 AM
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Possible Route Between 2 Points

There's a whole branch of maths to do with that:
https://en.wikipedia.org/wiki/Graph_theory


Keywords:
Directed graph
nodes/vertices
paths/edges

See
https://www.geeksforgeeks.org/find-if-there-is-a-path-between-two-vertices-i
n-a-given-graph/

for sample code in some other languages.

The Javascript version is probably the easiest to convert to VBA.



On 12 Nov 2023 at 10:01, David Emerson wrote:

> Hi Listers,
> 
> 
> 
> Given a list of roads between cities, I would like to find out if 
> there is a continuous route between two points.
> 
> 
> 
> For example, given the following list of roads:
> 
> A-B
> 
> A-C
> 
> A-D
> 
> B-D
> 
> C-E
> 
> D-F
> 
> B-F
> 
> G-H
> 
> 
> 
> Is there a route from A-E? Yes: A-C, C-E
> 
> Is there a route from A-H? No
> 
> 
> 
> I only want to know if a route exists and don't need to know if there 
> are more than 1 solution.
> 
> 
> 
> I understand that this is a recursive problem.  Does anyone have 
> sample code I can use?
> 
> 
> 
> Regards
> 
> 
> 
> David Emerson
> 
> Dalyn Software Ltd
> 
> Adelaide, Australia
> 
> 
> 
> 
> 
> 
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list