# scgExtra

From igraph v0.6.5-2
by Gabor Csardi

##### SCG Extra Functions

Some useful functions to perform general actions in Spectral Coarse Graining (SCG).

- Keywords
- graphs

##### Usage

```
scgNormEps(V, groups, mtype = c("symmetric", "laplacian",
"stochastic"), p = NULL, norm = c("row", "col"))
```

##### Arguments

- V
- A numeric matrix of (eigen)vectors assumed normalized.
The vectors are to be stored column-wise in
`V`

). - groups
- A vector of
`nrow(V)`

integers labeling each group vertex in the partition. - mtype
- The type of semi-projector used for the SCG. For
now
symmetric ,laplacian andstochastic are available. - p
- A probability vector of length
`nrow(V)`

.`p`

is the stationary probability distribution of a Markov chain when`mtype`

=stochastic . This parameter is ignored otherwise. - norm
- Either
row orcol . If set torow the rows of the Laplacian matrix sum to zero and the rows of the stochastic matrix sum to one; otherwise it is the columns.

##### Details

`scgNormEps`

computes $\Vert v_i-Pv_i\Vert$,
where $v_i$ is the $i$th eigenvector in `V`

and
$P$ is the projector corresponding to the `mtype`

argument.

##### Value

`normEps`

returns with a numeric vector whose $i$th component is $\Vert v_i-Pv_i\Vert$ (see Details).

##### References

D. Morton de Lachapelle, D. Gfeller, and P. De Los Rios, Shrinking
Matrices while Preserving their Eigenpairs with Application to the
Spectral Coarse Graining of Graphs. Submitted to *SIAM Journal on
Matrix Analysis and Applications*, 2008.

##### See Also

##### Examples

```
v <- rexp(20)
km <- kmeans(v,5)
sum(km$withinss)
scgNormEps(cbind(v), km$cluster)^2
```

*Documentation reproduced from package igraph, version 0.6.5-2, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.