class Graphlb::DataStructures::Node
- Graphlb::DataStructures::Node
- Reference
- Object
Overview
The node Class basically represnts the vertices in a graph it contains two properties
- name of the vertex
- 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.crConstructors
-
.new(name : String)
creates a new edge with a given name
Instance Method Summary
- #!=(other : Node)
- #==(other : Node)
-
#add_edge(node, weight)
Adds a new edge to the vertex node with information about edge weight and adjacent vertex
- #edges : Hash(Graphlb::DataStructures::Node, Float64)
- #name : String
-
#remove_edge(node)
Removes an already existing edge from the graph
Constructor Detail
Instance Method Detail
def add_edge(node, weight)
#
Adds a new edge to the vertex node with information about edge weight and adjacent vertex