Pharmaceutical, Machine Learning, Graph Theory, Linear Programming.
targets[max_node] = max_profit roi[max_node] = 0 rep_node = max_node visited.add(max_node) break else: del max_roi[max_node] if len(max_roi) != 0: max_profit, max_node = get_max_node(max_roi) if len(max_roi) == 0: profit += max_fallback_profit targets[max_fallback_node] = max_fallback_profit