Click or drag to resize

LinkGraph.FindShortestPath 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: 25.1.421.0 (25.1.421.0)
Syntax
public LinkPath FindShortestPath(
	IServiceProvider initial,
	IServiceProvider final,
	LinkGraphDirection direction
)

Parameters

initial
Type: System.IServiceProvider
The initial object.
final
Type: System.IServiceProvider
The final object.
direction
Type: AGI.Foundation.Access.LinkGraphDirection
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, null is returned. If the initial and final objects are the same an empty array is returned.
See Also