Re: List partitioning
- From: Boris Borcic <bborcic@xxxxxxxxx>
- Date: Mon, 27 Oct 2008 21:27:29 +0100
bim wrote:
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 ;
Good you say this, makes your problem sound less like homework (since what need would you have for an complete list of possible partitions rather than just one ?).
This said - and while I don't mean to argue against Prolog (I am a lurker here for *some* reason) - I do not see that your conclusion follows clearly (that Prolog is a better fit). Witness that the most concise solutions provided in both languages to your initial simplified problem, have *exactly* the same syntactic complexity - what gives no reason to think that solutions to the complete problem would be different.
Cheers, BB
.
- Follow-Ups:
- Re: List partitioning
- From: bim
- Re: List partitioning
- References:
- List partitioning
- From: BimKif
- Re: List partitioning
- From: pineapple . link
- Re: List partitioning
- From: bim
- Re: List partitioning
- From: Boris Borcic
- Re: List partitioning
- From: bim
- List partitioning
- Prev by Date: Re: List partitioning
- Next by Date: Re: List partitioning
- Previous by thread: Re: List partitioning
- Next by thread: Re: List partitioning
- Index(es):
Relevant Pages
|