BFSEvent

public enum BFSEvent<SearchSpace> where SearchSpace : GraphProtocol

The events that occur during breadth first search within a graph.

  • Identifies a vertex in the search space.

    Declaration

    Swift

    public typealias Vertex = SearchSpace.VertexId
  • Identifies an edge in the search space.

    Declaration

    Swift

    public typealias Edge = SearchSpace.EdgeId
  • When search begins, identifying the the start vertex.

    Note: this event may trigger multiple times if there are multiple start vertices.

    Declaration

    Swift

    case start(Vertex)
  • When a new vertex is discovered in the search space.

    Declaration

    Swift

    case discover(Vertex)
  • When a vertex is popped off the front of the queue for processing.

    Declaration

    Swift

    case examineVertex(Vertex)
  • When an edge is traversed to look for new vertices to discover.

    Declaration

    Swift

    case examineEdge(Edge)
  • When an edge’s destination has not been encountered before in the search; this edge forms part of the search tree.

    Declaration

    Swift

    case treeEdge(Edge)
  • When an edge’s destination has already been encountered before in the search.

    Note: this edge could have either a “gray” or a “black” destination.

    Declaration

    Swift

    case nonTreeEdge(Edge)
  • When the edge’s destination has previously been discovered, but has not been examined.

    Declaration

    Swift

    case grayDestination(Edge)
  • When the edge’s destination has already been discovered and examined.

    Declaration

    Swift

    case blackDestination(Edge)
  • When all edges from a vertex have been traversed.

    Declaration

    Swift

    case finish(Vertex)