The two ways to represent graphs


next up previous contents
Next: Operators
Up: Introduction to Prolog for Mathematicians
Previous: Lists for graphs

The two ways to represent graphs

So there are two approaches to representing trees and other graphs:

The first is better when the program is working with one graph which remains unchanged throughout. For instance, a program to simulate a network of computers. This could be given a set of clauses defining the layout of the network, and then work on that.

The second is better when the program needs to create lots of new graphs. For example, programs for grammatical analysis, or for reducing finite-state machines, or for pasting categorical diagrams.



Jocelyn Ireson-Ireson-Paine
Mon Jul 17 22:27:41 BST 1995