Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document constraint primal better #358

Merged
merged 4 commits into from
May 15, 2018
Merged

Document constraint primal better #358

merged 4 commits into from
May 15, 2018

Conversation

odow
Copy link
Member

@odow odow commented May 13, 2018

Closes #220

@odow odow added the Type: Documentation This issue requires changes to the documentation label May 13, 2018
@codecov-io
Copy link

codecov-io commented May 13, 2018

Codecov Report

Merging #358 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
- Coverage   96.27%   96.21%   -0.06%     
==========================================
  Files          36       36              
  Lines        4723     4731       +8     
==========================================
+ Hits         4547     4552       +5     
- Misses        176      179       +3
Impacted Files Coverage Δ
src/attributes.jl 93.61% <ø> (ø) ⬆️
src/indextypes.jl 62.5% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e85ea35...f5dd70f. Read the comment docs.


Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the
function evaluated at the primal solution of the variables. For example, given
the constraint `2x + y <= 1`, and a primal solution of `(x,y) = (1,2)`, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple ways to encode this constraint in MOI, could help to be more precise (ScalarAffineFunction).


Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the
function evaluated at the primal solution of the variables. For example, given
the constraint `ScalarAffineFunction([x,y], [1, 2], 3)`-in-`LessThan(0)` and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an example with LessThan(4) would be better to show that this value is not used in the constraint primal.


Given a constraint `function-in-set`, the `ConstraintPrimal` is the value of the
function evaluated at the primal solution of the variables. For example, given
the constraint `ScalarAffineFunction([x,y], [1, 2], 3)`-in-`LessThan(4)` and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm. Now this is a bit weird because ScalarAffineFunction([x,y], [1, 2], 3)-in-LessThan(4) is not idomatic MOI. We expect these constraints to be normalized so the left-hand side has zero in the constant (i.e., solvers aren't expected to support otherwise).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://www.juliaopt.org/MathOptInterface.jl/stable/apimanual.html#JuMP-mapping-1
That said, from the perspective of JuMP, solvers can safely choose to not support the following constraints:

  • ScalarAffineFunction in GreaterThan, LessThan, or EqualTo with a nonzero constant in the function. Constants in the affine function should instead be moved into the parameters of the corresponding sets.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using zero in the function instead of 3 seems to be the way to go

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to the Interval set instead.

@odow odow merged commit 258f4f3 into master May 15, 2018
@odow odow deleted the odow/docconstrprimal branch May 15, 2018 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation This issue requires changes to the documentation
Development

Successfully merging this pull request may close these issues.

4 participants