LuckyStarr
Programmer
Hi Guys,
I have a little problem: I need a prolog program that if you give a list representing a graph, it returns another list with the topological sort of the graph.
Example: A 3 node graph with edges (1 2)(3 1) and (3 2)
?-G=[3,[1, 2],[3, 1, 2]],graph(G,X).
X = [3,1,2]
Can you help me?
Thanks,
I have a little problem: I need a prolog program that if you give a list representing a graph, it returns another list with the topological sort of the graph.
Example: A 3 node graph with edges (1 2)(3 1) and (3 2)
?-G=[3,[1, 2],[3, 1, 2]],graph(G,X).
X = [3,1,2]
Can you help me?
Thanks,