CompleteGraph
public struct CompleteGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension CompleteGraph: IncidenceGraph
extension CompleteGraph: BidirectionalGraph
A graph with an edge between every vertex, including the self loop.
-
The number of vertices in
self
.Declaration
Swift
public let vertexCount: Int
-
Creates a
CompleteGraph
withvertexCount
vertices.Declaration
Swift
public init(vertexCount: Int)
-
Creates a
CompleteGraph
withn
vertices.Declaration
Swift
public init(n: Int)
-
The name for a vertex in
self
.Declaration
Swift
public typealias VertexId = Int
-
The name for an edge in
self
.Declaration
Swift
public typealias EdgeId = Int
-
Declaration
Swift
public func edges(from vertex: Int) -> Range<Int>
-
Declaration
Swift
public func source(of edge: Int) -> Int
-
Declaration
Swift
public func destination(of edge: Int) -> Int
-
Declaration
Swift
public func edges(to vertex: Int) -> [Int]