Re: CLP(FD) Prolog: help needed with a simple problem

From: Markus Triska (triska_at_gmx.at)
Date: 03/21/05


Date: Mon, 21 Mar 2005 03:03:29 +0000

Chema wrote:

> I've to solve a simple problem: given a Graph, find out its
> spanning tree. I can do it in Prolog, but I've no idea in CLP.
> Any suggestion is welcome (I don't want code, just an idea).

One way would be to introduce a variable X_e in 0..1 for each edge e
(denoting whether it is to be an element of the ST), state that the sum
over all these variables must equal |V| - 1, and add additional
constraints to prevent cycles.

All the best,
Markus.



Relevant Pages

  • Re: CLP(FD) Prolog: help needed with a simple problem
    ... > spanning tree. ... I can do it in Prolog, but I've no idea in CLP. ... > Any suggestion is welcome ...
    (comp.lang.prolog)
  • Re: CLP vs. plain old Prolog?
    ... I think in general CLP is easier to engineer complex search problems ... (global constraints, for example all_different() ... In Prolog you are generally interested in searching and pruning ... In CLP the generate-test is replaced by: ...
    (comp.lang.prolog)
  • Re: CLP vs. plain old Prolog?
    ... > I think in general CLP is easier to engineer complex search problems ... > than Prolog alone. ... > in the generate-test framework. ... applying constraints ...
    (comp.lang.prolog)
  • Re: How long it takes to educate Prolog/CLP programmer?
    ... other language" is pretty shallow. ... Now some guys want to apply the same principle to Prolog. ... 20 K lines of Prolog (with CLP) and they want someone to "learn ... years of C++ or Java. ...
    (comp.lang.prolog)
  • CLP vs. plain old Prolog?
    ... Can someone point me to a "white paper" or summary that gives me the ... advantages of CLP over plain vanilla Prolog? ... what does CLP add to the party? ...
    (comp.lang.prolog)