VertexTraverse Method (Int32, Boolean, Direction, Vertex, ISetEdgeType, ISetVertexType, ISetVertexType, ISetVertex, ISetVertex, ISetEdge, ISetEdge, ISetPropertyType, ISetPropertyType, ISetPropertyType, ISetPropertyType, FuncVertex, Boolean, FuncEdge, Boolean, FuncListEdge, Boolean) |
Traverses graph from this Vertex to a target Vertex using Breadth-first search like in Dijkstra's algorithm
Namespace:
VelocityGraph
Assembly:
VelocityGraph (in VelocityGraph.dll) Version: 11.1.0.0 (11.1)
Syntax public List<List<Edge>> Traverse(
int maxHops,
bool all = true,
Direction dir = Direction.Both,
Vertex toVertex = null,
ISet<EdgeType> edgeTypesToTraverse = null,
ISet<VertexType> includedVertexTypes = null,
ISet<VertexType> excludedVertexTypes = null,
ISet<Vertex> includedVertices = null,
ISet<Vertex> excludedVertices = null,
ISet<Edge> includedEdges = null,
ISet<Edge> excludedEdges = null,
ISet<PropertyType> includedVertexProperty = null,
ISet<PropertyType> excludedVertexProperty = null,
ISet<PropertyType> includedEdgeProperty = null,
ISet<PropertyType> excludedEdgeProperty = null,
Func<Vertex, bool> validateVertex = null,
Func<Edge, bool> validateEdge = null,
Func<List<Edge>, bool> validateEdges = null
)
Public Function Traverse (
maxHops As Integer,
Optional all As Boolean = true,
Optional dir As Direction = Direction.Both,
Optional toVertex As Vertex = Nothing,
Optional edgeTypesToTraverse As ISet(Of EdgeType) = Nothing,
Optional includedVertexTypes As ISet(Of VertexType) = Nothing,
Optional excludedVertexTypes As ISet(Of VertexType) = Nothing,
Optional includedVertices As ISet(Of Vertex) = Nothing,
Optional excludedVertices As ISet(Of Vertex) = Nothing,
Optional includedEdges As ISet(Of Edge) = Nothing,
Optional excludedEdges As ISet(Of Edge) = Nothing,
Optional includedVertexProperty As ISet(Of PropertyType) = Nothing,
Optional excludedVertexProperty As ISet(Of PropertyType) = Nothing,
Optional includedEdgeProperty As ISet(Of PropertyType) = Nothing,
Optional excludedEdgeProperty As ISet(Of PropertyType) = Nothing,
Optional validateVertex As Func(Of Vertex, Boolean) = Nothing,
Optional validateEdge As Func(Of Edge, Boolean) = Nothing,
Optional validateEdges As Func(Of List(Of Edge), Boolean) = Nothing
) As List(Of List(Of Edge))
public:
List<List<Edge^>^>^ Traverse(
int maxHops,
bool all = true,
Direction dir = Direction::Both,
Vertex^ toVertex = nullptr,
ISet<EdgeType^>^ edgeTypesToTraverse = nullptr,
ISet<VertexType^>^ includedVertexTypes = nullptr,
ISet<VertexType^>^ excludedVertexTypes = nullptr,
ISet<Vertex^>^ includedVertices = nullptr,
ISet<Vertex^>^ excludedVertices = nullptr,
ISet<Edge^>^ includedEdges = nullptr,
ISet<Edge^>^ excludedEdges = nullptr,
ISet<PropertyType^>^ includedVertexProperty = nullptr,
ISet<PropertyType^>^ excludedVertexProperty = nullptr,
ISet<PropertyType^>^ includedEdgeProperty = nullptr,
ISet<PropertyType^>^ excludedEdgeProperty = nullptr,
Func<Vertex^, bool>^ validateVertex = nullptr,
Func<Edge^, bool>^ validateEdge = nullptr,
Func<List<Edge^>^, bool>^ validateEdges = nullptr
)
member Traverse :
maxHops : int *
?all : bool *
?dir : Direction *
?toVertex : Vertex *
?edgeTypesToTraverse : ISet<EdgeType> *
?includedVertexTypes : ISet<VertexType> *
?excludedVertexTypes : ISet<VertexType> *
?includedVertices : ISet<Vertex> *
?excludedVertices : ISet<Vertex> *
?includedEdges : ISet<Edge> *
?excludedEdges : ISet<Edge> *
?includedVertexProperty : ISet<PropertyType> *
?excludedVertexProperty : ISet<PropertyType> *
?includedEdgeProperty : ISet<PropertyType> *
?excludedEdgeProperty : ISet<PropertyType> *
?validateVertex : Func<Vertex, bool> *
?validateEdge : Func<Edge, bool> *
?validateEdges : Func<List<Edge>, bool>
(* Defaults:
let _all = defaultArg all true
let _dir = defaultArg dir Direction.Both
let _toVertex = defaultArg toVertex null
let _edgeTypesToTraverse = defaultArg edgeTypesToTraverse null
let _includedVertexTypes = defaultArg includedVertexTypes null
let _excludedVertexTypes = defaultArg excludedVertexTypes null
let _includedVertices = defaultArg includedVertices null
let _excludedVertices = defaultArg excludedVertices null
let _includedEdges = defaultArg includedEdges null
let _excludedEdges = defaultArg excludedEdges null
let _includedVertexProperty = defaultArg includedVertexProperty null
let _excludedVertexProperty = defaultArg excludedVertexProperty null
let _includedEdgeProperty = defaultArg includedEdgeProperty null
let _excludedEdgeProperty = defaultArg excludedEdgeProperty null
let _validateVertex = defaultArg validateVertex null
let _validateEdge = defaultArg validateEdge null
let _validateEdges = defaultArg validateEdges null
*)
-> List<List<Edge>>
Parameters
- maxHops
- Type: SystemInt32
maximum number of hops from this Vertex - all (Optional)
- Type: SystemBoolean
find or not find all paths to goal Vertex - dir (Optional)
- Type: VelocityGraph.Frontenac.BlueprintsDirection
Direction to traverse edges - toVertex (Optional)
- Type: VelocityGraphVertex
the goal Vertex. If null, finds all paths - edgeTypesToTraverse (Optional)
- Type: System.Collections.GenericISetEdgeType
the type of edges to follow, by default null which means follow all edge types - includedVertexTypes (Optional)
- Type: System.Collections.GenericISetVertexType
the type of vertices's to follow, by default null which means follow all vertex types - excludedVertexTypes (Optional)
- Type: System.Collections.GenericISetVertexType
the type of vertices's not to follow, by default null - includedVertices (Optional)
- Type: System.Collections.GenericISetVertex
one or more Vertex instances that MUST be in the path for the path to be traversed i.e. if a path does exist
to the specified toVertex, but does not include all the instances in includedVertices set, the Traverse method will exclude that path - excludedVertices (Optional)
- Type: System.Collections.GenericISetVertex
one or more Vertex instances that MUST NOT be in the path for the path to be traversed i.e. if a path does exist
to the specified toVertex, but does include any of the instances in includedVertices set, the Traverse method will exclude that path - includedEdges (Optional)
- Type: System.Collections.GenericISetEdge
one or more Edge instances that MUST be in the path for the path to be traversed i.e. if a path does exist
to the specified toVertex, but does not include all the instances in includedEdges set, the Traverse method will exclude that path - excludedEdges (Optional)
- Type: System.Collections.GenericISetEdge
one or more Edge instances that MUST NOT be in the path for the path to be traversed i.e. if a path does exist
to the specified toVertex, but does include any of the instances in includedEdges set, the Traverse method will exclude that path - includedVertexProperty (Optional)
- Type: System.Collections.GenericISetPropertyType
One or more Vertex property types that MUST be in the path for the path to be accepted i.e. if a path does exist
to the specified toVertex, but does not include all of the Vertex properties in the set, the Traverse method will exclude that path - excludedVertexProperty (Optional)
- Type: System.Collections.GenericISetPropertyType
One or more Vertex property types that MUST NOT be in the path for the path to be accepted i.e. if a path does exist
to the specified toVertex, but does include any of the Vertex properties in the set, the Traverse method will exclude that path - includedEdgeProperty (Optional)
- Type: System.Collections.GenericISetPropertyType
One or more Vertex property types that MUST be in the path for the path to be accepted i.e. if a path does exist
to the specified toVertex, but does not include all of the Vertex properties in the set, the Traverse method will exclude that path - excludedEdgeProperty (Optional)
- Type: System.Collections.GenericISetPropertyType
One or more Edge property types that MUST NOT be in the path for the path to be accepted i.e. if a path does exist
to the specified toVertex, but does include any of the Edge properties in the set, the Traverse method will exclude that path - validateVertex (Optional)
- Type: SystemFuncVertex, Boolean
A function that will be called before accepting a Vertex in path to toVertex. If function returns true then this vertex is accepted in path; otherwise vertex is rejected - validateEdge (Optional)
- Type: SystemFuncEdge, Boolean
A function that will be called before accepting an Edge in path to toVertex. If function returns true then this Edge is accepted in path; otherwise edge is rejected - validateEdges (Optional)
- Type: SystemFuncListEdge, Boolean
A function that will be called before accepting a candidate Edges list in path to toVertex. If function returns true then this Edge list is accepted in path; otherwise edge list is rejected
Return Value
Type:
ListListEdgeList of paths to goal Vertex
See Also