Skip to main content

How could i force the shortest path finder to go through some specific points ?

 

i have used 20 points (from to line ) , and my network .

and 10 points,i would like the path to go through them if there is a path .

 

i used the shortest path finder to find the shortest path and it works great but i have some points , in network .i would like to go through this point if there is a path .

 

as example , i have Pt.a - Pt.b (i found the path in network between A - 😎 but i have some points inside the network as Pt.c ,i would like to check if there is a path through pt.c or not even if it is longer .

so, if there is a path then the path will be A-C-B ,

if not ,the path will be A-B .

i think , i should add to cost attribute but i am not sure ,how could i consider the Points.

Thanks for help .

Instead of a 2 Point From-To Line, you can instead send ShortestPathFinder a 3 Point Line that is built with 3 vertices Eg:

  • VertexCreator (Replace Point) - Point A
  • VertexCreator (Add Point) - Point C
  • VertexCreator (Add Point) - Point B

Then ShortestPathFinder will attempt to find the shortest path that goes from A to B, via the intermediate point of C.


Instead of a 2 Point From-To Line, you can instead send ShortestPathFinder a 3 Point Line that is built with 3 vertices Eg:

  • VertexCreator (Replace Point) - Point A
  • VertexCreator (Add Point) - Point C
  • VertexCreator (Add Point) - Point B

Then ShortestPathFinder will attempt to find the shortest path that goes from A to B, via the intermediate point of C.

but it means also it will try to find all option short paths from C to B or c to A ,and i do not want that .

because i have like 20 points + 10 points ,around 30 points and if i did that so it will consider the 10 points as starting point to go from .

but i do not want that ,i think it will add more paths that i do not need .

as ex. the path A-B that what i want , but if i connect all point together .so it will go from A-C but if no network to B so i do not need this path A-C .


but it means also it will try to find all option short paths from C to B or c to A ,and i do not want that .

because i have like 20 points + 10 points ,around 30 points and if i did that so it will consider the 10 points as starting point to go from .

but i do not want that ,i think it will add more paths that i do not need .

as ex. the path A-B that what i want , but if i connect all point together .so it will go from A-C but if no network to B so i do not need this path A-C .

@bwn is correct

You add an intermediate point to your from to line. If your from to line goes from Point A to Point C to Point B, the shortest path finder will return the shortest path between those three locations if possible. If you cannot go from A to C to B no path is returned, even if a path from A to C is possible

 


but it means also it will try to find all option short paths from C to B or c to A ,and i do not want that .

because i have like 20 points + 10 points ,around 30 points and if i did that so it will consider the 10 points as starting point to go from .

but i do not want that ,i think it will add more paths that i do not need .

as ex. the path A-B that what i want , but if i connect all point together .so it will go from A-C but if no network to B so i do not need this path A-C .

That is where instead using 2 x ShortestPathFinders:

1. The first ShortestPathFinder tests if a path through A-C-B exists.

2. If it doesn't, then the From-To lines that don't have a Path will output on the "No Path" port of ShortestPathFinder 1

3. The "No Path" lines then can be shortened to 2 point lines using VertexRemover to form the line A-B from a No-Path A-C-B 3 point line

4. These 2 point lines can then be tested in ShortestPathFinder 2 to test if Path A-B exists in the cases where Path A-C-B did not exist

 


but it means also it will try to find all option short paths from C to B or c to A ,and i do not want that .

because i have like 20 points + 10 points ,around 30 points and if i did that so it will consider the 10 points as starting point to go from .

but i do not want that ,i think it will add more paths that i do not need .

as ex. the path A-B that what i want , but if i connect all point together .so it will go from A-C but if no network to B so i do not need this path A-C .

thanks ,i will try to do this .


Reply