Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8965863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:54:08+00:00 2026-06-15T16:54:08+00:00

I have been doing linear programming problems in my class by graphing them but

  • 0

I have been doing linear programming problems in my class by graphing them but I would like to know how to write a program for a particular problem to solve it for me. If there are too many variables or constraints I could never do this by graphing.

Example problem, maximize 5x + 3y with constraints:

  • 5x – 2y >= 0
  • x + y <= 7
  • x <= 5
  • x >= 0
  • y >= 0

I graphed this and got a visible region with 3 corners. x=5 y=2 is the optimal point.

How do I turn this into code? I know of the simplex method. And very importantly, will all LP problems be coded in the same structure? Would brute force work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:54:10+00:00Added an answer on June 15, 2026 at 4:54 pm

    There are quite a number of Simplex Implementations that you will find if you search.

    In addition to the one mentioned in the comment (Numerical Recipes in C),
    you can also find:

    1. Google’s own Simplex-Solver
    2. Then there’s COIN-OR
    3. GNU has its own GLPK
    4. If you want a C++ implementation, this one in Google Code is actually accessible.
    5. There are many implementations in R including the boot package. (In R, you can see the implementation of a function by typing it without the parenthesis.)

    To address your other two questions:

    1. Will all LPs be coded the same way? Yes, a generic LP solver can be written to load and solve any LP. (There are industry standard formats for reading LP’s like mps and .lp

    2. Would brute force work? Keep in mind that many companies and big organizations spend a long time on fine tuning the solvers. There are LP’s that have interesting properties that many solvers will try to exploit. Also, certain computations can be solved in parallel. The algorithm is exponential, so at some large number of variables/constraints, brute force won’t work.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been doing socket programming for many years, but I have never had
I have been doing programming, but now I'm facing a challenge. I'm on a
I have been doing some x86 programming in Windows with NASM and I have
I have been doing a lot of research trying to figure this out, but
I have been doing a lot if research into this, but I havent found
I have been doing some research on this but found no clear answer. The
I have been doing some Winsock programming lately. I do not do much stuff
I have been doing a lot of reading but I have not been able
I have been doing a phonegap app for android but am stuck on the
I have been doing the following: var store = window.localStorage; store.setItem() but now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.