ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.Data.Knowledge.Extensions Namespace / KnowledgeGraphExtensions Class / RunFilteredFindPaths Method
The knowledge graph on which FFP will be run
The configuration to be used
Example

In This Topic
    RunFilteredFindPaths Method
    In This Topic
    Find paths in the specified knowledge graph using Filtered Find Paths (FFP). This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    kg
    The knowledge graph on which FFP will be run
    configuration
    The configuration to be used

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Filtered Find Paths configuration cannot be null.
    Remarks
    FFP allows you to specify many types of pathfinding constraints: you can selectively include or exclude some entities or relationships, specify waypoints, time constraints and per-relationship type traversal directions. You can also specify whether you search for the shortest paths, or all paths, or the lowest cost paths, where the cost is a relationship property.
    Refer also the the Pro help documentation at:
    Example
    Run FFP Using Defaults
          //using ArcGIS.Core.Data.Knowledge.Extensions;
    
          await QueuedTask.Run(() =>
    {
              var ffp_config = new CIMFilteredFindPathsConfiguration();
              ffp_config.Name = "Run FFP Using Defaults";
    
              //Origin Entities
              var originEntities = new List<CIMFilteredFindPathsEntity>();
    
              var poi_entity = new CIMFilteredFindPathsEntity();
              poi_entity.EntityTypeName = "POI";//All entities of entity type "POI"
              poi_entity.PropertyFilterPredicate = "";
              originEntities.Add(poi_entity);
              //Add the CIMFilteredFindPathsEntity to the OriginEntities collection
              ffp_config.OriginEntities = originEntities.ToArray();
    
              //Destination Entities
              var destEntities = new List<CIMFilteredFindPathsEntity>();
    
              var supp_entity = new CIMFilteredFindPathsEntity();
              supp_entity.EntityTypeName = "Supplier";//All entities of entity type "Supplier"
              supp_entity.PropertyFilterPredicate = "";
              destEntities.Add(supp_entity);
    
              //Add the CIMFilteredFindPathsEntity to the DestinationEntities collection
              ffp_config.DestinationEntities = destEntities.ToArray();
    
              //Path Filters
              ffp_config.PathFilters = [];//Empty
              //Traversal
              ffp_config.TraversalDirections = [];//Empty
    
              //Other
              ffp_config.RelationshipCostProperty = "";
              ffp_config.DefaultRelationshipCost = 1.0;
              ffp_config.DefaultTraversalDirectionType = KGTraversalDirectionType.Any;
              ffp_config.EntityUsage = FilteredFindPathsEntityUsage.AnyOriginAnyDestination;
              ffp_config.PathMode = KGPathMode.Shortest;
              ffp_config.MinPathLength = (int)1;//Min number of relationships in path
              ffp_config.MaxPathLength = (int)8;//Max number of relationships in path
              ffp_config.MaxCountPaths = (int)100000;//Total number of paths to return
              ffp_config.ClosedPathPolicy = KGClosedPathPolicy.Forbid;
              ffp_config.TimeFilter = null;
    
              var results = kg.RunFilteredFindPaths(ffp_config);
              //TODO process/analyze results
          });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also