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

0 Members and 1 Guest are viewing this topic.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3822
  • 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: 213
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: 3822
  • 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