Linear programming in VB.NET

dimuthu

Member
Joined
Apr 28, 2007
Messages
6
Programming Experience
Beginner
Dear all,

I want to know how to code linear programming model in VB.NET (v1.1)
anybody can do this in VB.net pls reply me.

example:

A Toy problem
A local furniture shop makes chairs and tables. The projected profits for the two products are, respectively $20 per chair and $30 per table. The projected demands for chairs and tables are 400 and 100, respectively. each chair requires 2 cubic feet of wood while each table reqires 4 cubic feet. The shop has a total amount of 1000 cubic feet of wood in store. How many chairs and tables should the shop make in order to maximize its profit?

let x1 be the number of chairs and x2 the number of tables to be made. There are the two variables, or unknowns, for this problem. The shop wants to maximize its total profit, 20x1+30x2, subject to the constraints that (a) the total amount of wood used to make the two products can not exceed the 500 cubic feet available, and (b) the number of chairs and tables to be made should not exceed the demands. In additional, we should not forget that the number of chairs and tables made to be nonnegative. Putting all these together, we have an optimization problem:

max 20x1 + 30x2
subject to
2x1 + 4x2 ≤ 1000
0 ≤ x1 ≤ 400
0 ≤ x2 ≤ 1000

anybody can do this in VB.net pls reply me.
 
we'd probably brute force it, using 2 loops, checking every value of X1 and X2. VB.NET is not an programming language with which one would do this from the analytic/goal seeking point of view (i forget what those languages are called). If you want me to do it for you, deposit $20 in my paypal account ;)
 
Think I would create a product/order class with the characteristics, add them to a list, sort them by profit, then use 1 loop to exhaust the available resources to each order limit.
 
Yes dear, this is only an example. My real research has 60x45 variables to combine and compare, so that is not possible to do with loops. Because it takes more time. Just I mentioned here only an example for your convenience. I want only a method to embed linear programming to VB.
Thanks.
and i revised the optimization as here,

max 20x1 + 30x2
subject to
2x1 + 4x2 ≤ 1000
0 ≤ x1 ≤ 400
0 ≤ x2 ≤ 100
any body interesting to help me, here is my email. dimuthupiyaratne@yahoo.com
 
Last edited:
Dude, using VB for this is like using a hammer to open a can of beans.. Especially if you have 60-odd variables. Use a language designed for it.
 
Dear Cjard, I think you don't like to give detailed replies for free. It's Ok. I am a student and newer for programming. Can you tell me what are the languages designed for linear calculations and if those can be embeded to VB.NET? If there any web sites for refer those?
Thanks
 
If you search web "vb.net linear programming" you can find several libraries that can be used, but they look quite pricey! ($1000-12000)

The Microsoft Excel library includes a simple 200 variables Solver that you can automate also, you could try web search "vb.net excel solver".

If your intension is not this particular problem, but instead you want to create a general purpose LP solver yourself, then the above quotes should tell you how advanced this is. If you manage to do it you can start selling these very pricey products too.

(btw, "the language designed for linear calculations" is called by a general term "mathematics" ;))
 
Dear Cjard, I think you don't like to give detailed replies for free.
If you cast around this forum at some of the threads you'll see my replies are incredibly detailed, but its usually on topics where there is a definite point/purpose to the line of questioning. What youre asking here is very generic, very broad and not a clear question. Because it is so broad, I cannot give up a significant amount of free time to researching it because I would then effectively be writing a dissertation on the implementation of an LP language using VB.net.

It's Ok. I am a student and newer for programming.
What a relief. If youre new to programming, then why oh why do you go straight for doing something like this. Cant you start witha "Hello WOrld" program or something? As a compare, suppose I couldnt speak chinese, at all. Hadnt got a clue about anything to do with it. Would it make sense to apply for a PhD at china's most prestigious university, knowing full well it was a 100,000 symbol dissertation on something in microbiology (at topic I know very little about)?

Can you tell me what are the languages designed for linear calculations and if those can be embeded to VB.NET?
I cant see that vb.net can offer you here.. A bit like being an English speaker, going off to that Chinese university; all your work, output, discussions etc are going to be in chinese with chinese people; what advantage is it to know english?
If there any web sites for refer those?
Thanks
The wikipedia article on linear programing details several; perhaps you could start with those?!
 
Back
Top