WeightedGraph
public struct WeightedGraph <Node: Hashable, Weight>:
WeightedGraphProtocol,
UndirectedGraphProtocol
extension WeightedGraph: Equatable where Weight: Equatable
extension WeightedGraph: Hashable where Weight: Hashable
Weighted, 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 stored with their weight.
An
Edgeis anUnorderedPairofNodevalues, and aWeightis anyAdditiveGroup-conforming value.Declaration
Swift
public var weights: [Edge : Weight]
-
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
WeightedGraphwith enough memory to store the givenminimumNodesCapacityandminimumEdgesCapacity.Declaration
Swift
public init(minimumNodesCapacity: Int, minimumEdgesCapacity: Int)
View on GitHub
Install in Dash
WeightedGraph Structure Reference