1

I want to solve a linear programming model which is build through VB.NET. In this context I have following questions,

a) How to call a CPLEX or any such solver (Coin-OR) through VB.NET? (While doing so I do not want CPLEX window to be opened. i.e. It should solve it in the background.)

b) How to transfer the LP model to CPLEX? (Again I want to stay away from opening a new window and then write the model to CPLEX)

VB.NET understanding: Intermediate

Thanks

mrn
  • 425
  • 2
  • 15
  • 33

2 Answers2

4

Microsoft Solver Foundation provides a plugin for CPLEX, and there are samples that shows both how to invoke the CPLEX plug-in and how to call MSF from VB.NET. You can download the standard MSF library from here.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
3

CPLEX can be used in VB.NET through the CPLEX/Concert .NET API which is a standard API supplied with the solver and is pretty straightforward to use. There is a good documentation available including this example and this tutorial. Examples are in C# but should give you the idea how to use the API in any .NET language.

You could also use MS Solver Foundation but it incurs additional costs and the product is discontinued.

Community
  • 1
  • 1
vitaut
  • 49,672
  • 25
  • 199
  • 336