Show / Hide Table of Contents

Class ArrayUndirectedGraph<TVertex, TEdge>

Immutable undirected graph data structure.

Inheritance
System.Object
ArrayUndirectedGraph<TVertex, TEdge>
Implements
IUndirectedGraph<TVertex, TEdge>
IImplicitUndirectedGraph<TVertex, TEdge>
IEdgeListGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IEdgeSet<TVertex, TEdge>
IVertexSet<TVertex>
IImplicitVertexSet<TVertex>
System.ICloneable
System.Runtime.Serialization.ISerializable
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
[Serializable]
public sealed class ArrayUndirectedGraph<TVertex, TEdge> : IUndirectedGraph<TVertex, TEdge>, IImplicitUndirectedGraph<TVertex, TEdge>, IEdgeListGraph<TVertex, TEdge>, IGraph<TVertex, TEdge>, IEdgeSet<TVertex, TEdge>, IVertexSet<TVertex>, IImplicitVertexSet<TVertex>, ICloneable, ISerializable where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type

Constructors

| Improve this Doc View Source

ArrayUndirectedGraph(IUndirectedGraph<TVertex, TEdge>)

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

Declaration
public ArrayUndirectedGraph(IUndirectedGraph<TVertex, TEdge> baseGraph)
Parameters
Type Name Description
IUndirectedGraph<TVertex, TEdge> baseGraph

Wrapped graph.

Exceptions
Type Condition
System.ArgumentNullException

baseGraph 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

EdgeCount

Gets the edge count.

Declaration
public int EdgeCount { get; }
Property Value
Type Description
System.Int32
| 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

Edges

Gets the edges.

Declaration
public IEnumerable<TEdge> Edges { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<TEdge>
| 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
| Improve this Doc View Source

IsEdgesEmpty

Gets a value indicating whether there are no edges in this set. It is true if this edge set is empty, otherwise false.

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

IsVerticesEmpty

Gets a value indicating whether there are no vertices in this set. It is true if this vertex set is empty, otherwise false.

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

VertexCount

Gets the vertex count.

Declaration
public int VertexCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Vertices

Gets the vertices.

Declaration
public IEnumerable<TVertex> Vertices { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<TVertex>

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

Clone()

Clones this graph, returns this instance because this class is immutable.

Declaration
public ArrayUndirectedGraph<TVertex, TEdge> Clone()
Returns
Type Description
ArrayUndirectedGraph<TVertex, TEdge>

This 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

ContainsEdge(TEdge)

Determines whether this set contains the specified edge.

Declaration
public bool ContainsEdge(TEdge edge)
Parameters
Type Name Description
TEdge edge

Edge to check.

Returns
Type Description
System.Boolean

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

Exceptions
Type Condition
System.ArgumentNullException

edge 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

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.

Explicit Interface Implementations

| Improve this Doc View Source

ICloneable.Clone()

Declaration
object ICloneable.Clone()
Returns
Type Description
System.Object
| Improve this Doc View Source

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Declaration
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info
System.Runtime.Serialization.StreamingContext context

Implements

IUndirectedGraph<TVertex, TEdge>
IImplicitUndirectedGraph<TVertex, TEdge>
IEdgeListGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IEdgeSet<TVertex, TEdge>
IVertexSet<TVertex>
IImplicitVertexSet<TVertex>
System.ICloneable
System.Runtime.Serialization.ISerializable

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>)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
GraphExtensions.ToArrayUndirectedGraph<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
AlgorithmExtensions.GetVertexIdentity<TVertex>(IVertexSet<TVertex>)
AlgorithmExtensions.GetEdgeIdentity<TVertex, TEdge>(IEdgeSet<TVertex, TEdge>)
AlgorithmExtensions.ShortestPathsDijkstra<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>, Func<TEdge, Double>, TVertex)
AlgorithmExtensions.TopologicalSort<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
AlgorithmExtensions.SourceFirstTopologicalSort<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
AlgorithmExtensions.ConnectedComponents<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)
AlgorithmExtensions.IsUndirectedAcyclicGraph<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
AlgorithmExtensions.ComputeDisjointSet<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>)
AlgorithmExtensions.MinimumSpanningTreePrim<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>, Func<TEdge, Double>)
AlgorithmExtensions.MinimumSpanningTreeKruskal<TVertex, TEdge>(IUndirectedGraph<TVertex, TEdge>, Func<TEdge, Double>)
AlgorithmExtensions.ComputeTransitiveReduction<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.ComputeTransitiveClosure<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, Func<TVertex, TVertex, TEdge>)
GraphvizExtensions.ToGraphviz<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>)
GraphvizExtensions.ToGraphviz<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, Action<GraphvizAlgorithm<TVertex, TEdge>>)
GraphvizExtensions.ToSvg<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>)
GraphvizExtensions.ToSvg<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, Action<GraphvizAlgorithm<TVertex, TEdge>>)
MsaglGraphExtensions.CreateMsaglPopulator<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>)
MsaglGraphExtensions.CreateMsaglPopulator<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, String, IFormatProvider)
MsaglGraphExtensions.CreateMsaglPopulator<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>)
MsaglGraphExtensions.ToMsaglGraph<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, MsaglVertexNodeEventHandler<TVertex>, MsaglEdgeEventHandler<TVertex, TEdge>)
MsaglGraphExtensions.ToMsaglGraph<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>, MsaglVertexNodeEventHandler<TVertex>, MsaglEdgeEventHandler<TVertex, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph