jump-dev / Hypatia.jl

interior point solver for general convex conic optimization problems
Other
141 stars 15 forks source link

Alfonso matlab code comparison #23

Closed chriscoey closed 5 years ago

chriscoey commented 6 years ago

running Alfonso 75cba5f with default options against the following Alfonso.m Matlab code with (the same) default options:

seed = 2017;
tol = 1e-06;
results = random_lp(500, 1000, tol, seed);
seed = 2017;
tol = 1e-06;
intParams = ChebInterval(5); 
results = polyEnv(intParams, 2, 5, tol, seed);
tol = 1e-06;
intParams = FeketeCube(6, 2); 
results = polyOpt(intParams, 'butcher', tol);
intParams = FeketeCube(4, 4); 
results = polyOpt(intParams, 'caprasse', tol);
intParams = FeketeCube(4, 3);
results = polyOpt(intParams, 'lotka-volterra', tol);
intParams = PaduaSquare(7); 
results = polyOpt(intParams, 'motzkin', tol);
intParams = FeketeCube(3, 4); 
results = polyOpt(intParams, 'reaction-diffusion', tol);
intParams = PaduaSquare(8);
results = polyOpt(intParams, 'robinson', tol);

primal and dual objectives for the Julia code and Matlab code match. the iteration counts (very similar) and timings (in seconds) are:

test iters Matlab 75cba5f c9f1eb5 133b422
dense lp 65 5.8 4.1 2.03 1.25
envelope 30 0.085 0.043 0.020 x
butcher 32/30 0.63 0.41 0.357 0.136
caprasse 31/30 1.38 1.87 1.80 0.530
lotka-volt 31/30 0.47 0.38 0.37 0.104
motzkin 41/42 0.35 0.24 x 0.054
reac-diff 29/30 0.32 0.23 0.19 0.075
robinson 29 0.34 0.23 0.17 0.034
blegat commented 6 years ago

Looks good, so Alfonso.jl is faster in all examples ! What do you mean by 32/30 does it mean 32 in Matlab and 30 in Julia ?

chriscoey commented 6 years ago

The Julia code was slower on Caprasse only. Yes 32/30 means 32 on Matlab and 30 on Alfonso. There shouldn't be a difference at this point as the algorithms (modulo some linear algebra) are currently the same (this will change), so it comes down to different numerical procedures in Matlab vs Julia.

chriscoey commented 6 years ago

the LP might be faster after https://github.com/JuliaLang/julia/pull/29296 is merged. but we are currently using views so maybe not - it's worth investigating.

chriscoey commented 5 years ago

things are pretty tough to compare now since the package has diverged significantly. if anyone is very interested we can try to compare again.