Module: Tangle::Mixin::Connectedness::Vertex

Defined in:
lib/tangle/mixin/connectedness.rb

Overview

Mixin for adding connectedness to a vertex

Instance Method Summary collapse

Instance Method Details

#connected?(other) ⇒ Boolean

Two vertices are connected if there is a path between them, and a vertex is connected to itself.

Returns:

  • (Boolean)

Raises:



53
54
55
56
57
58
# File 'lib/tangle/mixin/connectedness.rb', line 53

def connected?(other)
  raise GraphError unless @graph == other.graph
  return true if self == other

  connected_excluding?(other, Set[self])
end