lib/bipartite_graph/hungarian_algorithm.rb
def update(nodes_to_increase, nodes_to_decrease, change)
        raise "Change must be positive" unless change > 0
        nodes_to_increase.each { |n| labels[n] += change }
        nodes_to_decrease.each { |n| labels[n] -= change }

        recalculate_equality_graph #could be cleverer about this ..
      end
# subgraph of edges where weight = sum of end labels
subgraph of edges where weight = sum of end labels
subgraph of edges where weight = sum of end labels
def update(nodes_to_increase, nodes_to_decrease, change)
        raise "Change must be positive" unless change > 0
        nodes_to_increase.each { |n| labels[n] += change }
        nodes_to_decrease.each { |n| labels[n] -= change }
        recalculate_equality_graph 
      end
def update ( nodes_to_increase , nodes_to_decrease , change ) raise "Change must be positive" unless change > 0 nodes_to_increase . each { | n | labels [ n ] += change } nodes_to_decrease . each { | n | labels [ n ] -= change } recalculate_equality_graph end
subgraph of edges where weight = sum of end labels
subgraph of edges where weight = sum of end labels
#could be cleverer about this ..
nodes_to_increase
nodes_to_decrease
change