Other Structures
The following structures are available globally.
-
A sparse collection of vertex counts, indexed by the integer degree.
See moreDeclaration
Swift
public struct DegreeDistributionextension 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, _DenseIntegerVertexIdGraphextension DirectedStarGraph: IncidenceGraphextension DirectedStarGraph: BidirectionalGraph
-
An undirected graph with a star topology, and no self-loop.
See moreDeclaration
Swift
public struct UndirectedStarGraph : GraphProtocol, _DenseIntegerVertexIdGraphextension UndirectedStarGraph: IncidenceGraphextension UndirectedStarGraph: EdgeListGraph
-
A graph with an edge between every vertex, including the self loop.
See moreDeclaration
Swift
public struct CompleteGraph : GraphProtocol, _DenseIntegerVertexIdGraphextension CompleteGraph: IncidenceGraphextension CompleteGraph: BidirectionalGraph
-
A graph where each vertex is connected with the subsequent
See morekvertices, modulovertexCount.Declaration
Swift
public struct CircleGraph : GraphProtocol, _DenseIntegerVertexIdGraphextension CircleGraph: IncidenceGraphextension CircleGraph: VertexListGraph -
An undirected complete subgraph over
cliqueVerticesCountwith a single path to a final distinguished vertex.See also: Lollipop graph on Wikipedia
See moreDeclaration
Swift
public struct LollipopGraph : GraphProtocol, _DenseIntegerVertexIdGraphextension LollipopGraph: IncidenceGraphextension 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
IncidenceGraphthat 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
VertexEdgeCollectionof 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 == Underlyingextension EdgeFilterGraph: VertexListGraph where Underlying: VertexListGraphextension EdgeFilterGraph: EdgeListGraph where Underlying: EdgeListGraphextension EdgeFilterGraph: IncidenceGraph where Underlying: IncidenceGraphextension EdgeFilterGraph: BidirectionalGraph where Underlying: BidirectionalGraphextension EdgeFilterGraph: PropertyGraph where Underlying: PropertyGraphextension EdgeFilterGraph: SearchDefaultsGraph where Underlying: SearchDefaultsGraph -
Adapts a
See morePropertyMapto work on an edge-filtered version of a graph.Declaration
Swift
public struct EdgeFilterPropertyMapAdapter< Underlying: PropertyMap, Filter: EdgeFilterProtocol >: PropertyMap where Underlying.Graph == Filter.Graphextension 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.
TransposeGraphadapts 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 moreTransposeGraphoperate with identical complexity as the underlying graph.Declaration
Swift
public struct TransposeGraph<Underlying> : BidirectionalGraph where Underlying : BidirectionalGraphextension TransposeGraph: VertexListGraph where Underlying: VertexListGraphextension TransposeGraph: EdgeListGraph where Underlying: EdgeListGraphextension TransposeGraph: PropertyGraph where Underlying: PropertyGraphextension TransposeGraph: SearchDefaultsGraph where Underlying: SearchDefaultsGraph -
Declaration
Swift
public struct TransposeGraphPropertyMapAdapter<Underlying> : PropertyMap where Underlying : PropertyMap, Underlying.Graph : BidirectionalGraphextension TransposeGraphPropertyMapAdapter: ExternalPropertyMap where Underlying: ExternalPropertyMap
View on GitHub
Other Structures Reference