igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] enumerating triads of certain type?


From: Tamás Nepusz
Subject: Re: [igraph] enumerating triads of certain type?
Date: Mon, 9 Apr 2012 20:56:32 +0200

> By using triad.census() I could get the numbers of 16 triads types.
> But how to enumerate all triads of a certain type? e.g., I want igraph
> to list all the vertexes of the triad type 'A->B->C'.

For the most general case, I would say that you should try 
graph.get.subisomorphisms.vf2, which calculates all isomorphic mappings between 
a graph and all the subgraphs of another graph. I.e., you construct your 
desired triad type as a small graph "template" and then you use 
graph.get.subisomorphisms.vf2 to find all the possible ways to match this small 
graph "template" to your original graph.

However, if you are looking for all the A -> B -> C triads, then there is a 
much easier way to do this. For each vertex B in the graph, get its 
in-neighbors and out-neighbors. Any combination of an in-neighbor (A), an 
out-neighbor (C) and B itself is then a possible A --> B --> C triad.

Best,
Tamas




reply via email to

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