• Aucun résultat trouvé

TP3

N/A
N/A
Protected

Academic year: 2022

Partager "TP3"

Copied!
2
0
0

Texte intégral

(1)

TP 3 : community detection algorithms

Rushed Kanawati December 12, 2019

Community detection in igraph

igraphoffers a bunch of different community detection algorithms. Examples are: edge.betweenness.community, multilevel.community, walktrap.communityandinfomap.community. All of these methods re-

turn acommunitiesobject. Metrics on community structure can be applied on this obtained object.

An exemple code is the following:

k a r a t e <− r e a d . graph ( ” k a r a t e . gml ” , f o r m a t=”gml ” ) wc <− m u l t i l e v e l . community ( k a r a t e )

The modularity of the found community structure is computed by the following function : m o d u l a r i t y ( wc )

[ 1 ] 0 . 4 1 8 8 0 3 4

The community membership vector of all nodes in the network is obtained as follows:

> membership ( com )

[ 1 ] 2 2 2 2 1 1 1 2 4 2 1 2 2 2 4 4 1 2 4 2 4 2 4 3 3 3 4 3 3 4 4 3 4 4 The quality of obtained community structure compared to he ground-truth community structure (given by the value attribute of each node) is then obtained as :

> compare ( com ,V( k a r a t e ) $ v a l u e , method=”nmi ” ) [ 1 ] 0 . 5 8 6 6 3 4 8

igraphoffers also some basic communities plotting primitives :

> p l o t ( com , k a r a t e )

this plots the network shown on figure 1

>p l o t ( k a r a t e , v e r t e x . c o l o r=membership ( com ) ) This plots the network shown on figure 2

1

(2)

Figure 1: Community structure using Louvain algorithm on the Karate network

Figure 2: Community structure using Louvain algorithm on the Karate network

Exercices

1 Download the following filesdolphins.gml, football.gml, karate.gmlfromhttp://lipn.

fr/~kanawati/ars. In these graphs the ground-truth community of each node is given by the attribut value. For each of these graphs apply apply different community detection algorithms and compare the results in function of similarity with the ground-truth commu- nity structure. Compare also the obtained community structures obtained by the different algorithms. Conclusions.

2 Download the following filewikipedia.gml fromhttp://lipn.fr/~kanawati/ars. This is snap of the wikipedia network. Nodes have alabelattribute that gives the title of the wikipedia page. Apply different community detection algorithms on this network and evaluate the outcome using the label attribute.

2

Références

Documents relatifs

[r]

Example results are (i) the mean and variance of the number of (possibly overlapping) ordered labeled subgraphs of a labeled graph as a function of its randomness deficiency (how far

The first one, is the model by Girvan and Newman (GN) [4], which produces networks taking roughly the form of sets of small interconnected Erdős-Rényi networks [8].

These new approaches in trajectory representation and clus- tering has aroused our interest and we propose to enrich it by comparing different similarity measures and various methods

We review the Pontryagin duality theory. A function from G to G' is called a homomorphism if it is continuous and preserves the group operation. B y the category of

We illustrate our approach with an experimental analysis of a real-world network with a ground-truth community structure that we compare with the output of eight different

The aim of this paper is to give a clear definition, as a continuous convolution, of the filtering of a discrete real-valued image by a filter specified by a continuous function in

Given the difficulty in finding relevant causal examples of as (see part one), the only way to gather examples of the two sorts efficiently was to resort to a parallel corpus, in