Sha256: ccefe327bd0e788cdeb26f40c2001e2bfd36f647e7030d40711b6455ee85eb65

Contents?: true

Size: 333 Bytes

Versions: 4

Compression:

Stored size: 333 Bytes

Contents

require 'tangle/graph'

module Tangle
  module Simple
    #
    # A simple graph, without loops and multiple edges
    class Graph < Tangle::Graph
      protected

      def insert_edge(edge)
        raise LoopError if edge.loop?
        raise MultiEdgeError if adjacent?(*edge.each_vertex)
        super
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tangle-0.9.0 lib/tangle/simple/graph.rb
tangle-0.8.2 lib/tangle/simple/graph.rb
tangle-0.8.1 lib/tangle/simple/graph.rb
tangle-0.8.0 lib/tangle/simple/graph.rb