Re: List partitioning



Boris Borcic a écrit :
bim wrote:
pineapple.link@xxxxxxxxx wrote :
Sounds like a homework assignment.

It's not, I left studies years ago...
I just need a balancing algorithm for a program of mine, and I wonder if it wouldn't be easier to do it in Prolog.

Then maybe a Python version would serve.


Thank you for this Python version. However I'm really looking for a Prolog way of doing this.

I din't mention it because I wanted to keep it simple at start, but I have more constraints than what I explained initially (each item has a weight and each formed group should have quite the same total weight, some items are pre-grouped and these groups shouldn't be broken unless the balance isn't good enought...). So Prolog really seems to fit ;
.