DirectedAdjacencyListProtocol
public protocol DirectedAdjacencyListProtocol: AdjacencyListProtocol, ParallelGraph
where
VertexEdgeCollection == _AdjacencyList_DirectedVertexEdgeCollection<_EdgeData>,
ParallelProjection == _DirectedAdjacencyList_ParallelProjection<_VertexData>,
EdgeCollection == _AdjacencyList_DirectedEdgeCollection<_Storage>
Adjacency lists whose edges are directed.
-
edgeCount
Extension methodThe total number of edges within the graph.
Complexity
O(|V|)Declaration
Swift
public var edgeCount: Int { get }
-
edges
Extension methodA collection of all edges in
self
.Declaration
Swift
public var edges: EdgeCollection { get }
-
source(of:
Extension method) Returns the source vertex of
edge
.Declaration
Swift
public func source(of edge: EdgeId) -> VertexId
-
destination(of:
Extension method) Returns the destination vertex of
edge
.Declaration
Swift
public func destination(of edge: EdgeId) -> VertexId
-
step(mailboxes:
Extension methodglobalState: _: ) Declaration
Swift
public mutating func step< Mailboxes: MailboxesProtocol, GlobalState: MergeableMessage & DefaultInitializable >( mailboxes: inout Mailboxes, globalState: GlobalState, _ fn: VertexParallelFunction<Mailboxes.Mailbox, GlobalState> ) rethrows -> GlobalState where Mailboxes.Mailbox.Graph == ParallelProjection
-
parallelStep(mailboxes:
Extension methodglobalState: _: ) Executes
fn
in parallel across all vertices, usingmailboxes
andglobalState
; returns the computed newGlobalState
.Declaration
Swift
public mutating func parallelStep< Mailboxes: MailboxesProtocol, GlobalState: MergeableMessage & DefaultInitializable >( mailboxes: inout Mailboxes, globalState: GlobalState, _ fn: VertexParallelFunction<Mailboxes.Mailbox, GlobalState> ) rethrows -> GlobalState where Mailboxes.Mailbox.Graph == ParallelProjection
-
sequentialStep(mailboxes:
Extension methodglobalState: _: ) Executes
fn
across all vertices using only a single thread, usingmailboxes
andglobalState
; returns the newGlobalState
.See also
parallelStep
Declaration
Swift
public mutating func sequentialStep< Mailboxes: MailboxesProtocol, GlobalState: MergeableMessage & DefaultInitializable >( mailboxes: inout Mailboxes, globalState: GlobalState, _ fn: VertexParallelFunction<Mailboxes.Mailbox, GlobalState> ) rethrows -> GlobalState where Mailboxes.Mailbox.Graph == ParallelProjection
-
sequentialStep(mailboxes:
Extension method_: ) Executes
fn
across all vertices using only a single thread usingmailboxes
.Declaration
Swift
public mutating func sequentialStep<Mailboxes: MailboxesProtocol>( mailboxes: inout Mailboxes, _ fn: NoGlobalVertexParallelFunction<Mailboxes.Mailbox> ) rethrows where Mailboxes.Mailbox.Graph == ParallelProjection