Estimates the structural distances among all elements of dat
using the method specified in method
.
sdmat(dat, normalize=FALSE, diag=FALSE, mode="digraph",
output="matrix", method="mc", exchange.list=NULL, ...)
A matrix of distances (or an object of class dist
)
graph set to be analyzed.
divide by the number of available dyads?
boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag
is FALSE
by default.
string indicating the type of graph being evaluated. "digraph"
indicates that edges should be interpreted as directed; "graph"
indicates that edges are undirected. mode
is set to "digraph"
by default.
"matrix"
for matrix output, "dist"
for a dist
object.
method to be used to search the space of accessible permutations; must be one of "none"
, "exhaustive"
, "anneal"
, "hillclimb"
, or "mc"
.
information on which vertices are exchangeable (see below); this must be a single number, a vector of length n, or a nx2 matrix.
additional arguments to lab.optimize
.
Carter T. Butts buttsc@uci.edu
The search process can be very slow, particularly for large graphs. In particular, the exhaustive method is order factorial, and will take approximately forever for unlabeled graphs of size greater than about 7-9.
The structural distance between two graphs G and H is defined as
The accessible permutation set is determined by the exchange.list
argument, which is dealt with in the following manner. First, exchange.list
is expanded to fill an nx2 matrix. If exchange.list
is a single number, this is trivially accomplished by replication; if exchange.list
is a vector of length n, the matrix is formed by cbinding two copies together. If exchange.list
is already an nx2 matrix, it is left as-is. Once the nx2 exchangeabiliy matrix has been formed, it is interpreted as follows: columns refer to graphs 1 and 2, respectively; rows refer to their corresponding vertices in the original adjacency matrices; and vertices are taken to be theoretically exchangeable iff their corresponding exchangeability matrix values are identical. To obtain an unlabeled distance (the default), then, one could simply let exchange.list
equal any single number. To obtain the Hamming distance, one would use the vector 1:n
.
Because the set of accessible permutations is, in general, very large (lab.optimize
for more information regarding these options.
Structural distance matrices may be used in the same manner as any other distance matrices (e.g., with multidimensional scaling, cluster analysis, etc.) Classical null hypothesis tests should not be employed with structural distances, and QAP tests are almost never appropriate (save in the uniquely labeled case). See cugtest
for a more reasonable alternative.
Butts, C.T. and Carley, K.M. (2005). “Some Simple Algorithms for Structural Comparison.” Computational and Mathematical Organization Theory, 11(4), 291-305.
Butts, C.T., and Carley, K.M. (2001). “Multivariate Methods for Interstructural Analysis.” CASOS Working Paper, Carnegie Mellon University.
hdist
, structdist
#Generate two random graphs
g<-array(dim=c(3,5,5))
g[1,,]<-rgraph(5)
g[2,,]<-rgraph(5)
#Copy one of the graphs and permute it
g[3,,]<-rmperm(g[2,,])
#What are the structural distances between the labeled graphs?
sdmat(g,exchange.list=1:5)
#What are the structural distances between the underlying unlabeled
#graphs?
sdmat(g,method="anneal", prob.init=0.9, prob.decay=0.85,
freeze.time=50, full.neighborhood=TRUE)
Run the code above in your browser using DataLab