Thursday, 18 July 2019

Search Paths on a Directed Graph

A directed graph with some nodes (from a to j) and some arcs connecting the nodes are defined.



This Prolog program can find out all paths between any two nodes. A path is a list of arcs that connects two nodes.

Source Code




Output


Run the script by swi-prolog, assume that the name of the script is graph02.pl.

No comments:

Post a Comment