Click or drag to resize

LinkGraphFindShortestPath Method

Finds the shortest path between an initial object and a final object.

Namespace:  AGI.Foundation.Access
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 19.1.398.0 (19.1.398.0)
Syntax
public LinkPath FindShortestPath(
	IServiceProvider initial,
	IServiceProvider final,
	LinkGraphDirection direction
)

Parameters

initial
Type: SystemIServiceProvider
The initial object.
final
Type: SystemIServiceProvider
The final object.
direction
Type: AGI.Foundation.AccessLinkGraphDirection
The direction of the signal. If this parameter is Transmit, the initial object is transmitting to the final object and all links along the way must be in the transmit direction. If this parameter is Receive, the final object is receiving from the final object and all links along the way must be in the receive direction. If this parameter is Ignore, the signal direction is ignored and links in either direction can be traversed.

Return Value

Type: LinkPath
A list of links traversed along the shortest path from initial to final. If a path does not exist, is returned. If the initial and final objects are the same an empty array is returned.
See Also