How to define the facts in prolog db for planing metro routes?
Well i cant decide how should my facts look in the prolog database...and my assignment is to write predicate that will give you the shortest path between 2 subway sta开发者_开发百科tions i have idea for solving this problem but what troubles me is how to efficiently represent the stations on the lines so if you have idea and what to share please do :) and thx
How about plain old atoms:
node(picadilly_circus).
node(leicester_square).
node(covent_garden).
Connections:
edge(picadilly_circus, leicester_square).
edge(leicester_square, covent_garden).
精彩评论