class

Graphlb::DataStructures::Node

Inherits Reference / Object

The node Class basically represnts the vertices in a graph it contains two properties

  1. name of the vertex
  2. edge shared with other vertex

edges property in Node reprensents the adjacency graph which is implemented using a hash with vertex name as it key and edge weight as its value

Constructors

new(name : String)

creates a new edge with a given name

Source

Instance methods

!=(other : Node)
Source
==(other : Node)
Source
add_edge(node, weight)

Adds a new edge to the vertex node with information about edge weight and adjacent vertex

Source
edges
Source
name
Source
remove_edge(node)

Removes an already existing edge from the graph

Source