-
Notifications
You must be signed in to change notification settings - Fork 1
NodeData
Kfir Goldfarb edited this page Jan 12, 2021
·
1 revision
This class represents a node (vertex) in a graph. Each node has a key (node_id value), tag, scc_key and weight (use in graph algorithms class (GraphAlgo)), postion (tuple) and an info (string) (use like a metadata).
-
def get_key()
- return the node key (node_id). -
def get_pos()
- return node position (as a tuple (x, y, z)), if the position of the node is None, create new position from get_position function from GraphCreator class. -
distance(another_node)
- return the distance between this node and the other node (as a float). -
set_scc(scc_key)
- set the scc_key to this node. -
def get_scc()
- set new scc_key to this node.
- the scc_key is used in strong connected components algorithm in GraphAlgo class.