ReferenceGraph

public class ReferenceGraph

Todo

Make Generic over some type.

Instance Properties

  • All vertices contained herein.

    Declaration

    Swift

    public var vertices: [Node] { get }
  • All edges contained herein.

    Declaration

    Swift

    public var edges: [Edge] { get }
  • Undocumented

    Declaration

    Swift

    public var weight: Float? { get }

Initializers

  • Undocumented

    Declaration

    Swift

    public init()

Instance Methods

  • Add the given vertex.

    Declaration

    Swift

    public func addVertex(_ vertex: Node)
  • Add a directed edge from one vertex to another, with an optional weight.

    Declaration

    Swift

    public func addDirectedEdge(
        from source: Node,
        to destination: Node,
        weight: Float? = nil
    )
  • Declaration

    Swift

    public func weight(from source: Node, to destination: Node) -> Float?

    Return Value

    The weight between two nodes, if such an edge exists, and it has a weight. Otherwise, nil.

  • Declaration

    Swift

    public func edges(from source: Node) -> [Edge]

    Return Value

    All Edge values emanating from the given source vertex.

  • Undocumented

    See more

    Declaration

    Swift

    public class AdjacencyList : CollectionWrapping
  • Undocumented

    See more

    Declaration

    Swift

    public class Edge
  • Undocumented

    Declaration

    Swift

    public class EdgeList
  • Undocumented

    See more

    Declaration

    Swift

    public class Node