connect
Connects two nodes in the graph, by calling addEdge(node1,node2, weight) and addEdge(node2, node1, weight)
Parameters
node1
The first node to connect.
node2
The second node to connect.
weight
The weight of the connection (required for weighted graphs). Defaults to null.
Throws
Illegal State Exception
If no weight is provided for a weighted graph.