Author Topic: find the shortest path between two shapes  (Read 692 times)

0 Members and 2 Guests are viewing this topic.

wapperdude

• Global Moderator
• Hero Member
• Posts: 3828
• Ideas Visio-lized into solutions
Re: find the shortest path between two shapes
« Reply #15 on: September 23, 2020, 01:06:00 AM »
Yes.  Green is shortest path.
Yellow are the immediate paths from the starting node.
No, there is no inherent limit coded in.  Whatever tops out will be for "outside" reasons.

Generally, yes.  But, it only visits each path once.  It is based upon Dijkstra's algorithm.  The original link provides more detail, and the code actually has a lot of comments.

The bail-out, only occurs if you select either incoming or outgoing paths, which implies a specific direction.  If there's no way to get to the destination, then result is zero paths of the type selected will get you to Rome.
Visio 2019 Pro

cliff50

• Full Member
• Posts: 214
Re: find the shortest path between two shapes
« Reply #16 on: September 23, 2020, 05:16:30 AM »
Wapperdude  ... for the minute your solution is fit for purpose  ... (purpose being MPLS network evaluation tool).

I am unsure though ... why you went the extra mile  and include directional capability.  Perhaps this could be a model of street navigation (one way streets etc).

you must have been thinking outside the box

~ cheers
Cliff
« Last Edit: September 23, 2020, 05:19:34 AM by cliff50 »

wapperdude

• Global Moderator
• Hero Member
• Posts: 3828
• Ideas Visio-lized into solutions
Re: find the shortest path between two shapes
« Reply #17 on: September 23, 2020, 09:17:56 AM »
Just seemed like the right thing to do.  Another application could also be electronic circuits:  fundamentally, outputs drive inputs.  So, that's an exploitable feature.   Visio also has an unsung feature, the D-cell, for connection points.  That can be utilized to distinguish types of i/o:  inputs, outputs, tri-state, power, etc.

Visio 2019 Pro

cliff50

• Full Member
• Posts: 214
Re: find the shortest path between two shapes
« Reply #18 on: October 01, 2020, 04:51:29 AM »
Wapperdude ...  I realized the yellow coloration is crucial  to a consistent outcome.  I am unsure if the distancing calculation is incorporated into the outcome in any way ... it appears not .. but I will follow the "yellow brick road"

wapperdude

• Global Moderator
• Hero Member
• Posts: 3828
• Ideas Visio-lized into solutions
Re: find the shortest path between two shapes
« Reply #19 on: October 01, 2020, 08:16:36 AM »
Colored paths have secondary purpose... they indicate when a path has been counted.  The algorithm is based upon single traverse.
Visio 2019 Pro