Show / Hide Table of Contents

Class DelegateImplicitGraph<TVertex, TEdge>

A delegate-based directed implicit graph data structure.

Inheritance
System.Object
DelegateImplicitGraph<TVertex, TEdge>
DelegateIncidenceGraph<TVertex, TEdge>
Implements
IImplicitGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>
Inherited Members
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 DelegateImplicitGraph<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

DelegateImplicitGraph(TryFunc<TVertex, IEnumerable<TEdge>>, Boolean)

Initializes a new instance of the DelegateImplicitGraph<TVertex, TEdge> class.

Declaration
public DelegateImplicitGraph(TryFunc<TVertex, IEnumerable<TEdge>> tryGetOutEdges, bool allowParallelEdges = true)
Parameters
Type Name Description
TryFunc<TVertex, System.Collections.Generic.IEnumerable<TEdge>> tryGetOutEdges

Getter of out-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.

Properties

| Improve this Doc View Source

AllowParallelEdges

Gets a value indicating if the graph allows parallel edges

Declaration
public bool AllowParallelEdges { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsDirected

Gets a value indicating if the graph is directed

Declaration
public bool IsDirected { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

ContainsVertex(TVertex)

Determines whether this set contains the specified vertex.

Declaration
public bool ContainsVertex(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

Vertex to check.

Returns
Type Description
System.Boolean

True if the specified vertex is contained in this set, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

| Improve this Doc View Source

IsOutEdgesEmpty(TVertex)

Determines whether there are out-edges associated to vertex.

Declaration
public bool IsOutEdgesEmpty(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

The vertex.

Returns
Type Description
System.Boolean

True if vertex has no out-edges, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

OutDegree(TVertex)

Gets the count of out-edges of vertex.

Declaration
public int OutDegree(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

The vertex.

Returns
Type Description
System.Int32

The count of out-edges of vertex.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

OutEdge(TVertex, Int32)

Gets the out-edge of vertex at position index.

Declaration
public TEdge OutEdge(TVertex vertex, int index)
Parameters
Type Name Description
TVertex vertex

The vertex.

System.Int32 index

The index.

Returns
Type Description
TEdge

The out-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

OutEdges(TVertex)

Gets the out-edges of vertex.

Declaration
public IEnumerable<TEdge> OutEdges(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

The vertex.

Returns
Type Description
System.Collections.Generic.IEnumerable<TEdge>

An enumeration of the out-edges of vertex.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

TryGetOutEdges(TVertex, out IEnumerable<TEdge>)

Tries to get the out-edges of vertex.

Declaration
public bool TryGetOutEdges(TVertex vertex, out IEnumerable<TEdge> edges)
Parameters
Type Name Description
TVertex vertex

The vertex.

System.Collections.Generic.IEnumerable<TEdge> edges

Out-edges.

Returns
Type Description
System.Boolean

True if vertex was found or/and out-edges were found, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

Implements

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