Method: RGL::Graph#to_undirected
- Defined in:
- lib/rgl/adjacency.rb
#to_undirected ⇒ AdjacencyGraph
Return a new AdjacencyGraph which has the same set of vertices. If (u,v) is an edge of the graph, then (u,v) and (v,u) (which are the same edges) are edges of the result.
If the graph is undirected, the result is self.
196 197 198 199 |
# File 'lib/rgl/adjacency.rb', line 196 def to_undirected return self unless directed? AdjacencyGraph.new(Set, self) end |