Show / Hide Table of Contents

Class DelegateBidirectionalIncidenceGraph<TVertex, TEdge>

A delegate-based directed bidirectional graph data structure.

Inheritance
System.Object
DelegateImplicitGraph<TVertex, TEdge>
DelegateIncidenceGraph<TVertex, TEdge>
DelegateBidirectionalIncidenceGraph<TVertex, TEdge>
Implements
IBidirectionalIncidenceGraph<TVertex, TEdge>
IIncidenceGraph<TVertex, TEdge>
IImplicitGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>
Inherited Members
DelegateIncidenceGraph<TVertex, TEdge>.ContainsEdge(TVertex, TVertex)
DelegateIncidenceGraph<TVertex, TEdge>.TryGetEdge(TVertex, TVertex, TEdge)
DelegateIncidenceGraph<TVertex, TEdge>.TryGetEdges(TVertex, TVertex, IEnumerable<TEdge>)
DelegateImplicitGraph<TVertex, TEdge>.IsDirected
DelegateImplicitGraph<TVertex, TEdge>.AllowParallelEdges
DelegateImplicitGraph<TVertex, TEdge>.IsOutEdgesEmpty(TVertex)
DelegateImplicitGraph<TVertex, TEdge>.OutDegree(TVertex)
DelegateImplicitGraph<TVertex, TEdge>.OutEdges(TVertex)
DelegateImplicitGraph<TVertex, TEdge>.TryGetOutEdges(TVertex, IEnumerable<TEdge>)
DelegateImplicitGraph<TVertex, TEdge>.OutEdge(TVertex, Int32)
DelegateImplicitGraph<TVertex, TEdge>.ContainsVertex(TVertex)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 Source

DelegateBidirectionalIncidenceGraph(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

tryGetOutEdges is null.

System.ArgumentNullException

tryGetInEdges is null.

Methods

| Improve this Doc View Source

Degree(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 vertex.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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 vertex.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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 index.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

System.ArgumentOutOfRangeException

No vertex at index.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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 vertex.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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 vertex has no in-edges, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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 vertex was found or/and in-edges were found, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

Implements

IBidirectionalIncidenceGraph<TVertex, TEdge>
IIncidenceGraph<TVertex, TEdge>
IImplicitGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToBinary<TVertex, TEdge>(IGraph<TVertex, TEdge>, Stream)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph