igraph-help
[Top][All Lists]
Advanced

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

[igraph] how to select transitive node in neighborhood


From: Simone Gabbriellini
Subject: [igraph] how to select transitive node in neighborhood
Date: Sun, 8 Mar 2009 16:11:07 +0100

dear Tamas,
dear List,

I would like to select a node B with certain attribute's values inside
the neighborhood of a node A, and this should be as easy as:

in_nei = g.neighbors(node_A, type="in")

node_B = random.sample(g.vs[in_nei].select(attribute1_ne = 0,
attribute2_le = 20), 1)[0].index

In this case I select a node B no matter the relations that B has with
other nodes in the neighborhood of node A...
What should I do to find a node B that has the same properties as
above, but that also is transitive with a node C in the neighborhood
of node A?

to be clearer, I hope:

suppose B, C and D are in the neiborhood of A.
Suppose B and C are linked togheter.
Suppose B and D have the same attribute values.
Then, I would like to select B instead of D because D is not inside a
transitive triplet with A, while B is.

How should I modify the code to accomplish this task?

best regards,
Simone




reply via email to

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