15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Adjacency Matrices and Graphs<br />

Adjacency Matrices and Graphs<br />

This section includes:<br />

• An introduction to adjacency matrices<br />

• Instructions for graphing adjacency matrices with gplot<br />

• A Bucky ball example, including information about using spy plots to<br />

illustrate fill-in and distance<br />

• An airflow model example<br />

Introduction to Adjacency Matrices<br />

The formal mathematical definition <strong>of</strong> a graph is a set <strong>of</strong> points, or nodes, with<br />

specified connections between them. An economic model, for example, is a<br />

graph with different industries as the nodes and direct economic ties as the<br />

connections. The computer s<strong>of</strong>tware industry is connected to the computer<br />

hardware industry, which, in turn, is connected to the semiconductor industry,<br />

and so on.<br />

This definition <strong>of</strong> a graph lends itself to matrix representation. The adjacency<br />

matrix <strong>of</strong> an undirected graph is a matrix whose (i,j)th and (j,i)th entries<br />

are 1 if node i is connected to node j, and 0 otherwise. For example, the<br />

adjacency matrix for a diamond-shaped graph looks like<br />

A =<br />

1<br />

0 1 0 1<br />

1 0 1 0<br />

0 1 0 1<br />

1 0 1 0<br />

2<br />

4<br />

Since most graphs have relatively few connections per node, most adjacency<br />

matrices are sparse. The actual locations <strong>of</strong> the nonzero elements depend on<br />

how the nodes are numbered. A change in the numbering leads to permutation<br />

3<br />

6-17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!