Closed D4L closed 10 years ago
Need a method to see if the the graph is just one component, or if there are vertices that aren't connected to the rest of the graph.
Assume graph is 3-path ( { v1, v2, v3 }, { e1, e2 } )
graph
graph.connected? # true graph.delete_edge! "e1" graph.connected? # false
Sound fun, let's do it!
Connected method
Task
Need a method to see if the the graph is just one component, or if there are vertices that aren't connected to the rest of the graph.
Content
Example
Assume
graph
is 3-path ( { v1, v2, v3 }, { e1, e2 } )