开发者

How to define the facts in prolog db for planing metro routes?

开发者 https://www.devze.com 2023-01-28 21:41 出处:网络
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 f

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).
0

精彩评论

暂无评论...
验证码 换一张
取 消