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.

DirectedAdjacencyListProtocol: EdgeListGraph

  • edgeCount Extension method

    The total number of edges within the graph.

    Complexity

    O(|V|)

    Declaration

    Swift

    public var edgeCount: Int { get }
  • edges Extension method

    A 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

DirectedAdjacencyListProtocol: Parallel graph operations

  • 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
  • Executes fn in parallel across all vertices, using mailboxes and globalState; returns the computed new GlobalState.

    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
  • Executes fn across all vertices using only a single thread, using mailboxes and globalState; returns the new GlobalState.

    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 using mailboxes.

    Declaration

    Swift

    public mutating func sequentialStep<Mailboxes: MailboxesProtocol>(
      mailboxes: inout Mailboxes,
      _ fn: NoGlobalVertexParallelFunction<Mailboxes.Mailbox>
    ) rethrows where Mailboxes.Mailbox.Graph == ParallelProjection