def reconnect(edges, source, target)
      raise ArgumentError, "Vertices expected as source and target"\
        unless (source.nil? or Vertex===source) and (target.nil? or Vertex===target)
      to_edges(edges).each do |edge|
        if source
          edge.source.remove_out_edge(edge)
          source.add_out_edge(edge)
        end
        if target
          edge.target.remove_in_edge(edge)
          target.add_in_edge(edge)
        end
        edge.reconnect(source, target)
        edge
      end
    end
def reconnect(edges, source, target)
      raise ArgumentError, "Vertices expected as source and target"\
        unless (source.nil? or Vertex===source) and (target.nil? or Vertex===target)
      to_edges(edges).each do |edge|
        if source
          edge.source.remove_out_edge(edge)
          source.add_out_edge(edge)
        end
        if target
          edge.target.remove_in_edge(edge)
          target.add_in_edge(edge)
        end
        edge.reconnect(source, target)
        edge
      end
    end
Reconnects some edge(s). _source_ and _target_ are expected to be
 Vertex instances, or nil. _edges_ may be any selection expression
 that can be converted to an edge set. This method reconnects all
 edges to the specified source and target vertices (at least one is
 expected not to be nil).