|
From: | Tamas Nepusz |
Subject: | Re: [igraph] Select vertex by name |
Date: | Mon, 12 Jan 2009 22:07:44 +0100 |
Hi Alvaro,
Do you know a way to select specific nodes to include in a igraph_vs_t by using their name attribute? I can check every single node and check their names but I was wondering if there is a more efficient way.I think this is the most efficient way as vertices are not indexed by attribute values. (Even if you do something like g.vs.select(name="foo") in the Python interface, the same linear search happens behind the scenes). However, if you do many searches on the name attribute, you can set up an index (mapping names to indices) manually for the first search and use the index after that.
-- Tamas
[Prev in Thread] | Current Thread | [Next in Thread] |