Depthmap: A Program To Perform Visibility Graph Analysis
Depthmap: A Program To Perform Visibility Graph Analysis
Alasdair Turner
University College London, UK
Abstract
Here we present Depthmap, a program designed to perform visibility graph analysis of
spatial environments. The program allows a user to import a 2D layout in drawing exchange
format (DXF), and to fill the open spaces of this layout with a grid of points. The user may
then use the program to make a visibility graph representing the visible connections between
those point locations. Once the graph has been constructed the user may perform various
analyses of the graph, concentrating on those which have previously been found to be useful
for spatial description and movement forecasting within the Space Syntax literature. Some
measures which have not received so much mainstream attention have also been implemented. In addition to graph analysis, a few sundry tools are also enabled so that the user
may make minor adjustments to the graph. Depthmap has been implemented for the
Windows 95/98/NT and 2000 platforms.
1 Introduction
The application of visibility graph analysis (VGA) to building environments was first introduced by Braaksma and Cook (1980). Braaksma and Cook calculate the co-visibility of various units within an airport layout, and produce an adjaceny matrix to represent these relationships, placing a 1 in the matrix where two locations are mutually visible, and a 0 where they
are not. From this matrix they propose a metric to compare the number of existing visibility
relationships with the number which could possibly exist, in order to quantify how usefully
a plan of an airport satisfies a goal of total mutual visibility of locations. This type of analysis
was recently rediscovered by Turner et al. (Turner and Penn, 1999; Turner et al., 2001), through
considering recent developments in Space Syntax of various isovist approaches (see Hanson,
1998, for further background). They recast the adjaceny matrix as a visibility graph of locations, where a graph edge connects vertices representing mutually visible locations. Turner et
al. then use several graph metrics as a few representative measures which could be performed
on such graphs. The metrics they apply are taken from a combination of techniques used in
Space Syntax and those employed in the analysis of small-worlds networks by Watts and
Strogatz (1998).
Here we present a tool which enables a user to perform VGA on both building and urban
environments, allowing the user to perform the kind of analysis proposed by Turner et al..
We call this tool Depthmap. Depthmap first allows the user to import layouts in 2D DXF
format and to fill the layout with a rectilinear grid of points. These points may then be used
to construct a visibility graph, and we describe this procedure in section 2. After the graph has
Proceedings . 3rd International Space Syntax Symposium Atlanta 2001
31
Keywords:
visibility graph,
spatial analysis,
software development
Alasdair Turner
Center for Advanced
Spatial Analysis,
Torrington Place
Site, University
College London,
Gower Street,
London WC1E 6BT,
UK
[email protected]
31.1
been constructed, Depthmap gives the user several options to perform analysis on the graph,
which we describe in detail in section 3. The methods include those employed by Turner et al.,
but also some, such as control (Hillier and Hanson, 1984) or point depth entropy (following
a formula proposed by Hiller et al., 1987), which have not been previously applied to visibility
graph analysis. We supply algorithmic and mathematical details of each measure, as well as
samples of results, and short explanations of why we believe these may be of interest to
other researchers. In section 4 we include a brief description of extra facilities included in
Depthmap to adjust the edge connections in the visibility graph, and give guidance for their
use in spatial analysis. Finally, we present a summary in section 5.
2 Making a visibility graph from a DXF file
In this section we describe how the user may get from a layout to a visibility graph using
Depthmap. When the user first enters Depthmap, she or he may create a new graph file from
the File menu. This graph file initially appears blank, and the first thing the user must do is
to import a layout to be analysed. The import format used is AutoDesks drawing exchange
format (DXF), and only two dimensional layouts may
be imported. Once loaded, the user is shown the layout on the screen, and she or he may move it and
zoom in and out as desired. Figure 1 shows the program at this stage. After the DXF file has been imported, the user is ready to add a set of locations to be
used as a basis for the visibility graph.
31.2
Figure 1: The
application as it
appears after the DXF
file has been
imported
Figure 2: The user
fills a section of open
space using the fill
tool
31.3
(1)
of this equation. Figure 3 shows a simple layout after the visibility graph has been made using Depthmap. As the actual number of connections is huge
for each vertex, only ki values are shown for each location rather than the mess of actual
connections. Depthmap colours ki values using a spectral range from indigo for low values
through blue, cyan, green, yellow, orange, red to magenta for high values. The user may
change the bounds for this range, or choose to use a greyscale instead, using a menu option
from the View menu. Since this paper is reproduced in greyscale, all the figures shown have
used the greyscale option, where black represents low values and white represents high values.
Once the graph has been constructed, the user has various options, including graph analysis,
which we describe in the next section, and modification of the graph, which we describe in
section 4.
Figure 3:
Neighbourhood size
calculated for a
sample layout
31.4
Clustering coefficient, gi, is described in detail by Watts (1999) and has its origin in the
analysis of small-world networks. Turner et al. found it useful for the detection of junction
points in environments. Clustering coefficient is defined as the proportion of vertices which
are actually connected within the neighbourhood of the current vertex, compared to the
number that could possibly be connected, as shown in equation 2.
(2)
where E(Gi) is the set of edges in the neighbourhood of vi and ki is the as previously
calculated. This is implemented in Depthmap by the following algorithm for each vertex in
the graph*
Again note that as the set of edges E(Gi) is not recorded, the information must be recovered from
the vertices in the neighbourhood, V(Gi)
Figure 5 shows the clustering coefficient calculated for a sample spatial configuration. As
noted by Turner et al. junctions in the configuration are picked out. However, as they suggest,
and looking at the figure, it actually seems to pick out better the changes in visual information
as the system is navigated, so low clustering coefficients occur where a new area of the system
may be discovered. Examining gi, seems a promising line of investigation when looking at
how visual information varies within an environment - for example, as suggested by Conroy
(2000) for finding pause points on journeys.
3.2 Control
31.5
(3)
(4)
Figure 5: Clustering
coefficient calculated
for a sample layout
Figure 6: Control
calculated for a
sample layout
The mean path length Li from a vertex is the average number of edge steps to reach any other
vertex in the graph using the shortest number of steps possible in each case. This sort of
graph measure has a long history stretching back as far as Wiener (1947), and is pertinent to
visibility graph analysis due to the parallels with the use of integration in space syntax theory
(Hillier et al., 1993), showing how visually connected a vertex is to all other vertices in the
system. We calculate Li by constructing the set of point depths, as follows. The algorithm we
use is not the most time efficient, as shortest paths are recalculated for each vertex, rather than
being stored in a cache. However, the memory constraints on current personal computers
mean that storing all the shortest paths in the system would rapidly use up the available
memory. Hence, the algorithm that follows works in O(n2) time. It obtains point depths for
all the vertices in the system from the current vertex, by adding ordered pairs of vertices and
depths to the set P.
31.6
An asterisk, such as in the set pair {v1, *}, represents a wild card
matching operation. For example, {v1, *} matches any of {v1,
1}, {v1, 2} or {v1, 4}.
Once the point depth set has been constructed, it is facile to
calculate measures such as mean depth and integration. Figure
7 shows mean depth for our sample system. As has been shown, this measure would seem
to be useful understanding movement of people within building environments, where it is
difficult to apply traditional Space Syntax methods such as axial analyses at high resolutions.
However, in urban environments, since we are measuring numbers of turns from location to
location, VGA integration quickly approximates to axial integration (albeit with each line
weighted by the street area), and due to speed considerations, it may not be as beneficial to use
VGA integration in these situations.
(5)
where dmax is the maximum depth from vertex vi and pd is the frequency of point depth *d*
from the vertex. This is implemented algorithmically in Depthmap as follows:
31.7
Calculating point depth entropy can give an insight into how ordered the system is from a
location. For example, if a doorway is connected to a main street then there is a marked
disorder in the point depths from the point of view of the doorway: at depth 1 there are only
a few locations visible from the doorway, then at depth 2 there are many locations from the
street, and then order contained within further depths will depend on how the street is
integrated within its environment. Figure 8 shows the point depth entropy as calculated by
Depthmap. Other entropy-like measures are also calculated. The information from a point is
calculated using the frequency with respect to the expected frequency of locations at each
depth, as shown in equation 6. Obviously, what is meant by expected is debatable, but as the
frequency is based on the probability of events occurring (that is, of the j graph splitting), it
seems appropriate to use a Poisson distribution (see Turner, 2001, for a more detailed
discussion), which has the advantage of depending only on a single variable, the mean depth
of the j graph. The resulting formula is shown in equation 6 and is similar to that used by
Hiller et al. for relativised entropy. So, why calculate the entropy or information from a point?
The answer is threefold: firstly, it was found to be useful by Hiller et al.; secondly, it appeals
intuitively to a tentative model of people occupation of a system, in that the entropy corresponds to how easy it is to traverse to a certain depth within the system (low disorder is easy,
Proceedings . 3rd International Space Syntax Symposium Atlanta 2001
high disorder is hard); and thirdly, it remedies the problem that VGA integration is heavily
biased towards large open areas. In axial integration, because the system is dimensionless,
large open areas do not unduly weight the values of the lines; that is, the large areas only
weight the values by their increased connections, not through their area. By contrast, in VGA
integration the measure approximates a mean of distance times area, as discussed in the
previous section. Hence, by using a topological measure such as point depth entropy we
eliminate the area dependence of the measure, and instead concentrate on the visual accessibility of a point from all other points.
(6)
31.8
which a user would expect from a program, such as printing, summarising graph data and so
on, which we have restricted to a user manual. What we do hope to have given here is a
flavour of what is achievable with the program, an insight into how the graph is analysed,
and our reasons for choosing the graph measures we have included.
Finally, it is worth noting that Depthmap is designed to be a tool for Space Syntax
researchers. This means that we have chosen DXF as the input medium, and that the program runs interactively, allowing the graph to be modified and the analysis to be reapplied. It
also means that sometimes we have not used the fastest algorithm to achieve a task, but have
instead designed the program to work with the memory available on most personal computers today. On a 333 MHz machine running Windows 98, Depthmap takes around an hour to
process a graph with 10 000 point locations, from start to finish, and the program has been
tested on graphs with up to 30 000 point locations. We hope that the Space Syntax community will enjoy using our tool and we look forward to improving it with the input and insight
of future researchers.
31.9
References
Figure 9: Editing
connections