Show / Hide Table of Contents

Class ReversedBidirectionalGraph<TVertex, TEdge>

Mutable reversed bidirectional graph data structure.

Inheritance
System.Object
ReversedBidirectionalGraph<TVertex, TEdge>
Implements
IBidirectionalGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IVertexAndEdgeListGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IVertexListGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IEdgeListGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IEdgeSet<TVertex, SReversedEdge<TVertex, TEdge>>
IVertexSet<TVertex>
IBidirectionalIncidenceGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IIncidenceGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IImplicitGraph<TVertex, SReversedEdge<TVertex, TEdge>>
IGraph<TVertex, SReversedEdge<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
[Serializable]
public sealed class ReversedBidirectionalGraph<TVertex, TEdge> : IBidirectionalGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IVertexAndEdgeListGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IVertexListGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IEdgeListGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IEdgeSet<TVertex, SReversedEdge<TVertex, TEdge>>, IVertexSet<TVertex>, IBidirectionalIncidenceGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IIncidenceGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IImplicitGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IGraph<TVertex, SReversedEdge<TVertex, TEdge>>, IImplicitVertexSet<TVertex> where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type

Remarks

It is mutable via the original graph.

Constructors

| Improve this Doc View Source

ReversedBidirectionalGraph(IBidirectionalGraph<TVertex, TEdge>)

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

Declaration
public ReversedBidirectionalGraph(IBidirectionalGraph<TVertex, TEdge> originalGraph)
Parameters
Type Name Description
IBidirectionalGraph<TVertex, TEdge> originalGraph

Original graph to reverse.

Exceptions
Type Condition
System.ArgumentNullException

originalGraph 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

Edges

Gets the edges.

