# FindElement: Find the representative elements of the clusters In l1spectral: An L1-Version of the Spectral Clustering

## Description

This internal function of the l1-spectral clustering algorithm finds representative elements of the clusters, that is nodes belonging to the clusters.

## Usage

 `1` ```FindElement(A, structure, clusters, elements = NULL) ```

## Arguments

 `A` The adjacency matrix `structure` Output of the function `FindStructure()`. `clusters` Output of the function `FindNbrClusters()`. `elements` The representative elements of the clusters (not necessary needed). If not provided, chosen using the betweeness centrality score.

## Value

A list with the following elements:

• `score` The edge betweenness score of all nodes,

• `Nodes` Vector of the representative elements.

## Author(s)

Camille Champion, Magali Champion

`l1_spectralclustering`, `l1spectral`.
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20``` ``` ###################################################### # Finding the representative elements of the clusters ###################################################### # 1st: create data (not perturbed graph) Data <- CreateDataSet(k=3, n=20, p=list(p_inside=0,p_outside=0)) # 2nd: find the structure of the graph Structure <- FindStructure(Data\$A_hat) # 3rd: find the optimal number of clusters (here, 3 clusters) Clusters <- FindNbrClusters(A = Data\$A_hat, structure = Structure, k=3) # 4th: find the representative elements of the clusters Elements <- FindElement(A = Data\$A_hat, structure = Structure, clusters = Clusters) # if elements is not provided, the representative elements of each component are chosen # by maximizing the edge betweenness score Elements <- FindElement(A = Data\$A_hat, structure = Structure, clusters = Clusters, elements = c(1,5,12)) ```