UnweightedGraphProtocol
public protocol UnweightedGraphProtocol : GraphProtocol
Interface for unweighted graphs.
-
All of the edges contained herein.
Declaration
Swift
var edges: Set<Edge> { get set }
-
Creates an
UnweightedGraphProtocol-conforming type value with the given set ofnodesand the given set ofedges.Declaration
Swift
init(_ nodes: Set<Node>, _ edges: Set<Edge>) -
init(path:Extension method) Creates an
UnweightedGraphProtocol-conforming type value which is composed a path of nodes.Declaration
Swift
@inlinable public init<S>(path: S) where S : Sequence, Self.Node == S.Element
-
insertEdge(from:Extension methodto: ) Inserts an edge between the given
sourceanddestinationnodes.If the
sourceordestinationnodes are not yet contained herein, they are inserted.Declaration
Swift
@inlinable public mutating func insertEdge(from source: Node, to destination: Node) -
remove(_:Extension method) Removes
edgefrom graph.Declaration
Swift
@inlinable public mutating func remove(_ edge: Edge) -
+(_:Extension method_: ) Declaration
Swift
@inlinable public static func + (lhs: Self, rhs: Self) -> SelfReturn Value
A new graph with the union of the nodes and edges of the two given graphs.
View on GitHub
Install in Dash
UnweightedGraphProtocol Protocol Reference