Declaration
public IEnumerable<SReversedEdge<TVertex, TEdge>> Edges { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, 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

OriginalGraph

Original graph.

Declaration
public IBidirectionalGraph<TVertex, TEdge> OriginalGraph { get; }
Property Value
Type Description
IBidirectionalGraph<TVertex, TEdge>
| 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

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(SReversedEdge<TVertex, TEdge>)

Determines whether this set contains the specified edge.

Declaration
public bool ContainsEdge(SReversedEdge<TVertex, TEdge> edge)
Parameters
Type Name Description
SReversedEdge<TVertex, TEdge> edge
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

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 SReversedEdge<TVertex, TEdge> InEdge(TVertex vertex, int index)
Parameters
Type Name Description
TVertex vertex

The vertex.

System.Int32 index

The index.

Returns
Type Description
SReversedEdge<TVertex, 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<SReversedEdge<TVertex, TEdge>> InEdges(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

The vertex.

Returns
Type Description
System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, 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

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 SReversedEdge<TVertex, TEdge> OutEdge(TVertex vertex, int index)
Parameters
Type Name Description
TVertex vertex

The vertex.

System.Int32 index

The index.

Returns
Type Description
SReversedEdge<TVertex, 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<SReversedEdge<TVertex, TEdge>> OutEdges(TVertex vertex)
Parameters
Type Name Description
TVertex vertex

The vertex.

Returns
Type Description
System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, 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

TryGetEdge(TVertex, TVertex, out SReversedEdge<TVertex, TEdge>)

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

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

Source vertex.

TVertex target

Target vertex.

SReversedEdge<TVertex, TEdge> edge
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.

| Improve this Doc View Source

TryGetEdges(TVertex, TVertex, out IEnumerable<SReversedEdge<TVertex, TEdge>>)

Tries to get edges that link source and target vertices.

Declaration
public bool TryGetEdges(TVertex source, TVertex target, out IEnumerable<SReversedEdge<TVertex, TEdge>> edges)
Parameters
Type Name Description
TVertex source

Source vertex.

TVertex target

Target vertex.

System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, TEdge>> edges
Returns
Type Description
System.Boolean

True if at least an edge was found, false otherwise.

Exceptions
Type Condition
System.ArgumentNullException

source is null.

System.ArgumentNullException

target is null.

| Improve this Doc View Source

TryGetInEdges(TVertex, out IEnumerable<SReversedEdge<TVertex, TEdge>>)

Tries to get the in-edges of vertex.

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

The vertex.

System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, TEdge>> 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.

| Improve this Doc View Source

TryGetOutEdges(TVertex, out IEnumerable<SReversedEdge<TVertex, TEdge>>)

Tries to get the out-edges of vertex.

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

The vertex.

System.Collections.Generic.IEnumerable<SReversedEdge<TVertex, TEdge>> 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

IBidirectionalGraph<TVertex, TEdge>
IVertexAndEdgeListGraph<TVertex, TEdge>
IVertexListGraph<TVertex, TEdge>
IEdgeListGraph<TVertex, TEdge>
IEdgeSet<TVertex, TEdge>
IVertexSet<TVertex>
IBidirectionalIncidenceGraph<TVertex, TEdge>
IIncidenceGraph<TVertex, TEdge>
IImplicitGraph<TVertex, TEdge>
IGraph<TVertex, TEdge>
IImplicitVertexSet<TVertex>

Extension Methods

DirectedGraphMLExtensions.ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
DirectedGraphMLExtensions.ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TVertex, GraphColor>)
DirectedGraphMLExtensions.ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
DirectedGraphMLExtensions.ToDirectedGraphML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, Action<TVertex, DirectedGraphNode>, Action<TEdge, DirectedGraphLink>)
DirectedGraphMLExtensions.OpenAsDGML<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, String)
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.ToArrayAdjacencyGraph<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
GraphExtensions.ToArrayBidirectionalGraph<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>)
GraphExtensions.ToCompressedRowGraph<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.GetVertexIdentity<TVertex>(IVertexSet<TVertex>)
AlgorithmExtensions.GetEdgeIdentity<TVertex, TEdge>(IEdgeSet<TVertex, TEdge>)
AlgorithmExtensions.TreeBreadthFirstSearch<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, TVertex)
AlgorithmExtensions.TreeDepthFirstSearch<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, TVertex)
AlgorithmExtensions.TreeCyclePoppingRandom<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, TVertex)
AlgorithmExtensions.TreeCyclePoppingRandom<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, TVertex, IMarkovEdgeChain<TVertex, TEdge>)
AlgorithmExtensions.ShortestPathsDijkstra<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, TVertex)
AlgorithmExtensions.ShortestPathsAStar<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, Func<TVertex, Double>, TVertex)
AlgorithmExtensions.ShortestPathsBellmanFord<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, TVertex, out Boolean)
AlgorithmExtensions.ShortestPathsDag<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TEdge, Double>, TVertex)
AlgorithmExtensions.RankedShortestPathHoffmanPavley<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>, Func<TEdge, Double>, TVertex, TVertex, Int32)
AlgorithmExtensions.Sinks<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>)
AlgorithmExtensions.Roots<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>)
AlgorithmExtensions.Roots<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>)
AlgorithmExtensions.IsolatedVertices<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>)
AlgorithmExtensions.TopologicalSort<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>)
AlgorithmExtensions.SourceFirstTopologicalSort<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.SourceFirstBidirectionalTopologicalSort<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>)
AlgorithmExtensions.SourceFirstBidirectionalTopologicalSort<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>, TopologicalSortDirection)
AlgorithmExtensions.StronglyConnectedComponents<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)
AlgorithmExtensions.WeaklyConnectedComponents<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)
AlgorithmExtensions.CondensateStronglyConnected<TVertex, TEdge, TGraph>(IVertexAndEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.CondensateWeaklyConnected<TVertex, TEdge, TGraph>(IVertexAndEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.CondensateEdges<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>, VertexPredicate<TVertex>)
AlgorithmExtensions.OddVertices<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.IsDirectedAcyclicGraph<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>)
AlgorithmExtensions.OfflineLeastCommonAncestor<TVertex, TEdge>(IVertexListGraph<TVertex, TEdge>, TVertex, IEnumerable<SEquatableEdge<TVertex>>)
AlgorithmExtensions.ComputeTransitiveReduction<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>)
AlgorithmExtensions.ComputeTransitiveClosure<TVertex, TEdge>(IEdgeListGraph<TVertex, TEdge>, Func<TVertex, TVertex, TEdge>)
AlgorithmExtensions.Clone<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, Func<TVertex, TVertex>, Func<TEdge, TVertex, TVertex, TEdge>, IMutableVertexAndEdgeSet<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