lib/rgl/adjacency.rb in rgl-0.5.3 vs lib/rgl/adjacency.rb in rgl-0.5.4
- old
+ new
@@ -75,20 +75,20 @@
end
# Complexity is O(1), because the vertices are kept in a Hash containing
# as values the lists of adjacent vertices of _v_.
#
- def has_vertex? (v)
+ def has_vertex?(v)
@vertices_dict.has_key?(v)
end
# Complexity is O(1), if a Set is used as adjacency list. Otherwise,
# complexity is O(out_degree(v)).
#
# ---
# MutableGraph interface.
#
- def has_edge? (u, v)
+ def has_edge?(u, v)
has_vertex?(u) && @vertices_dict[u].include?(v)
end
# See MutableGraph#add_vertex.
#