[AccessD] Possible Route Between 2 Points

Stuart McLachlan stuart at lexacorp.com.pg
Sat Nov 11 19:10:32 CST 2023


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




More information about the AccessD mailing list