COIN-OR::LEMON - Graph Library

Opened 8 years ago

Last modified 5 years ago

#345 new enhancement

Obtaining and storing the LP solution

Reported by: kpeter Owned by: alpar
Priority: major Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description (last modified by kpeter)

It would be nice if the LP and MIP solver interfaces provided functions for obtaining the LP solution at once. We could use a class that can store the solution efficiently, i.e. it should store variable-value pairs for the non-zero valued variables.

This ticket is a follow-up of #326.

Change History (5)

comment:1 follow-up: Changed 8 years ago by kpeter

  • Description modified (diff)

Two possiblities were discussed in #326 (see details and reasons there).

  1. We could use the Expr type for this purpose, since its implementation is suitable for that (it stores column-value pairs). However, it would be strange, because the name of the class and its members reflects the other purpose for which the class can be used. Now it is used only for storing linear expressions, i.e. certain coefficients are assigned to the variables, and all namings correspond to this usage.
  1. We could introduce another class, e.g. Solution for this purpose, which could use the same or similar implementation as Expr, but its members would have names that are more suitable for this purpose (e.g. value instead of coefficient). This class could be a wrapper for Expr or have a separate implementation. However, both ways would make the code maintenance harder.

Of course, DualExpr or DualSolution could be used for stroing the dual solution.

Another important question is the names of the functions that can be used to obtain the primal/dual solution.

comment:2 in reply to: ↑ 1 Changed 8 years ago by kpeter

Replying to kpeter:

Another important question is the names of the functions that can be used to obtain the primal/dual solution.

Currently, primal() and dual() functions are used for other purposes. We could use primalSolution() and dualSolution(), and maybe solution() in MipSolver, but it would be a bit confusing, because we already have sol() functions.

comment:3 follow-up: Changed 8 years ago by alpar

A minor clarification. Ideally, the classification should not be according to whether a variable is zero or not but according to whether it is in the basis, or it is at one of the variable bounds.

So the proposal 2. is out of question. If this Solution class will reflect the above, then it deserves being a separate class. Otherwise it does not.

comment:4 in reply to: ↑ 3 Changed 8 years ago by kpeter

Replying to alpar:

... then it deserves being a separate class. Otherwise it does not.

I don't think we could state this without doubt. In fact, I prefer the second proposal.

comment:5 Changed 5 years ago by alpar

  • Milestone changed from LEMON 1.3 release to LEMON 1.4 release
Note: See TracTickets for help on using tickets.