[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] : Edges between communities

From: Tamas Nepusz
Subject: Re: [igraph] : Edges between communities
Date: Sat, 25 Apr 2015 23:30:57 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

> I need to solve the following problem and would like to know how can I do it
> using the igraph library. Given a graph and after running the algorithm were
> obtained infomap "n" communities. I need to determine which vertices of each
> community are detected vertices "boundary" (vertices are those in which the
> number of edges inter clusters is greater than the number of intra clusters
> edges), for example, given a vertex V1 with 10 edges belongs to the community
> C1, 7 of them are with vertices that are located in other communities and
> 3 are edges that are connected to vertices belonging to C1. How to find these
> vertices? 
How about initializing two counters per vertex: one for the "internal" edges
incident on the vertex and one for the "boundary" edges incident on the vertex?
You can then simply iterate over all the edges and for each edge, adjust the
counters of the endpoints accordingly. Then in a final stage you check the
counters of each vertex and select those for which the counter corresponding to
boundary edges is larger than the counter corresponding to internal edges.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]