class Silicium::Graphs::UnorientedGraph

Public Instance Methods

add_edge!(from, to) click to toggle source
# File lib/graph.rb, line 135
def add_edge!(from, to)
  super(from, to)
  super(to, from)
end
delete_edge!(from, to) click to toggle source
# File lib/graph.rb, line 145
def delete_edge!(from, to)
  super(from, to)
  super(to, from)
end
edge_number() click to toggle source
# File lib/graph.rb, line 150
def edge_number
  res = 0
  @vertices.each do |from, tos|
    tos.each {|to| res += (to == from ? 2 : 1)}
  end
  res / 2
end
label_edge!(from, to, label) click to toggle source
# File lib/graph.rb, line 140
def label_edge!(from, to, label)
  super(from, to, label)
  super(to, from, label)
end