Class: GRATR::Complete
Overview
This class defines a complete graph of size n This is easily done by using the base Graph class and implemeting the minimum methods needed to make it work. This is a good example to look at for making one’s own graph classes
Instance Method Summary collapse
- #edge?(u, v = nil) ⇒ Boolean
- #edges ⇒ Object
-
#initialize(n) ⇒ Complete
constructor
A new instance of Complete.
Methods inherited from Cycle
#directed?, #vertex?, #vertices
Constructor Details
#initialize(n) ⇒ Complete
Returns a new instance of Complete.
57 |
# File 'lib/gratr/common.rb', line 57 def initialize(n) @size = n; @edges = nil; end |