class Graphlb::DataStructures::Node

Overview

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

Defined in:

graphlb/data_structures/nodes.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String) #

creates a new edge with a given name


[View source]

Instance Method Detail

def !=(other : Node) #

[View source]
def ==(other : Node) #

[View source]
def add_edge(node, weight) #

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


[View source]
def edges : Hash(Graphlb::DataStructures::Node, Float64) #

[View source]
def name : String #

[View source]
def remove_edge(node) #

Removes an already existing edge from the graph


[View source]