Closed mlujr closed 3 years ago
in lib/graph_matching/graph/weighted.rb:
in constructor [] calculate the maximum index max_idx = weightless_edges.map { |e| e.max}.max + 1 g.init_weights(max_idx)
and add a paramter to init_weights with default
def init_weights(e=numvertices) @weight = Array.new(e) { || Array.new(e) } end
Hi! It sounds like you have a specific change you'd like to suggest. If so, can you make a PR with tests, please?
created a pull request with simple test
in lib/graph_matching/graph/weighted.rb:
in constructor [] calculate the maximum index max_idx = weightless_edges.map { |e| e.max}.max + 1 g.init_weights(max_idx)
and add a paramter to init_weights with default
def init_weights(e=numvertices) @weight = Array.new(e) { || Array.new(e) } end