DirectedStarGraph
public struct DirectedStarGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension DirectedStarGraph: IncidenceGraph
extension DirectedStarGraph: BidirectionalGraph
A directed graph with a star topology, where vertex 0 is at the center, and every vertex has an edge to vertex 0 (including the self-loop at vertex 0).
-
The total number of vertices in
self
.Declaration
Swift
public let vertexCount: Int
-
Creates a
DirectedStarGraph
withvertexCount
vertices.Declaration
Swift
public init(vertexCount: Int)
-
Creates a
DirectedStarGraph
withn
vertices.Declaration
Swift
public init(n: Int)
-
Name of a vertex in
self
.Declaration
Swift
public typealias VertexId = Int
-
Name of an edge in
self
.Declaration
Swift
public typealias EdgeId = Int
-
Declaration
Swift
public func edges(from vertex: Int) -> CollectionOfOne<Int>
-
Declaration
Swift
public func source(of edge: Int) -> Int
-
Declaration
Swift
public func destination(of edge: Int) -> Int
-
The collection of in edges to a vertex.
See moreDeclaration
Swift
public struct VertexInEdgeCollection : Collection
-
Declaration
Swift
public func edges(to vertex: Int) -> VertexInEdgeCollection