Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Discontinous graph problem

Status
Not open for further replies.

Lyoneus

Programmer
Joined
Jan 16, 2016
Messages
1
Location
CZ
Hello. I'm a newbie in prolog. I study Java at school and I'm still very coonfused in prolog and my time is running out. I beg you for help with this problem:

"There is given a discontinuous graph on the input. Write Prolog program which on the output prints lists of every nodes of each graph component.:

Discontinuous graph on the input is represented by it's edges for example like this:

e(1,2).
e(2,4).
e(2,5).
e(3,6).
e(3,7).
e(7,8).
That means this particular graph have two components and on the output should be something like this:

[1,2,4,5],
[3,6,7,8].

Thank ou very much...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top