Interface INode
Represents a single node in a generic directed graph.
public interface INode
Properties
InDegree
Gets a value indicating the number of incoming edges that this node is incident to.
int InDegree { get; }
Property Value
OutDegree
Gets a value indicating the number of outgoing edges that this node is incident to.
int OutDegree { get; }
Property Value
Methods
GetIncomingEdges()
Gets a collection of all edges that target this node.
IEnumerable<IEdge> GetIncomingEdges()
Returns
- IEnumerable<IEdge>
The incoming edges.
GetOutgoingEdges()
Gets a collection of all outgoing edges originating from this node.
IEnumerable<IEdge> GetOutgoingEdges()
Returns
- IEnumerable<IEdge>
The outgoing edges.
GetPredecessors()
Gets a collection of nodes that precede this node.
IEnumerable<INode> GetPredecessors()
Returns
- IEnumerable<INode>
The predecessor nodes.
GetSuccessors()
Gets a collection of nodes that can be reached from this node by following one of the incident edges.
IEnumerable<INode> GetSuccessors()
Returns
- IEnumerable<INode>
The successor nodes.
HasPredecessor(INode)
Determines whether the provided node precedes the current node.
bool HasPredecessor(INode node)
Parameters
nodeINodeThe node to check.
Returns
- bool
Trueif the node is a predecessor,falseotherwise.
HasSuccessor(INode)
Determines whether the provided node can be reached from this node by following one of the incident edges.
bool HasSuccessor(INode node)
Parameters
nodeINodeThe node to check.
Returns
- bool
Trueif the node is a successor,falseotherwise.