Re: Prolog problem




"Martijn Smeets" <info[at]msphotographics.nl> wrote in message
news:4356988f$0$777$3a628fcd@xxxxxxxxxxxxxxxxxxxxxxxxxx
>I have the following prolog problem, I just don't know how to solve..
> I hope somebody is able to help me out...
>
> I have to build the following:
> A program that checks a Directed Graph if there's a cycle that ends at
> it's beginning, and visits each point just once.
> The graph should be used as a structure graph(Points, Vertices).
> A vertex from a to b is presented like [a,b].
>
> The shape of the routine that should be called:
> tour(graph(Points, Vertices),Tour)
>
> Like:
>
> tour(graph([a,b,c,d], [[a,b],[b,b],[b,d],[d,c],[c,a]]),Tour).
> Tour = [a,b,d,c,a]
> yes
>
> tour(graph([a,b,c], [[a,b],[b,b],[a,c],[b,c]]),Tour).
> no

Nevermind, I already solved it.

Martijn


.



Relevant Pages

  • Prolog problem
    ... I have the following prolog problem, I just don't know how to solve.. ... A program that checks a Directed Graph if there's a cycle that ends at it's ... Wit regards, ... Martijn Smeets ...
    (comp.lang.prolog)
  • Re: Prolog problem
    ... >>I have the following prolog problem, I just don't know how to solve.. ... I cant use if-then's, and disjunctions by with; ... Martijn ... Prev by Date: ...
    (comp.lang.prolog)
  • Re: Prolog problem
    ... >>>I have the following prolog problem, I just don't know how to solve.. ... > Does it matter? ... Martijn ... Prev by Date: ...
    (comp.lang.prolog)
  • Partitioning a graph into path components
    ... I am unable to find a graceful solution to this problem. ... I have a complete directed graph on n vertices and ... into path components not exceeding a certain length k. ... Prev by Date: ...
    (sci.math)