Graph
public struct Graph<Node> : UnweightedGraphProtocol, UndirectedGraphProtocol where Node : Hashable
extension Graph: Equatable
extension Graph: Hashable
Unweighted, undirected graph.
-
All of the nodes contained herein.
A
Nodeis anyHashable-conforming value.Declaration
Swift
public var nodes: Set<Node> -
All of the edges contained herein.
An
Edgeis anUnorderedPairofNodevalues.Declaration
Swift
public var edges: Set<Edge>
-
The type of edges which connect nodes.
Declaration
Swift
public typealias Edge = UnorderedPair<Node>
-
Creates a
Graphwith the given set of nodes, with no edges between the nodes.Declaration
Swift
@inlinable public init(_ nodes: Set<Node> = []) -
Creates a
Graphwith the given set of nodes and the given set of edges connecting the nodes.Declaration
Swift
@inlinable public init(_ nodes: Set<Node> = [], _ edges: Set<Edge> = []) -
Creates a
Graphwith enough memory to store the givenminimumNodesCapacityandminimumEdgesCapacity.Declaration
Swift
public init(minimumNodesCapacity: Int, minimumEdgesCapacity: Int)
View on GitHub
Install in Dash
Graph Structure Reference