Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Pysat wsum #114
base: master
Are you sure you want to change the base?
Pysat wsum #114
Changes from 33 commits
29777d5
00e3799
a6b5b74
b009795
0ed2677
404d2e2
f816000
f808883
267f7b1
8ab3f5f
67774ba
d1683b1
3db2a51
fa2deb2
3acc3b7
fac595c
e07a10b
7e9be25
bf16cbe
4d3dbd1
d2885e1
2da89ec
ea10231
5f12a4a
0149425
d96d642
3a19d68
c5ebdcc
bca039b
325cb49
bfd11de
e5fd82a
f90c836
51af5d5
897ab6e
e3ed926
11240f9
eca6cbd
aeb9021
82840ce
96d7dc2
eb765c2
b043915
ad33826
624719c
ae059e4
07f8b26
d937513
94c3d8d
d0ad014
586fddf
74803bb
b313c69
c2daf46
09d03c4
d9df156
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing the weights in the condition.
Now
10 * a + 5 * b != 5
is converted to10 * a + 5 * b <= 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current version generates '[(BV0) -> (sum([10, 5] * [a, b]) <= 4), (~BV0) -> (sum([10, 5] * [a, b]) >= 6)]'
which I think is correct? @IgnaceBleukx can you resolve this thread if you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I was confused here... it is the 'linearize' transfo that I added today for testing that did that rewriting.
You mean that it should be bound >= sum(weights) I think... but then indeed what about negatives (your comment lower). We could do bound >= sum(max(0,weights)) but what are we doing here then...
Either the bound is that max, and you can just post it as <= bound-1, or the bound is higher then the max and then the constraint is always true...
Maybe we should just drop this 'optimisation'?
I'm hoping that the PB encoding itself will check the 'always true' edge cases and so cover this appropriately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about negative weights? I think you need the weights in the condition here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed special case in to-be commited version; resolve if OK (ignace)