Book contents
- Frontmatter
- Introduction
- Dedication
- Contents
- I Classroom-tested Projects
- II Historical Projects in Discrete Mathematics and Computer Science
- III Articles Extending Discrete Mathematics Content
- A Rabbi, Three Sums, and Three Problems
- Storing Graphs in Computer Memory
- Inclusion-Exclusion and the Topology of Partially Ordered Sets
- IV Articles on Discrete Mathematics Pedagogy
- About the Editor
Storing Graphs in Computer Memory
from III - Articles Extending Discrete Mathematics Content
- Frontmatter
- Introduction
- Dedication
- Contents
- I Classroom-tested Projects
- II Historical Projects in Discrete Mathematics and Computer Science
- III Articles Extending Discrete Mathematics Content
- A Rabbi, Three Sums, and Three Problems
- Storing Graphs in Computer Memory
- Inclusion-Exclusion and the Topology of Partially Ordered Sets
- IV Articles on Discrete Mathematics Pedagogy
- About the Editor
Summary
Introduction
Many of the structures we use in discrete mathematics are nonlinear when they are drawn in the usual way on paper. For example, a graph will often have many edges leaving or entering a given vertex, with the number of edges changing from vertex to vertex. Drawing such a graph on paper could produce a rather messy diagram which takes two dimensions to represent. However, most graph algorithms used in problems of any size are executed on a computer which has only a linear (one-dimensional) memory. The question naturally arises: How do we represent an inherently two-dimensional object, such as a graph or a matrix, in one dimension? This note explores some of the ways this question can be answered.
A computer's memory
We will begin with a simplified explanation of the way the memory of a regular desktop computer might be organized. The memory consists of consecutive locations where data, represented in a binary code, can be stored. In a memory with n consecutive locations, the locations are numbered with addresses beginning with address 0: 0, 1, 2, …, n. If, for example, a single location can hold one byte (eight bits) of binary code, a one-kilobyte memory will have locations numbered 0, 1, 2, …, 1024, since 1Kb of memory contains 210 = 1024 bytes. Pictorially, we can think of the memory as a long collection of numbered boxes as seen in Figure 1.
- Type
- Chapter
- Information
- Resources for Teaching Discrete MathematicsClassroom Projects, History Modules, and Articles, pp. 287 - 292Publisher: Mathematical Association of AmericaPrint publication year: 2009