Protocols

The following protocols are available globally.

  • Description of abstract graph type.

    Provides a generic set of graph operations, without assuming a weighting on the graph.

    See more

    Declaration

    Swift

    public protocol Graph
  • Description of an undirected graph.

    This protocol is identical to Graph and DirectedGraph, but new types should implement this protocol if the edgeExists function is reflexive, i.e. if the edges have no associated direction.

    Declaration

    Swift

    public protocol UndirectedGraph: Graph { }
  • Description of a directed graph.

    This protocol is identical to Graph and UndirectedGraph, but new types should implement this protocol with the edgeExists function not reflexive, i.e. if the edges have an associated direction.

    Declaration

    Swift

    public protocol DirectedGraph: Graph { }
  • Description of a weighted graph.

    Weighted graphs have a weight associated with each edge.

    See more

    Declaration

    Swift

    public protocol WeightedGraph: Graph
  • A weighted undirected graph protocol.

    This protocol is identical to a weighted graph, but it requires that the implementation of edgeExists be symmetric, i.e. edges go both ways.

    Declaration

    Swift

    public protocol WeightedUndirectedGraph : WeightedGraph {}
  • A weighted directed graph protocol.

    This protocol is idential to a weighted graph, but it requires that the implementation of edgeExists not be symmetric, i.e. edges go in only one direction

    Declaration

    Swift

    public protocol WeightedDirectedGraph : WeightedGraph {}