Show / Hide Table of Contents

Class GraphNode<TValue>

A generic graph node. For sample use-cases DFS, BFS, Dijkstra.

Inheritance
System.Object
GraphNode<TValue>
Implements
System.IComparable<GraphNode<TValue>>
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: AlgorithmsAndDataStructures.Algorithms.GraphTraversal
Assembly: AlgorithmsAndDataStructures.dll
Syntax
public class GraphNode<TValue> : IComparable<GraphNode<TValue>>
Type Parameters
Name Description
TValue

The type of the value stored in the node.

Constructors

| Improve this Doc View Source

GraphNode(TValue)

Constructor

Declaration
public GraphNode(TValue value)
Parameters
Type Name Description
TValue value

The value to be stored in the node.

Fields

| Improve this Doc View Source

MaxValue

The maximum value for GraphNode type.

Declaration
public static readonly GraphNode<TValue> MaxValue
Field Value
Type Description
GraphNode<TValue>
| Improve this Doc View Source

MinValue

The minimum value for GraphNode type.

Declaration
public static readonly GraphNode<TValue> MinValue
Field Value
Type Description
GraphNode<TValue>

Properties

| Improve this Doc View Source

Adjacents

Declaration
public List<GraphEdge<TValue>> Adjacents { get; set; }
Property Value
Type Description
System.Collections.Generic.List<GraphEdge<TValue>>

The list of all the adjacent nodes of this node. These are the nodes that are connected to this node by a direct edge.

| Improve this Doc View Source

DistanceFromStartNode

Declaration
public int DistanceFromStartNode { get; set; }
Property Value
Type Description
System.Int32

The distance of this node from a node at which traversal of the graph containing current node starts. Used in BFS, and DFS.

| Improve this Doc View Source

IsInserted

Declaration
public bool IsInserted { get; set; }
Property Value
Type Description
System.Boolean

Determines whether this node, in a particular instance of a traversal algorithm has been already visited : inserted in the queue/stack.

| Improve this Doc View Source

Value

Declaration
public TValue Value { get; set; }
Property Value
Type Description
TValue

The value stored in the node.

Methods

| Improve this Doc View Source

CompareTo(GraphNode<TValue>)

Compares this node to another node of type GraphNode.

Declaration
public int CompareTo(GraphNode<TValue> other)
Parameters
Type Name Description
GraphNode<TValue> other

A graph node

Returns
Type Description
System.Int32

0 if equal, 1 if current node is bigger than other, and -1 otherwise.

Implements

System.IComparable<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX