connect method

void connect(
  1. GraphNode next
)

Implementation

void connect(GraphNode next) {
  outgoing.add(next);
  next.incoming.add(this);
}