cluster_spinglass(graph, weights = NULL, vertex = NULL, spins = 25,
  parupdate = FALSE, start.temp = 1, stop.temp = 0.01, cool.fact = 0.99,
  update.rule = c("config", "random", "simple"), gamma = 1,
  implementation = c("orig", "neg"), gamma.minus = 1)NULL. If it is null and the input graph has a NULL and no such attribute is
present then the edges will have evertexvertexvertexvertexvertex argument is not given, ie. the first form is
used then a cluster_spinglass returns a
communities object.If the vertex argument is present, ie. the second form is used then a
named list is returned with the following components:
vertex.vertex.vertex and the rest of the graph.This idea is reversed for edges having a negative weight, ie. few negative
edges inside a community and many negative edges between communities. Note
that only the 
The spinglass.cummunity function can solve two problems related to
community detection. If the vertex argument is not given (or it is
NULL), then the regular community detection problem is solved
(approximately), i.e. partitioning the vertices into communities, by
optimizing the an energy function.
If the vertex argument is given and it is not NULL, then it
must be a vertex id, and the same energy function is used to find the
community of the the given vertex. See also the examples below.
M. E. J. Newman and M. Girvan: Finding and evaluating community structure in networks, Phys. Rev. E 69, 026113 (2004)
V.A. Traag and Jeroen Bruggeman: Community detection in networks with
positive and negative links, 
communities, componentsg <- sample_gnp(10, 5/10) %du% sample_gnp(9, 5/9)
  g <- add_edges(g, c(1, 12))
  g <- induced_subgraph(g, subcomponent(g, 1))
  cluster_spinglass(g, spins=2)
  cluster_spinglass(g, vertex=1)Run the code above in your browser using DataLab