Skip to main content Accessibility help
×
Hostname: page-component-84b7d79bbc-g5fl4 Total loading time: 0 Render date: 2024-08-01T21:10:57.484Z Has data issue: false hasContentIssue false
This chapter is part of a book that is no longer available to purchase from Cambridge Core

Storing Graphs in Computer Memory

from III - Articles Extending Discrete Mathematics Content

Larry E. Thomas
Affiliation:
Saint Peter's College
Brian Hopkins
Affiliation:
Saint Peter's College
Get access

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 Mathematics
Classroom Projects, History Modules, and Articles
, pp. 287 - 292
Publisher: Mathematical Association of America
Print publication year: 2009

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×