Node#

class Node(incoming_node_data=None, degree=None, **attr)#

Bases: ABC

Abstract node class. Holds a list of incident endpoints and node attributes. Nodes can be crossings, vertices, etc.

__init__(incoming_node_data=None, degree=None, **attr)#

Methods

__init__([incoming_node_data, degree])

append(item)

degree()

mirror()

py3_cmp(other[, compare_attr])

Compare node. Replaces obsolete __cmp__ method. :param other: Node to compare with :param compare_attr: do we compare also the node attributes (name, color, ...) :return: 1 if self > other, -1 if self < other, 0 otherwise.

Attributes

attr

py3_cmp(other, compare_attr=False)#

Compare node. Replaces obsolete __cmp__ method. :param other: Node to compare with :param compare_attr: do we compare also the node attributes (name, color, …) :return: 1 if self > other,

-1 if self < other, 0 otherwise.