Book contents
- Frontmatter
- Contents
- List of Figures
- Preface
- 1 The Key Idea
- 2 Approaches to Parallel Software Development
- 3 Architectural Background
- 4 Models and Their Properties
- 5 The Categorical Data Type of Lists
- 6 Software Development Using Lists
- 7 Other Operations on Lists
- 8 A Cost Calculus for Lists
- 9 Building Categorical Data Types
- 10 Lists, Bags, and Finite Sets
- 11 Trees
- 12 Arrays
- 13 Graphs
- 14 Conclusions
- A C++ Library for Lists
- B Historical Background
- References
- Index
13 - Graphs
Published online by Cambridge University Press: 25 October 2009
- Frontmatter
- Contents
- List of Figures
- Preface
- 1 The Key Idea
- 2 Approaches to Parallel Software Development
- 3 Architectural Background
- 4 Models and Their Properties
- 5 The Categorical Data Type of Lists
- 6 Software Development Using Lists
- 7 Other Operations on Lists
- 8 A Cost Calculus for Lists
- 9 Building Categorical Data Types
- 10 Lists, Bags, and Finite Sets
- 11 Trees
- 12 Arrays
- 13 Graphs
- 14 Conclusions
- A C++ Library for Lists
- B Historical Background
- References
- Index
Summary
In this chapter we define the categorical data types of graphs. Graphs are ubiquitous in computation, but they are subtly difficult to work with. This is partly because there are many divergent representations for graphs and it is hard to see past the representations to the essential properties of the data type.
We follow the now familiar strategy of defining constructors and building graphs as the limit of the resulting polynomial functor.
Graphs have a long history as data structures. Several specialised graph languages have been built (see, for example, [69]), but they all manipulate graphs using operations that alter single vertices and edges, rather than the monolithic operations we have been advocating.
An important approach to manipulating graphs is graph grammars. Graph grammars [71] are analogues of grammars for formal languages and build graphs by giving a set of production rules. Each left hand side denotes a graph template, while each right hand side denotes a replacement. The application of a rule occurs on a subgraph that matches the left hand side of some rule. The matching subgraph is removed from the graph (really a graph form) and replaced by the right hand side of the rule. Various different conventions are used to add edges connecting the new graph to the rest of the original graph. Graph grammars are primarily used for capturing structural information about the construction and transformation of graphs. They do not directly give rise to computations on graphs.
- Type
- Chapter
- Information
- Foundations of Parallel Programming , pp. 163 - 170Publisher: Cambridge University PressPrint publication year: 1994