it's quite general; e.g. X is precisely the set of losing coalitions
in a simple game (in cooperative game theory)
Put the function in combinat or sets? Apparently it is not just restricted to coding theory or some other specific structure.
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/os1LzBjsYnQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
Nathann
Yo !> I see. By the way, there is an approach to do this using ILP. At some point
> you have a 0-1 LP with NO sets generated so far as inequalities (and
> other inequalities that cut out the solutions found so far)
> I.e. if {j_1,...,j_m} is a NO-set then the corresponding inequality is
> x_{j_1}+...+x_{j_m}<=m-1, and the objective function is to maximize
> sum_j x_j.
>
> If your ILP is ineafsible, you're done.
>
> If you find a solution, say,
> x_{j_1}=...=x_{j_m}=1, and the remaining x_k=0,
> you add the inequality x_{j_1}+...+x_{j_m}<=m-1 to your list;
> (this cuts out this solution from being considered again)
>
> you also test the solution with your f, and if it passes, you store it.
>
> Now start with empty 0-1 LP, and run the ILP solver again and again, until
> done.
>
> You end up with a list of stored solutions (ordered by size, in fact)
>
> Implementing this would need a fast way to re-start the ILP solver
> (which CPLEX and GUROBI should do very well, I suppose)It is very kind of you to explain me how to write a LP.There are at least two problems with what you say:1) Make it run in your head with a boolean function f constant to "False". It will enumerate the 2^n no-sets.
2) If you fix it by minimizing instead of maximizing, (and by adding a constraint when you find a yes-set, and by adding a constraint when you add a no-set) then you are back to what my implementation does, except that you are solving a LP at each node while it can be done directly with the code I wrote. Faster.
Nathann
Yo !
>> 1) Make it run in your head with a boolean function f constant to "False". It will enumerate the 2^n no-sets.
>
> corner cases are hard, in theory too :-)
> You can certainly add a pre-testing by evaluating f on all singletons and pairs, say.
> (and this would also speed up things for functions having some NO singletons and pairs quite a bit)
This is not a corner case. What it tells you is that you do not
enumerate inclusionwise minimal no-sets, and that you will pay for it.
Make it run with lambda x: len(x)<5 on a set X of size 15, same
result.
> not necessarily faster. Your code completely ignores the polyhedral nature of the problem; e.g. the ILP can potentially terminate quite fast,
> due to it finding that the polyhedron defined at some point is already empty, while your code will keep looking for non-existing things...
It will not. And you can think of the "polyhedral nature" of binary
vectors all you want, if you need to enumerate them just do it the
straightforward way, not with a LP solver.
In this special case I don't see how a LP could beat a code where
feasibility is checked by intersection of bitsets. But if you care I
would be glad to see by how much it beats the LP method :-P
Nathann
IMHO, it's fine to put your code as a constructor in SimplicialComplex.
If you do this, cc me on the ticket, I'll review it.
--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/os1LzBjsYnQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.