Re: CLP(FD) Prolog: help needed with a simple problem
From: Chema (sipser_at_hotmail.it)
Date: 03/29/05
- Next message: student: "Re: Thinking Recursion"
- Previous message: Torkel Franzen: "Re: Thinking Recursion"
- In reply to: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Next in thread: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Reply: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 07:39:03 GMT
Bart Demoen wrote:
> now impose:
>
> [AB,AC,BC] in 0..1
>
> and the condition that AB+AC+CD = (|V|-1) (2 in this case)
>
> and AB=1 \/ AC=1 && AB=1 \/ BC=1 && AC=1 \/ BC=1
I got the point, but the problem is: I've to impose this kind of
condition for each subgraph. Consider an undirected graph G=(V,E)
with E = (a,b), (b,c), (c,d), (d,h), (e,h), (a,e), (b,e), (b,h),
(c,h), (e,f), (f,h), (h,g), (d,g), (f,g)
You see, I should include at least two constrains for each cycle.
This is an NP hard problem, and this constrains grow in an
esponential way... I can't do that "manually".
An idea should be Markus's one, to query in "standard" prolog
cycles in G, but now my problem is: if I query the edges that
participate in a cycle, I get a "grounded" answer, not variables
anymore. And I can I set a domain [0..1] in a grounded set?
I'm confused :-)
Anyway, thank you for your help.
Regards
- Next message: student: "Re: Thinking Recursion"
- Previous message: Torkel Franzen: "Re: Thinking Recursion"
- In reply to: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Next in thread: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Reply: Bart Demoen: "Re: CLP(FD) Prolog: help needed with a simple problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|