The easist way to calculate distances in binary graphs - ie graphs that
have 1's in place if there is a link between nodes and 0's otherwise, is to
take the basic first order distance matrix and keep powering it until all
the elements become positive and at each iteration form a new matrix with
the elements of the powered matrix which have just become positive, given
by the power which is then the distance. The ultimate distance matrix
which is formed when all nodes are reachable from any other at a certain
power, is in fact the distance matrix and from this you can compute any
means you like. To get the mean distance for each node, sum the elements
for the row of the node and divide by number of nodes. For the overall mean
depth - add all the elements in the matrix and divide by the number of
nodes squared. This works if the matrix is square and if the graph is
strongly connected but I have never seem a space syntax graph that isnt
this, so it should be OK.
These calculations are made explict in most books on graphs - the one I
have which is ancient - is by Harary, Cartwight and Norman called
Structural Models published in 1965 by either Wiley or Prentice Hall
If you want a program to do this, then I think you might find one on the
net somewhere if you key in distance matrix graph etc to something like
www.google.com. In most languages these days there are functions that
compute matrices so all you need to do is find someone who can program the
code and use the matrix multiplication routines which are standard - in
basic if the first distance matrix is D1
then LET D2 = MAT D1 * MAT D1
and so on would do the trick ( not sure if you even need MAT as havent done
it for a while)
Mike Batty
>
>
>Does anybody know a quick way of calculating mean depth by using computer,
>especially when you work with a large sample of houses and need to find the
>mean depth of each space.(function).
>
>Thanks in advance,
>
>Ciler Kirsan
>
>
>
___________________________________________________________________
MICHAEL BATTY + DIRECTOR + CASA CENTRE FOR ADVANCED SPATIAL ANALYSIS
UNIVERSITY COLLEGE LONDON 1-19 TORRINGTON PLACE LONDON WC1E 6BT + UK
TEL 44 (0)20 7679 1781. FAX 44 (0)20 7813 2843. Mobile 07977 423 959
____________________________________________________________________
+ Look at our 3d Cities pages + http://www.casa.ucl.ac.uk/3dcities/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|