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>

Package: Korzh.EasyQuery (targets: netstandard2.0)

Assembly: Korzh.EasyQuery.dll

NameTypeDescription
ObjectGraph()void
NameTypeDescription
ParentDictionary<T, T>Gets the graph parent.
RootObjectGraph1.T`Gets or sets the root of the graph.
VerticesIEnumerable<T>Gets the list of all vertices.
NameTypeDescription
AddEdge(T vertexFrom, T vertexTo)voidAdds the edge (a connection between two nodes)
AddVertex(T vertex)voidAdds the vertex (node) into the graph.
BreadthFirstSearch(T vertex)IDictionary<T, T>Breadthes-first search in the graph for specified vertex.
Clear()voidClears the graph.
ContainsVertex(T vertex)boolDetermines whether this graph contains the specified vertex.
LCA(T vertex1, T vertex2, IEnumerable<T> usedVertices)ObjectGraph1.T`Calculates Lowest Common Ancestor for 2 vertices
RemoveVertex(T vertex)voidRemoves the vertex (node) from the graph.