Skip to content

Conversation

@odow
Copy link
Member

@odow odow commented Dec 17, 2025

x-ref #167

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6b7ae28) to head (75acbaf).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #170   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines         1212      1243   +31     
=========================================
+ Hits          1212      1243   +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@odow
Copy link
Member Author

odow commented Dec 18, 2025

using JuMP, HiGHS, Gurobi
import MultiObjectiveAlgorithms as MOA

function solve_tamby_mokp(filename)
    lines = readlines(filename)
    p = parse(Int, lines[1])
    n = parse(Int, lines[2])
    b = parse(Float64, lines[3])
    C = collect(reduce(hcat, Float64.(x.args) for x in Meta.parse(lines[4]).args)')
    w = Meta.parse(lines[5]).args
    model = direct_model(MOA.Optimizer(Gurobi.Optimizer))
    set_attribute(model, MOA.Algorithm(), MOA.TambyVanderpooten())
    set_time_limit_sec(model, 5.0)
    @variable(model, x[1:n], Bin)
    @constraint(model, w' * x <= b)
    @objective(model, Max, C * x)
    optimize!(model)
    return (;
        solve_time = solve_time(model),
        result_count = result_count(model),
        Y = [objective_value(model; result) for result in 1:result_count(model)],
        subproblem_count = get_attribute(model, MOA.SubproblemCount()),
    )
end
filename = "/Users/odow/git/tambysatya/TamVan19/Instances/MOKP/MOKP_p-6_n-30_1.dat"
solve_tamby_mokp(filename)

Before

  344   -1.04700e+03 -1.07200e+03 -1.01600e+03 -9.44000e+02 -9.65000e+02 -1.37100e+03  4.76810e+00
  345  auxillary subproblem                                                            4.84938e+00
  346   -1.02200e+03 -1.09000e+03 -1.17600e+03 -1.01500e+03 -1.02000e+03 -1.20600e+03  4.85161e+00
  347  auxillary subproblem                                                            4.93469e+00
  348   -9.69000e+02 -1.20300e+03 -1.12400e+03 -1.00300e+03 -8.17000e+02 -1.06300e+03  4.93881e+00
--------------------------------------------------------------------------------------------------
TerminationStatus: TIME_LIMIT
ResultCount: 131
--------------------------------------------------------------------------------------------------
(solve_time = 5.017430067062378, result_count = 131, Y = [[1177.0, 1032.0, 1071.0, 885.0, 846.0, 1141.0], [1176.0, 1014.0, 1091.0, 911.0, 918.0, 1176.0], [1172.0, 1074.0, 1066.0, 923.0, 811.0, 1182.0], [1172.0, 1006.0, 984.0, 885.0, 788.0, 1192.0], [1165.0, 981.0, 1061.0, 956.0, 799.0, 1155.0], [1161.0, 1122.0, 1142.0, 933.0, 802.0, 1134.0], [1160.0, 1047.0, 1133.0, 911.0, 905.0, 1221.0], [1160.0, 979.0, 1051.0, 873.0, 882.0, 1231.0], [1159.0, 1040.0, 1089.0, 888.0, 950.0, 1179.0], [1155.0, 1021.0, 1046.0, 911.0, 847.0, 1272.0]  …  [876.0, 1040.0, 1083.0, 1116.0, 751.0, 1202.0], [872.0, 1041.0, 1135.0, 1129.0, 753.0, 986.0], [871.0, 977.0, 1213.0, 1121.0, 838.0, 1022.0], [870.0, 1067.0, 1207.0, 1122.0, 763.0, 1045.0], [865.0, 1049.0, 1170.0, 920.0, 1084.0, 1130.0], [864.0, 1132.0, 1335.0, 1001.0, 909.0, 1102.0], [845.0, 961.0, 1182.0, 935.0, 1066.0, 978.0], [840.0, 933.0, 1063.0, 945.0, 1066.0, 1051.0], [838.0, 1041.0, 1153.0, 1124.0, 759.0, 991.0], [830.0, 1079.0, 1103.0, 1098.0, 742.0, 1212.0]], subproblem_count = 348)

After

 1078   -9.47000e+02 -1.03700e+03 -1.12900e+03 -1.09900e+03 -8.19000e+02 -1.17100e+03  4.92726e+00
 1080   -1.00900e+03 -1.05900e+03 -1.15700e+03 -9.26000e+02 -1.07200e+03 -1.19500e+03  4.94397e+00
 1082   -9.98000e+02 -1.06300e+03 -1.14700e+03 -8.98000e+02 -8.94000e+02 -1.36100e+03  4.95577e+00
 1084   -9.12000e+02 -1.12700e+03 -1.14100e+03 -1.09500e+03 -7.50000e+02 -1.19900e+03  4.96765e+00
 1086   -9.44000e+02 -1.05800e+03 -1.16700e+03 -9.25000e+02 -1.08300e+03 -1.13800e+03  4.98122e+00
 1088   -9.52000e+02 -1.11100e+03 -1.32700e+03 -1.03400e+03 -8.74000e+02 -1.15300e+03  4.99674e+00
--------------------------------------------------------------------------------------------------
TerminationStatus: TIME_LIMIT
ResultCount: 293
--------------------------------------------------------------------------------------------------
(solve_time = 5.012986898422241, result_count = 293, Y = [[1177.0, 1032.0, 1071.0, 885.0, 846.0, 1141.0], [1176.0, 1014.0, 1091.0, 911.0, 918.0, 1176.0], [1172.0, 1074.0, 1066.0, 923.0, 811.0, 1182.0], [1172.0, 1006.0, 984.0, 885.0, 788.0, 1192.0], [1171.0, 1067.0, 1022.0, 900.0, 856.0, 1140.0], [1170.0, 939.0, 1066.0, 918.0, 834.0, 1114.0], [1165.0, 981.0, 1061.0, 956.0, 799.0, 1155.0], [1164.0, 974.0, 1017.0, 933.0, 844.0, 1113.0], [1161.0, 1122.0, 1142.0, 933.0, 802.0, 1134.0], [1160.0, 1047.0, 1133.0, 911.0, 905.0, 1221.0]  …  [861.0, 1021.0, 1088.0, 1085.0, 900.0, 1153.0], [854.0, 1063.0, 1297.0, 961.0, 1018.0, 1041.0], [847.0, 996.0, 1076.0, 1073.0, 741.0, 1261.0], [846.0, 1057.0, 1114.0, 1088.0, 809.0, 1209.0], [845.0, 961.0, 1182.0, 935.0, 1066.0, 978.0], [844.0, 1044.0, 1347.0, 1016.0, 891.0, 950.0], [840.0, 933.0, 1063.0, 945.0, 1066.0, 1051.0], [838.0, 1041.0, 1153.0, 1124.0, 759.0, 991.0], [833.0, 1015.0, 1066.0, 1124.0, 701.0, 1042.0], [830.0, 1079.0, 1103.0, 1098.0, 742.0, 1212.0]], subproblem_count = 1088)

We're about 3x faster

@odow odow merged commit 067521e into master Dec 18, 2025
7 checks passed
@odow odow deleted the od/tv-perf branch December 18, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants