Re: Prolog problem
- From: "Martijn Smeets" <info[at]msphotographics.nl>
- Date: Thu, 20 Oct 2005 14:30:01 +0200
"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
.
- References:
- Prolog problem
- From: Martijn Smeets
- Prolog problem
- Prev by Date: Comparing Two lists
- Next by Date: Re: Comparing Two lists
- Previous by thread: Re: Prolog problem
- Next by thread: Comparing Two lists
- Index(es):
Relevant Pages
|
|