WeightedDirectedGraph
public struct WeightedDirectedGraph <Node: Hashable, Weight>:
WeightedGraphProtocol,
DirectedGraphProtocol
extension WeightedDirectedGraph: Equatable where Weight: Equatable
extension WeightedDirectedGraph: Hashable where Weight: Hashable
Weighted, directed graph.
-
Declaration
Swift
public var nodes: Set<Node>
-
Declaration
Swift
public var weights: [Edge : Weight]
-
The type of edges which connect nodes.
Declaration
Swift
public typealias Edge = OrderedPair<Node>
-
Creates a
Graph
with the given set of nodes, with no edges between the nodes.Declaration
Swift
@inlinable public init(_ nodes: Set<Node> = [])
-
Creates a
WeightedDirectedGraph
with enough memory to store the givenminimumNodesCapacity
andminimumEdgesCapacity
.Declaration
Swift
public init(minimumNodesCapacity: Int, minimumEdgesCapacity: Int)