module FixedCostTrans ################################################################################ # PART A: Implement the following method # fixed_cost_transportation(alpha::Real, beta::Real, w::Matrix{Float64}, s::Vector{Float64}, d::Vector{Float64})::Float64 ################################################################################ end # module FixedCostTrans ################################################################################ # PART B: Run the following code, using the implementation in PART A import Random Random.seed!(123) M = 10 N = 10 s = rand(M) d = rand(N) s *= 1.5 * sum(d) / sum(s) w = rand(M, N) using Plots alphas = 1:20 betas = 0:0.1:1.5 opt_vals = [FixedCostTrans.fixed_cost_transportation(alpha, beta, w, s, d) / M for beta in betas, alpha in alphas] heatmap(alphas, betas, opt_vals, aspect_ratio=10) xaxis!("alpha") yaxis!("beta") savefig("problem-b-heatmap.png") ################################################################################