Method: GraphLab::Graph#deleteEdge

Defined in:
lib/graphlab.rb

#deleteEdge(v1, v2) ⇒ Object



258
259
260
261
262
263
264
265
266
# File 'lib/graphlab.rb', line 258

def deleteEdge(v1, v2)
  raise "Value must be a Vertex!" if v1.class != GraphLab::Vertex
  raise "Value must be a Vertex!" if v2.class != GraphLab::Vertex
  raise "Vertex "+v1.value.to_s+" does not have "+v2.value.to_s+" edge" if !v1.adjList.include?(v2)
  if(v1.class == GraphLab::Vertex && v2.class == GraphLab::Vertex && v1.adjList.include?(v2))
    v1.deleteEdge(v2)
  end
  view_graph(self)
end