DARMA-tasking / ccm-milp

CCM Model MILP
Other
0 stars 0 forks source link

Add automated testing of basic cases #9

Closed ppebay closed 1 month ago

ppebay commented 2 months ago

To start, use the same cases as the one that are tested in LBAF, but now using the MILP configuration. Extract the optimum and verify we obtain the same results.

tlamonthezie commented 1 month ago

@maxime-bfsquall please find here some precisions: We have to split ccm_milp into 2 scripts:

GLPK Solver: https://www.gnu.org/software/glpk/ CBC Solver: https://github.com/coin-or/Cbc

Problem solving should generate the solution file (*.sol) and CI must test that the solution file contains exactly 2.0 as the objective value

GLPK can be installed on Debian using apt install glpk-utils CBC can be installed (independent from pulp) on Debian using sudo apt install coinor-cbc

maxime-bfsquall commented 1 month ago

@ppebay I had a problem with the solver GLPK. The names of the variables used in the problem file are special characters and GLPK solver doesn't accept that. I had to change them to be able to try the solver.

Is it a problem if I let them like that or should I do some research to see if it is possible to use them as special characters with the GLPK solver ?

ppebay commented 1 month ago

@maxime-bfsquall no problem with changing from Greek letters to their Latin transcriptions.

One question however: why use ALL-CAPS instead of regularly-capitalized letters, e.g., Chi for χ, etc.?

maxime-bfsquall commented 1 month ago

@ppebay no particular reason, I can use capitalized letters.

ppebay commented 1 month ago

Sorry @maxime-bfsquall, my mistake, I verified in our source paper for this work, and it turns out that we use all-lowercase Latin transliteration:

Screenshot 2024-09-06 at 08 03 22

So χ => 'chi', etc.

ppebay commented 1 month ago

@maxime-bfsquall please add the two following cases:

maxime-bfsquall commented 1 month ago

@ppebay

ppebay commented 1 month ago

@maxime-bfsquall I just ran again the test, and I confirm that I the expected result should be 4.0:

# Available examples:
  0) small.SmallProblem
  1) synthetic_blocks.SyntheticBlocks
  2) ccm_example_no_sub_cluster.CCMExampleNoSubCluster
  3) ccm_example_with_sub_cluster.CCMExampleWithSubCluster
  4) illustration_1.Illustration1
  5) illustration_2.Illustration2
  example index: 1

# Model configuration:
  FWMP [y/N]? y
  value of alpha [0.0]? 1
  value of beta [0.0]? 
  value of gamma [0.0]? 
  value of delta [0.0]? 0.3
  bounded memory [y/N]? 
  preserve clusters [y/N]? y

# Initializing FMWP configuration with:
  alpha = 1.0
  beta = 0.0
  gamma = 0.0
  delta = 0.3
  without rank memory upper bound
  while preserving block clusters

we then obtain:

# Solution summary:
Rank 0: L = 2.5, W = 2.5, unhomed: 0
Rank 1: L = 4.0, W = 4.0, unhomed: 0
Rank 2: L = 1.5, W = 1.5, unhomed: 0
Rank 3: L = 0.0, W = 0.0, unhomed: 0
w_max = 4.0
$assignments=[0, 0, 0, 0, 1, 1, 1, 1, 2];

Can you please share your own output for this case @maxime-bfsquall ?

maxime-bfsquall commented 1 month ago

My apologies, I had not set preserve_clusters at True. It's done and OK now