Need help with basic optimization problem
Posted
by ??iu
on Stack Overflow
See other posts from Stack Overflow
or by ??iu
Published on 2010-05-05T17:30:28Z
Indexed on
2010/05/05
17:48 UTC
Read the original article
Hit count: 215
I know little of optimization problems, so hopefully this will be didactic for me:
rotors = [1, 2, 3, 4...]
widgets = ['a', 'b', 'c', 'd' ...]
assert len(rotors) == len(widgets)
part_values = [
(1, 'a', 34),
(1, 'b', 26),
(1, 'c', 11),
(1, 'd', 8),
(2, 'a', 5),
(2, 'b', 17),
....
]
Given a fixed number of widgets and a fixed number of rotors, how can you get a series of widget-rotor pairs that maximizes the total value where each widget and rotor can only be used once?
© Stack Overflow or respective owner