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 ofnodes
and 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
source
anddestination
nodes.If the
source
ordestination
nodes 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
edge
from graph.Declaration
Swift
@inlinable public mutating func remove(_ edge: Edge)
-
+(_:
Extension method_: ) Declaration
Swift
@inlinable public static func + (lhs: Self, rhs: Self) -> Self
Return Value
A new graph with the union of the nodes and edges of the two given graphs.