-
Notifications
You must be signed in to change notification settings - Fork 1
[WIP] The counting version of branching #59
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
So the problem can be represented as follows? Constraints:
The second constraint seems to be quite hard if we allow |
I did some small-scale experiments on RRGs and grid graphs and found that under the current loss function and constraints with |
weights = collect(1:7.0) | ||
num_items = 5 | ||
result_ip = OptimalBranchingCore.weighted_minimum_signed_exact_cover(IPSolver(max_itr = 10, verbose = false), weights, subsets, num_items, 10.0) | ||
@test result_ip ≈ [1.0, -1.0, 1.0, 0.0, 0.0, 0.0, 0.0] |
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.
@YijiawWang in many cases, we only have 0-1 outcome, but in some cases, we can have -1 weights. Here is an example.
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.
When we only pursuit approximate cover, then we may have more non-Boolean coefficients. In this case, the requirement is not cover some entries exactly once. Instead, we need to reduce the norm
2 distance.
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.
@YijiawWang in many cases, we only have 0-1 outcome, but in some cases, we can have -1 weights. Here is an example.
Soga! But in the set covering problem corresponding to the candidate clauses, the sizes of the sub-sets (the number of tbl entries covered by each candidate) and their weights (the truncated sc after removing the candidate) are generally proportional
. So maybe it's not common to encounter situations like sub_set_2 in the example, where a smaller sub-set has a larger weight, making it more advantageous for c_2 to take a negative value?
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.
When we only pursuit approximate cover, then we may have more non-Boolean coefficients. In this case, the requirement is not cover some entries exactly once. Instead, we need to reduce the norm 2 distance.
Soga! I see! Maybe using dynamic ob to give approximate
solutions might better match the sparse structures compared to methods like MPS? However, in approximate cover, I'm worried that, similar to when we worked on QEC before, if we only consider local distance loss, we might discard branches that could play a significant role in the future, resulting in large errors? I wonder if we could try using a method like BP to first introduce an approximate environmental context
for the approximate cover?
(This is a BP algorithm on counting ISs that ensures convergence.
This PR is not finished yet. It is about solving the set covering problem with coefficients:
Given subsets$\{s_1, s_2, \ldots, s_m\}$ and the set of all elements $S = \bigcup_i s_i$ , find a sequence of real numbers $\{c_1, c_2, \ldots, c_m\}$ , such that
where the multiplication and addition operations are performed by treating the sets as bitstrings.
@ArrogantGao @YijiawWang It would be great if one of you could include this feature to the counting version of branching.