Class CompoundGraph<TVertex, TEdge>
Compound graph data structure.
Inheritance
Implements
Inherited Members
Namespace: GraphShape
Assembly: GraphShape.dll
Syntax
[Serializable]
public class CompoundGraph<TVertex, TEdge> : BidirectionalGraph<TVertex, TEdge>, IEdgeListAndIncidenceGraph<TVertex, TEdge>, ICloneable, IMutableCompoundGraph<TVertex, TEdge>, ICompoundGraph<TVertex, TEdge>, IMutableBidirectionalGraph<TVertex, TEdge>, IMutableVertexAndEdgeListGraph<TVertex, TEdge>, IMutableVertexListGraph<TVertex, TEdge>, IMutableIncidenceGraph<TVertex, TEdge>, IMutableVertexAndEdgeSet<TVertex, TEdge>, IMutableVertexSet<TVertex>, IMutableEdgeListGraph<TVertex, TEdge>, IMutableGraph<TVertex, TEdge>, IBidirectionalGraph<TVertex, TEdge>, IVertexAndEdgeListGraph<TVertex, TEdge>, IVertexListGraph<TVertex, TEdge>, IEdgeListGraph<TVertex, TEdge>, IVertexSet<TVertex>, IEdgeSet<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 SourceCompoundGraph()
Initializes a new instance of the CompoundGraph<TVertex, TEdge> class.
Declaration
public CompoundGraph()
CompoundGraph(ICompoundGraph<TVertex, TEdge>)
Initializes a new instance of the CompoundGraph<TVertex, TEdge> class.
Declaration
public CompoundGraph(ICompoundGraph<TVertex, TEdge> graph)
Parameters
Type | Name | Description |
---|---|---|
ICompoundGraph<TVertex, TEdge> | graph | Graph from which initializing this graph. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
CompoundGraph(IEdgeListGraph<TVertex, TEdge>)
Initializes a new instance of the CompoundGraph<TVertex, TEdge> class.
Declaration
public CompoundGraph(IEdgeListGraph<TVertex, TEdge> graph)
Parameters
Type | Name | Description |
---|---|---|
QuikGraph.IEdgeListGraph<TVertex, TEdge> | graph | Graph from which initializing this graph. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
CompoundGraph(Boolean)
Initializes a new instance of the CompoundGraph<TVertex, TEdge> class.
Declaration
public CompoundGraph(bool allowParallelEdges)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | allowParallelEdges | Indicates if parallel edges are allowed. |
CompoundGraph(Boolean, Int32)
Initializes a new instance of the CompoundGraph<TVertex, TEdge> class.
Declaration
public CompoundGraph(bool allowParallelEdges, int capacity)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | allowParallelEdges | Indicates if parallel edges are allowed. |
System.Int32 | capacity | Vertex capacity. |
Properties
| Improve this Doc View SourceCompoundVertices
Gets the set of compound vertices.
Declaration
public IEnumerable<TVertex> CompoundVertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TVertex> |
SimpleVertices
Gets the set of simple vertices.
Declaration
public IEnumerable<TVertex> SimpleVertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TVertex> |
Methods
| Improve this Doc View SourceAddChildVertex(TVertex, TVertex)
Adds the child
vertex to the graph if not already inside and sets
it as child vertex of parent
vertex.
Declaration
public bool AddChildVertex(TVertex parent, TVertex child)
Parameters
Type | Name | Description |
---|---|---|
TVertex | parent | Parent vertex. |
TVertex | child | Vertex to add as child. |
Returns
Type | Description |
---|---|
System.Boolean | True if vertex is added as child with success, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.InvalidOperationException |
|
QuikGraph.VertexNotFoundException |
|
AddChildVertexRange(TVertex, IEnumerable<TVertex>)
Adds the set of children
vertices to the graph if not already inside and sets
them as children vertices of parent
vertex.
Declaration
public int AddChildVertexRange(TVertex parent, IEnumerable<TVertex> children)
Parameters
Type | Name | Description |
---|---|---|
TVertex | parent | Parent vertex. |
System.Collections.Generic.IEnumerable<TVertex> | children | Vertices to add as children. |
Returns
Type | Description |
---|---|
System.Int32 | The number of vertices added to the graph. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.InvalidOperationException | At least on of |
QuikGraph.VertexNotFoundException |
|
GetChildrenCount(TVertex)
Gets the number of children vertices of the given vertex
.
Declaration
public int GetChildrenCount(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | Vertex to get its children count. |
Returns
Type | Description |
---|---|
System.Int32 | Number of children vertices. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QuikGraph.VertexNotFoundException |
|
GetChildrenVertices(TVertex)
Gets the children vertices of the given vertex
.
Declaration
public IEnumerable<TVertex> GetChildrenVertices(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | Vertex to get its children. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TVertex> | Children vertices. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QuikGraph.VertexNotFoundException |
|
GetParent(TVertex)
Gets the parent vertex of the given vertex
.
Declaration
public TVertex GetParent(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | Vertex to get the parent. |
Returns
Type | Description |
---|---|
TVertex | Parent vertex if there is one, null otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QuikGraph.VertexNotFoundException |
|
IsChildVertex(TVertex)
Checks if the given vertex
is a child vertex of another one.
Declaration
public bool IsChildVertex(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | Vertex to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the vertex is a child one, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QuikGraph.VertexNotFoundException |
|
IsCompoundVertex(TVertex)
Checks if the given vertex
is a compound vertex (child vertex).
Declaration
public bool IsCompoundVertex(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex | Vertex to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the vertex is a compound one, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
QuikGraph.VertexNotFoundException |
|
RemoveVertex(TVertex)
Declaration
public override bool RemoveVertex(TVertex vertex)
Parameters
Type | Name | Description |
---|---|---|
TVertex | vertex |
Returns
Type | Description |
---|---|
System.Boolean |