CircleGraph
public struct CircleGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension CircleGraph: IncidenceGraph
extension CircleGraph: VertexListGraph
A graph where each vertex is connected with the subsequent k
vertices, modulo vertexCount
.
-
The number of vertices in
self
.Declaration
Swift
public let vertexCount: Int
-
The number of edges per vertex.
Declaration
Swift
public let outDegree: Int
-
Creates a CircleGraph with
vertexCount
vertices, connected to the nextoutDegree
vertices.Declaration
Swift
public init(vertexCount: Int, outDegree: Int)
-
Creates a CircleGraph with
n
vertices, connected to the nextk
vertices.Declaration
Swift
public init(n: Int, k: Int)
-
Name of a vertex.
Declaration
Swift
public typealias VertexId = Int
-
Name of an edge.
Declaration
Swift
public struct EdgeId : Equatable, Hashable
-
Declaration
Swift
public func edges(from vertex: Int) -> [EdgeId]
-
-
-
Declaration
Swift
public var vertices: Range<Int> { get }