Sha256: f4cbae8fcfac881fee9b920fcdcfe85b2cfc214f32779837b1f18a77002e18b1
Contents?: true
Size: 355 Bytes
Versions: 12
Compression:
Stored size: 355 Bytes
Contents
# frozen_string_literal: true require 'rgl/traversal' module RGL module Graph # Checks whether a path exists between _source_ and _target_ vertices # in the graph. # def path?(source, target) return false unless has_vertex?(source) bfs_iterator = bfs_iterator(source) bfs_iterator.include?(target) end end end
Version data entries
12 entries across 12 versions & 1 rubygems