Show / Hide Table of Contents

Class CompoundGraph<TVertex, TEdge>

Compound graph data structure.

Inheritance
System.Object
QuikGraph.BidirectionalGraph<TVertex, TEdge>
CompoundGraph<TVertex, TEdge>
Implements
QuikGraph.IEdgeListAndIncidenceGraph<TVertex, TEdge>
System.ICloneable
IMutableCompoundGraph<TVertex, TEdge>
ICompoundGraph<TVertex, TEdge>
QuikGraph.IMutableBidirectionalGraph<TVertex, TEdge>
QuikGraph.IMutableVertexAndEdgeListGraph<TVertex, TEdge>
QuikGraph.IMutableVertexListGraph<TVertex, TEdge>
QuikGraph.IMutableIncidenceGraph<TVertex, TEdge>
QuikGraph.IMutableVertexAndEdgeSet<TVertex, TEdge>
QuikGraph.IMutableVertexSet<TVertex>
QuikGraph.IMutableEdgeListGraph<TVertex, TEdge>
QuikGraph.IMutableGraph<TVertex, TEdge>
QuikGraph.IBidirectionalGraph<TVertex, TEdge>
QuikGraph.IVertexAndEdgeListGraph<TVertex, TEdge>
QuikGraph.IVertexListGraph<TVertex, TEdge>
QuikGraph.IEdgeListGraph<TVertex, TEdge>
QuikGraph.IVertexSet<TVertex>
QuikGraph.IEdgeSet<TVertex, TEdge>
QuikGraph.IBidirectionalIncidenceGraph<TVertex, TEdge>
QuikGraph.IIncidenceGraph<TVertex, TEdge>
QuikGraph.IImplicitGraph<TVertex, TEdge>
QuikGraph.IGraph<TVertex, TEdge>
QuikGraph.IImplicitVertexSet<TVertex>
Inherited Members
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ContainsVertex(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ContainsEdge(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ContainsEdge(TVertex, TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.IsOutEdgesEmpty(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OutDegree(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OutEdges(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.TryGetOutEdges(TVertex, System.Collections.Generic.IEnumerable<TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OutEdge(TVertex, System.Int32)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.TryGetEdge(TVertex, TVertex, TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.TryGetEdges(TVertex, TVertex, System.Collections.Generic.IEnumerable<TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.IsInEdgesEmpty(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.InDegree(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.InEdges(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.TryGetInEdges(TVertex, System.Collections.Generic.IEnumerable<TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.InEdge(TVertex, System.Int32)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.Degree(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.Clear()
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddVertex(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddVertexRange(System.Collections.Generic.IEnumerable<TVertex>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OnVertexAdded(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveVertex(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OnVertexRemoved(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveVertexIf(QuikGraph.VertexPredicate<TVertex>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddEdge(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddEdgeRange(System.Collections.Generic.IEnumerable<TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OnEdgeAdded(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveEdge(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.OnEdgeRemoved(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveEdgeIf(QuikGraph.EdgePredicate<TVertex, TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddVerticesAndEdge(TEdge)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AddVerticesAndEdgeRange(System.Collections.Generic.IEnumerable<TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveOutEdgeIf(TVertex, QuikGraph.EdgePredicate<TVertex, TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ClearOutEdges(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.TrimEdgeExcess()
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveInEdgeIf(TVertex, QuikGraph.EdgePredicate<TVertex, TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ClearInEdges(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.ClearEdges(TVertex)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.MergeVertex(TVertex, QuikGraph.EdgeFactory<TVertex, TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.MergeVerticesIf(QuikGraph.VertexPredicate<TVertex>, QuikGraph.EdgeFactory<TVertex, TEdge>)
QuikGraph.BidirectionalGraph<TVertex, TEdge>.Clone()
QuikGraph.BidirectionalGraph<TVertex, TEdge>.System.ICloneable.Clone()
QuikGraph.BidirectionalGraph<TVertex, TEdge>.EdgeCapacity
QuikGraph.BidirectionalGraph<TVertex, TEdge>.VertexType
QuikGraph.BidirectionalGraph<TVertex, TEdge>.EdgeType
QuikGraph.BidirectionalGraph<TVertex, TEdge>.IsDirected
QuikGraph.BidirectionalGraph<TVertex, TEdge>.AllowParallelEdges
QuikGraph.BidirectionalGraph<TVertex, TEdge>.IsVerticesEmpty
QuikGraph.BidirectionalGraph<TVertex, TEdge>.VertexCount
QuikGraph.BidirectionalGraph<TVertex, TEdge>.Vertices
QuikGraph.BidirectionalGraph<TVertex, TEdge>.IsEdgesEmpty
QuikGraph.BidirectionalGraph<TVertex, TEdge>.EdgeCount
QuikGraph.BidirectionalGraph<TVertex, TEdge>.Edges
QuikGraph.BidirectionalGraph<TVertex, TEdge>.VertexAdded
QuikGraph.BidirectionalGraph<TVertex, TEdge>.VertexRemoved
QuikGraph.BidirectionalGraph<TVertex, TEdge>.EdgeAdded
QuikGraph.BidirectionalGraph<TVertex, TEdge>.EdgeRemoved
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: 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 Source

CompoundGraph()

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

Declaration
public CompoundGraph()
| Improve this Doc View Source

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

graph is null.

| Improve this Doc View Source

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

graph is null.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

CompoundVertices

Gets the set of compound vertices.

Declaration
public IEnumerable<TVertex> CompoundVertices { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<TVertex>
| Improve this Doc View Source

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 Source

AddChildVertex(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

parent is null.

System.ArgumentNullException

child is null.

System.InvalidOperationException

child already has a parent vertex.

QuikGraph.VertexNotFoundException

parent is not part of the graph.

| Improve this Doc View Source

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

parent is null.

System.ArgumentNullException

children is null or at least one of them is null.

System.InvalidOperationException

At least on of children already has a parent vertex.

QuikGraph.VertexNotFoundException

parent is not part of the graph.

| Improve this Doc View Source

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

vertex is null.

QuikGraph.VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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

vertex is null.

QuikGraph.VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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

vertex is null.

QuikGraph.VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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

vertex is null.

QuikGraph.VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

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

vertex is null.

QuikGraph.VertexNotFoundException

vertex is not part of the graph.

| Improve this Doc View Source

RemoveVertex(TVertex)

Declaration
public override bool RemoveVertex(TVertex vertex)
Parameters
Type Name Description
TVertex vertex
Returns
Type Description
System.Boolean
Overrides
QuikGraph.BidirectionalGraph<TVertex, TEdge>.RemoveVertex(TVertex)

Implements

QuikGraph.IEdgeListAndIncidenceGraph<TVertex, TEdge>
System.ICloneable
IMutableCompoundGraph<TVertex, TEdge>
ICompoundGraph<TVertex, TEdge>
QuikGraph.IMutableBidirectionalGraph<TVertex, TEdge>
QuikGraph.IMutableVertexAndEdgeListGraph<TVertex, TEdge>
QuikGraph.IMutableVertexListGraph<TVertex, TEdge>
QuikGraph.IMutableIncidenceGraph<TVertex, TEdge>
QuikGraph.IMutableVertexAndEdgeSet<TVertex, TEdge>
QuikGraph.IMutableVertexSet<TVertex>
QuikGraph.IMutableEdgeListGraph<TVertex, TEdge>
QuikGraph.IMutableGraph<TVertex, TEdge>
QuikGraph.IBidirectionalGraph<TVertex, TEdge>
QuikGraph.IVertexAndEdgeListGraph<TVertex, TEdge>
QuikGraph.IVertexListGraph<TVertex, TEdge>
QuikGraph.IEdgeListGraph<TVertex, TEdge>
QuikGraph.IVertexSet<TVertex>
QuikGraph.IEdgeSet<TVertex, TEdge>
QuikGraph.IBidirectionalIncidenceGraph<TVertex, TEdge>
QuikGraph.IIncidenceGraph<TVertex, TEdge>
QuikGraph.IImplicitGraph<TVertex, TEdge>
QuikGraph.IGraph<TVertex, TEdge>
QuikGraph.IImplicitVertexSet<TVertex>

Extension Methods

GraphHelpers.GetNeighbors<TVertex, TEdge>(IBidirectionalGraph<TVertex, TEdge>, TVertex)
GraphHelpers.GetOutNeighbors<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, TVertex)
GraphHelpers.GetEdgesBetween<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>, TVertex[], TVertex[])
GraphHelpers.GetDistances<TVertex, TEdge, TGraph>(TGraph)
GraphHelpers.GetDiameter<TVertex, TEdge, TGraph>(TGraph)
GraphHelpers.GetDiameter<TVertex, TEdge, TGraph>(TGraph, out Double[,])
GraphHelpers.Convert<TOldVertex, TOldEdge, TNewVertex, TNewEdge, TNewGraph>(IVertexAndEdgeListGraph<TOldVertex, TOldEdge>, TNewGraph, Func<TOldVertex, TNewVertex>, Func<TOldEdge, TNewEdge>)
GraphHelpers.Convert<TVertex, TOldEdge, TNewEdge, TNewGraph>(IVertexAndEdgeListGraph<TVertex, TOldEdge>, TNewGraph, Func<TOldEdge, TNewEdge>)
GraphHelpers.Convert<TVertex, TEdge, TNewGraph>(IVertexAndEdgeListGraph<TVertex, TEdge>, TNewGraph)
GraphHelpers.Convert<TOldVertex, TOldEdge, TNewVertex, TNewEdge>(IVertexAndEdgeListGraph<TOldVertex, TOldEdge>, Func<TOldVertex, TNewVertex>, Func<TOldEdge, TNewEdge>)
GraphHelpers.Convert<TVertex, TOldEdge, TNewEdge>(IVertexAndEdgeListGraph<TVertex, TOldEdge>, Func<TOldEdge, TNewEdge>)
GraphHelpers.CopyToBidirectionalGraph<TVertex, TEdge>(IVertexAndEdgeListGraph<TVertex, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top GraphShape