class RGL::AdjacencyGraph

AdjacencyGraph is an undirected Graph. The methods add_edge and #remove_edge are reimplemented: if an edge (u,v) is added or removed, then the reverse edge (v,u) is also added or removed.

Public Instance Methods

directed?() click to toggle source

Always returns false.

# File lib/rgl/adjacency.rb, line 152
def directed?
  false
end
remove_edge(u, v) click to toggle source

Also removes (v,u)

Calls superclass method RGL::DirectedAdjacencyGraph#remove_edge
# File lib/rgl/adjacency.rb, line 158
def remove_edge(u, v)
  super
  @vertices_dict[v].delete(u) unless @vertices_dict[v].nil?
end

Protected Instance Methods

basic_add_edge(u, v) click to toggle source
# File lib/rgl/adjacency.rb, line 165
def basic_add_edge(u, v)
  super
  @vertices_dict[v].add(u) # Insert backwards edge
end