UndirectedStarGraph
public struct UndirectedStarGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension UndirectedStarGraph: IncidenceGraph
extension UndirectedStarGraph: EdgeListGraph
An undirected graph with a star topology, and no self-loop.
-
The total number of vertices in
self
.Declaration
Swift
public let vertexCount: Int
-
Creates an
UndirectedStarGraph
withvertexCount
vertices.Declaration
Swift
public init(vertexCount: Int)
-
Creates an
UndirectedStarGraph
withn
vertices.Declaration
Swift
public init(n: Int)
-
Name for a vertex.
Declaration
Swift
public typealias VertexId = Int
-
Name for an edge.
See moreDeclaration
Swift
public struct EdgeId : Equatable, Comparable, Hashable
-
Declaration
Swift
public struct VertexEdgeCollection : Collection
-
Declaration
Swift
public func edges(from vertex: Int) -> VertexEdgeCollection
-
Declaration
Swift
public func source(of edge: EdgeId) -> Int
-
Declaration
Swift
public func destination(of edge: EdgeId) -> Int
-
Declaration
Swift
public var edges: [EdgeId] { get }