Other Structures
The following structures are available globally.
-
A sparse collection of vertex counts, indexed by the integer degree.
See moreDeclaration
Swift
public struct DegreeDistribution
extension DegreeDistribution: Collection
-
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).
See moreDeclaration
Swift
public struct DirectedStarGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension DirectedStarGraph: IncidenceGraph
extension DirectedStarGraph: BidirectionalGraph
-
An undirected graph with a star topology, and no self-loop.
See moreDeclaration
Swift
public struct UndirectedStarGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension UndirectedStarGraph: IncidenceGraph
extension UndirectedStarGraph: EdgeListGraph
-
A graph with an edge between every vertex, including the self loop.
See moreDeclaration
Swift
public struct CompleteGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension CompleteGraph: IncidenceGraph
extension CompleteGraph: BidirectionalGraph
-
A graph where each vertex is connected with the subsequent
See morek
vertices, modulovertexCount
.Declaration
Swift
public struct CircleGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension CircleGraph: IncidenceGraph
extension CircleGraph: VertexListGraph
-
An undirected complete subgraph over
cliqueVerticesCount
with a single path to a final distinguished vertex.See also: Lollipop graph on Wikipedia
See moreDeclaration
Swift
public struct LollipopGraph : GraphProtocol, _DenseIntegerVertexIdGraph
extension LollipopGraph: IncidenceGraph
extension LollipopGraph: VertexListGraph
-
A filter that excludes edges whose source and destiation is the same.
See moreDeclaration
Swift
public struct ExcludeSelfEdges<Graph> : EdgeFilterProtocol, DefaultInitializable where Graph : IncidenceGraph
-
Removes half of all edges, such that if both (u, v) and (v, u) were in the graph previously, only one will remain afterwards.
When applied to an
IncidenceGraph
that models an undirected graph (i.e. there are incident edges when queried from both sides), UniqueUndirectedEdges will filter out half.If UniqueUndirectedEdges is applied to a graph that doesn’t include the edge (u, v) in the
VertexEdgeCollection
of bothu
, andv
, unspecified behavior will occur.To keep using your property maps, simply wrap them with
See moreEdgeFilterPropertyMapAdapter
‘s.Declaration
Swift
public struct UniqueUndirectedEdges<Graph: IncidenceGraph>: EdgeFilterProtocol, DefaultInitializable where Graph.VertexId: Comparable
-
Wraps an underlying graph and filters out undesired edges.
See moreDeclaration
Swift
public struct EdgeFilterGraph<Underlying, EdgeFilter: EdgeFilterProtocol>: GraphProtocol where EdgeFilter.Graph == Underlying
extension EdgeFilterGraph: VertexListGraph where Underlying: VertexListGraph
extension EdgeFilterGraph: EdgeListGraph where Underlying: EdgeListGraph
extension EdgeFilterGraph: IncidenceGraph where Underlying: IncidenceGraph
extension EdgeFilterGraph: BidirectionalGraph where Underlying: BidirectionalGraph
extension EdgeFilterGraph: PropertyGraph where Underlying: PropertyGraph
extension EdgeFilterGraph: SearchDefaultsGraph where Underlying: SearchDefaultsGraph
-
Adapts a
See morePropertyMap
to work on an edge-filtered version of a graph.Declaration
Swift
public struct EdgeFilterPropertyMapAdapter< Underlying: PropertyMap, Filter: EdgeFilterProtocol >: PropertyMap where Underlying.Graph == Filter.Graph
extension EdgeFilterPropertyMapAdapter: ExternalPropertyMap where Underlying: ExternalPropertyMap
-
Transposes an underlying graph.
The transpose of a graph of the same number of vertices, but where the source and destination of every edge is reversed.
TransposeGraph
adapts a graph in constant space and constant time to operate as its transpose.To continue to use property maps with the new graph, simply wrap them in
TransposeGraphPropertyMapAdapter
.Note: the VerteId’s and EdgeId’s from the original graph are preserved, which ensures property maps continue to function.
All operations on a
See moreTransposeGraph
operate with identical complexity as the underlying graph.Declaration
Swift
public struct TransposeGraph<Underlying> : BidirectionalGraph where Underlying : BidirectionalGraph
extension TransposeGraph: VertexListGraph where Underlying: VertexListGraph
extension TransposeGraph: EdgeListGraph where Underlying: EdgeListGraph
extension TransposeGraph: PropertyGraph where Underlying: PropertyGraph
extension TransposeGraph: SearchDefaultsGraph where Underlying: SearchDefaultsGraph
-
Declaration
Swift
public struct TransposeGraphPropertyMapAdapter<Underlying> : PropertyMap where Underlying : PropertyMap, Underlying.Graph : BidirectionalGraph
extension TransposeGraphPropertyMapAdapter: ExternalPropertyMap where Underlying: ExternalPropertyMap