Class DelegateBidirectionalIncidenceGraph<TVertex, TEdge>
A delegate-based directed bidirectional graph data structure.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph
Assembly: QuikGraph.dll
Syntax
public class DelegateBidirectionalIncidenceGraph<TVertex, TEdge> : DelegateIncidenceGraph<TVertex, TEdge>, IBidirectionalIncidenceGraph<TVertex, TEdge>, IIncidenceGraph<TVertex, TEdge>, IImplicitGraph<TVertex, TEdge>, IGraph<TVertex, TEdge>, IImplicitVertexSet<TVertex> where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceDelegateBidirectionalIncidenceGraph(TryFunc<TVertex, IEnumerable<TEdge>>, TryFunc<TVertex, IEnumerable<TEdge>>, Boolean)
Initializes a new instance of the DelegateBidirectionalIncidenceGraph<TVertex, TEdge> class.
Declaration
public DelegateBidirectionalIncidenceGraph(TryFunc<TVertex, IEnumerable<TEdge>> tryGetOutEdges, TryFunc<TVertex, IEnumerable<TEdge>> tryGetInEdges, bool allowParallelEdges = true)
Parameters
Type | Name | Description |
---|---|---|
TryFunc<TVertex, System.Collections.Generic.IEnumerable<TEdge>> | tryGetOutEdges | Getter of out-edges. |
TryFunc<TVertex, System.Collections.Generic.IEnumerable<TEdge>> | tryGetInEdges | Getter of in-edges. |
System.Boolean | allowParallelEdges | Indicates if parallel edges are allowed. Note that get of edges is delegated so you may have bugs related to parallel edges due to the delegated implementation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Methods
| Improve this Doc View SourceDegree(TVertex)
Gets the degree of vertex
, i.e.
the sum of the out-degree and in-degree of vertex
.
Declaration
public int Degree(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
System.Int32 | The sum of OutDegree and InDegree of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
VertexNotFoundException |
|
InDegree(TVertex)
Gets the number of in-edges of vertex
.
Declaration
public int InDegree(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
System.Int32 | The number of in-edges pointing towards |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
VertexNotFoundException |
|
InEdge(TVertex, Int32)
Gets the in-edge at location index
.
Declaration
public TEdge InEdge(TVertex vertex, int index)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
System.Int32 | index | The index. |
Returns
Type | Description |
---|---|
TEdge | The in-edge at position |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException | No vertex at |
VertexNotFoundException |
|
InEdges(TVertex)
Gets the collection of in-edges of vertex
.
Declaration
public IEnumerable<TEdge> InEdges(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TEdge> | The collection of in-edges of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
VertexNotFoundException |
|
IsInEdgesEmpty(TVertex)
Determines whether vertex
has no in-edges.
Declaration
public bool IsInEdgesEmpty(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
VertexNotFoundException |
|
TryGetInEdges(TVertex, out IEnumerable<TEdge>)
Tries to get the in-edges of vertex
.
Declaration
public bool TryGetInEdges(TVertex vertex, out IEnumerable<TEdge> edges)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | The vertex. |
System.Collections.Generic.IEnumerable<TEdge> | edges | In-edges. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|