Table of Contents

Method PredecessorEdges

Namespace
Bonsai.Dag
Assembly
Bonsai.Core.dll

PredecessorEdges<TNodeValue, TEdgeLabel>(DirectedGraph<TNodeValue, TEdgeLabel>, Node<TNodeValue, TEdgeLabel>)

Returns the sequence of predecessor edges to the specified node.

public static IEnumerable<Tuple<Node<TNodeValue, TEdgeLabel>, Edge<TNodeValue, TEdgeLabel>, int>> PredecessorEdges<TNodeValue, TEdgeLabel>(this DirectedGraph<TNodeValue, TEdgeLabel> source, Node<TNodeValue, TEdgeLabel> node)

Parameters

source DirectedGraph<TNodeValue, TEdgeLabel>

The source directed graph to search for predecessors.

node Node<TNodeValue, TEdgeLabel>

The node for which to obtain the sequence of predecessors.

Returns

IEnumerable<Tuple<Node<TNodeValue, TEdgeLabel>, Edge<TNodeValue, TEdgeLabel>, int>>

A sequence of triples containing the predecessor node, the edge linking the predecessor to the specified node and the edge index.

Type Parameters

TNodeValue

The type of the labels associated with graph nodes.

TEdgeLabel

The type of the labels associated with graph edges.