connect
abstract fun connect(node1: Node<T>, node2: Node<T>, weight: W? = null, bidirectional: Boolean = false)
Adds, in place, an edge from node1 to node2 with the given weight (null by default); if bidirectional is true (false by default), an edge from node2 back to node1, with the same weight, is added as well.