All problems
Weighted Sum Scalarization
Problem
Weighted sum scalarization combines a multi-objective vector into a single value sum_i w_i f_i.
Given the objectives and nonnegative weights, return the scalarized value.
Hint
A plain dot product of objectives and weights.
Test cases
case 1
in: [[1,2],[0.5,0.5]]
expected: 1.5
case 2
in: [[3,1,4],[1,0,2]]
expected: 11
case 3
in: [[0],[5]]
expected: 0
Starter codePython
def weighted_sum_scalarization(values, weights):
# Your code here
pass3 test cases · run your code against them in the editor