Skip to content

ObjectGraph<T> class

Represents a graph structure. Each node in graph - is an object of type T.

public class Korzh.EasyQuery.ObjectGraph<T>
TypeNameDescription
Dictionary<T, T>ParentGets the graph parent.
TRootGets or sets the root of the graph.
IEnumerable<T>VerticesGets the list of all vertices.
TypeNameDescription
voidAddEdge(T vertexFrom, T vertexTo)Adds the edge (a connection between two nodes)
voidAddVertex(T vertex)Adds the vertex (node) into the graph.
IDictionary<T, T>BreadthFirstSearch(T vertex)Breadthes-first search in the graph for specified vertex.
voidClear()Clears the graph.
BooleanContainsVertex(T vertex)Determines whether this graph contains the specified vertex.
TLCA(T vertex1, T vertex2, IEnumerable<T> usedVertices)Calculates Lowest Common Ancestor for 2 vertices
voidRemoveVertex(T vertex)Removes the vertex (node) from the graph.