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 8501431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:12:41+00:00 2026-06-11T01:12:41+00:00

I am using CVXOPT for linear programming according to the following example: http://abel.ee.ucla.edu/cvxopt/examples/tutorial/lp.html I

  • 0

I am using CVXOPT for linear programming according to the following example:
http://abel.ee.ucla.edu/cvxopt/examples/tutorial/lp.html
I am pretty sure I express a constraint that

X1 >= 0 

But get a negative value for it.
How come? I get the “optimal solution found” message

A = matrix( [ [0.0, 0.0, 1.0, 1.0, -0.0, -0.0, -1.0, -1.0, -1.0, 0.0, 0.0], 
              [0.0, 1.0, 1.0, 0.0, -0.0, -1.0, -1.0, -0.0, 0.0, -1.0, 0.0], 
              [1.0, 0.0, 0.0, 1.0, -1.0, -0.0, -0.0, -1.0, 0.0, 0.0, -1.0]
              ]
            ) 

Constraint values (right hand side)

b = matrix( [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0] )

Minimizing function:

c = matrix( [-1.0, -1.0, -1.0] )

Calling:

 sol=solvers.lp(c,A,b)

But:

print (sol['x']): 
[-4.83e-09]
[ 1.00e+00]
[ 1.00e+00]

-4.83e-09>=0 
False

Thanks

  • 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-11T01:12:42+00:00Added an answer on June 11, 2026 at 1:12 am

    The default feasibility tolerance in CVXOPT is 1.0e-7, according to the user guide. Therefore you should expect that your constraints are only fulfilled to this level of accuracy.

    EDIT Thus, to ensure that your “hard” constraint is fulfilled for certain, you need to set your lower variable bounds to equal your “hard” constraint (i.e. 0 in your case) plus the feasibility tolerance:

    X1 >= 1.0e-7
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using this example . Pretend there are date fields in both forms. How would
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using HTML 5, I want to play multiple sounds simultaneously. how can I do
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using a populated Table Type as the source for a TSQL-Merge. I want to

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.