Show / Hide Table of Contents

Class DelegateImplicitUndirectedGraph<TVertex, TEdge>

A delegate-based undirected implicit graph data structure.

Inheritance
System.Object
DelegateImplicitUndirectedGraph<TVertex, TEdge>
DelegateUndirectedGraph<TVertex, TEdge>
Implements
IImplicitUndirectedGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>
IGraph<TVertex, TEdge>
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 DelegateImplicitUndirectedGraph<TVertex, TEdge> : IImplicitUndirectedGraph<TVertex, TEdge>, IImplicitVertexSet<TVertex>, IGraph<TVertex, TEdge> where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Constructors

| Improve this Doc View Source

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

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

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

Getter of adjacent 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

tryGetAdjacentEdges 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

EdgeEqualityComparer

Comparer for edges.

Declaration
public EdgeEqualityComparer<TVertex> EdgeEqualityComparer { get; }
Property Value
Type Description
EdgeEqualityComparer<TVertex>
| 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

AdjacentDegree(TVertex)

Gives the adjacent degree of the given vertex.

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

The vertex.

Returns
Type Description
System.Int32

Vertex adjacent degree.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

AdjacentEdge(TVertex, Int32)

Gets the indexth adjacent edge of the given vertex.

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

The vertex.

System.Int32 index

Index of the adjacent edge requested.

Returns
Type Description
TEdge

The adjacent edge.

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

AdjacentEdges(TVertex)

Gives the enumerable of edges adjacent to the given vertex.

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

The vertex.

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

Enumerable of adjacent edges.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

ContainsEdge(TVertex, TVertex)

Checks if this graph contains an edge that link source and target vertices.

Declaration
public bool ContainsEdge(TVertex source, TVertex target)
Parameters
Type Name Description
TVertex source

Source vertex.

TVertex target

Target vertex.

Returns
Type Description
System.Boolean

True if an edge exists, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

source is null.

System.ArgumentNullException

target is null.

| 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

IsAdjacentEdgesEmpty(TVertex)

Indicates if the given vertex has at least one adjacent edge.

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

The vertex.

Returns
Type Description
System.Boolean

True if the vertex has at least one adjacent edge, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

TryGetAdjacentEdges(TVertex, out IEnumerable<TEdge>)

Tries to get adjacent edges of the given vertex.

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

The vertex.

System.Collections.Generic.IEnumerable<TEdge> edges

Edges found, otherwise null.

Returns
Type Description
System.Boolean

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

Exceptions
Type Condition
System.ArgumentNullException

vertex is null.

| Improve this Doc View Source

TryGetEdge(TVertex, TVertex, out TEdge)

Tries to get the edge that link source and target vertices.

Declaration
public bool TryGetEdge(TVertex source, TVertex target, out TEdge edge)
Parameters
Type Name Description
TVertex source

Source vertex.

TVertex target

Target vertex.

TEdge edge

Edge found, otherwise null.

Returns
Type Description
System.Boolean

True if an edge was found, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

source is null.

System.ArgumentNullException

target is null.

Implements

IImplicitUndirectedGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>
IGraph<TVertex, TEdge>

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