Graph Algorithm State
-
VertexColoris used to represent which vertices have been seen during graph searches.Note: although there are vague interpretations for what each color means, their exact properties are dependent upon the kind of graph search algorithm being executed.
See moreDeclaration
Swift
public enum VertexColor -
The events that occur during breadth first search within a graph.
See moreSee also
IncidenceGraph.BFSCallbackDeclaration
Swift
public enum BFSEvent<SearchSpace> where SearchSpace : GraphProtocol -
The events that occur during depth first search within a graph.
See moreSee also
IncidenceGraph.DFSCallbackDeclaration
Swift
public enum DFSEvent<SearchSpace> where SearchSpace : GraphProtocol -
The events that occur during Dijkstra’s search within a graph.
See moreSee also
IncidenceGraph.VertexListGraph.Declaration
Swift
public enum DijkstraSearchEvent<SearchSpace> where SearchSpace : GraphProtocol -
Represents a distance measure on a graph.
See moreDeclaration
Swift
public protocol GraphDistanceMeasure : AdditiveArithmetic, Comparable -
A table that records the parents of every discovered vertex in a graph search algorithm.
Example:
See morevar g = makeAdjacencyList() let predecessors = TablePredecessorRecorder(for: g) g.breadthFirstSearch(startingAt: g.vertices.first!) { e, g in predecessors.record(e, graph: g) }Declaration
Swift
public struct TablePredecessorRecorder<Graph> where Graph : IncidenceGraph -
A dictionary that records the parents of every discovered vertex in a graph search algorithm.
Example:
See morevar g = CompleteInfiniteGrid() let preds = DictionaryPredecessorRecorder(for: g) g.breadthFirstSearch(startingAt: .origin) { e, g in preds.record(e, graph: g) }Declaration
Swift
public struct DictionaryPredecessorRecorder<Graph: IncidenceGraph>: DefaultInitializable where Graph.VertexId: Hashable -
Errors that can be thrown during graph processing.
See moreDeclaration
Swift
public enum GraphErrors : Error
View on GitHub
Graph Algorithm State Reference