Module: Dither

Defined in:
lib/dither/chinese_postman_problem.rb,
lib/dither.rb,
lib/dither/ateg.rb,
lib/dither/ipog.rb,
lib/dither/mipog.rb,
lib/dither/param.rb,
lib/dither/version.rb,
lib/dither/test_case.rb,
lib/dither/ipog_helper.rb,
lib/dither/ateg_pairwise.rb,
lib/dither/unbound_param.rb,
lib/dither/java_ext/dither.rb

Overview

implement thimbleby’s solution to the chinese @postman problem www.cs.swansea.ac.uk/~csharold/cv/files/cpp.pdf

Defined Under Namespace

Modules: Ateg, Cpp, IPOGHelper Classes: Error, IPOG, MIPOG, Param, TestCase, UnboundParam

Constant Summary collapse

DEFUALT_OPTS =
{
  :t => 2
}
VERSION =
'0.0.13'

Class Method Summary collapse

Class Method Details

.all_edges(raw_graph) ⇒ Object

Cpp


217
218
219
# File 'lib/dither/chinese_postman_problem.rb', line 217

def self.all_edges(raw_graph)
  Dither::Cpp::Graph.create(raw_graph).cpp
end

.all_pairs(params, t = 2, opts = {}) ⇒ Object

deprecated


13
14
15
16
# File 'lib/dither.rb', line 13

def self.all_pairs(params, t = 2, opts = {})
  opts[:t] = t
  IPOG.new(params, opts).run
end

.ateg(params, opts = {}) ⇒ Object


29
30
31
32
# File 'lib/dither.rb', line 29

def self.ateg(params, opts = {})
  opts = DEFUALT_OPTS.dup.merge(opts)
  Ateg::Pairwise.new(params, opts).run
end

.ipog(params, opts = {}) ⇒ Object


18
19
20
21
# File 'lib/dither.rb', line 18

def self.ipog(params, opts = {})
  opts = DEFUALT_OPTS.dup.merge(opts)
  IPOG.new(params, opts).run
end

.mipog(params, t = 2, opts = {}) ⇒ Object

Raises:


23
24
25
26
27
# File 'lib/dither.rb', line 23

def self.mipog(params, t = 2, opts = {})
  raise Error, 'mipog does not support constraints' if opts.key?(:constraints)
  opts[:t] = t
  MIPOG.new(params, opts).run
end