PlanarEmbedding.add_half_edge#

PlanarEmbedding.add_half_edge(start_node, end_node, *, cw=None, ccw=None)[source]#

Adds a half-edge from start_node to end_node.

If the half-edge is not the first one out of start_node, a reference node must be provided either in the clockwise (parameter cw) or in the counterclockwise (parameter ccw) direction. Only one of cw/ccw can be specified (or neither in the case of the first edge). Note that specifying a reference in the clockwise (cw) direction means inserting the new edge in the first counterclockwise position with respect to the reference (and vice-versa).

Parameters:
start_nodenode

Start node of inserted edge.

end_nodenode

End node of inserted edge.

cw, ccw: node

End node of reference edge. Omit or pass None if adding the first out-half-edge of start_node.

Raises:
NetworkXException

If the cw or ccw node is not a successor of start_node. If start_node has successors, but neither cw or ccw is provided. If both cw and ccw are specified.