igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] working with graphs without reindexing them


From: Tamas Nepusz
Subject: Re: [igraph] working with graphs without reindexing them
Date: Wed, 8 Sep 2010 15:50:08 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

> I have an additional problem that I forgot to ask you about. Some of my
> nodes are unconnected, how should I specify them in the lgl format?
When you write an LGL file, an isolated node should appear like this:

# vertexname1
vertexname2
vertexname3
# isolated_vertex
# vertexname2
vertexname3

(note that there are no neighbors listed for isolated_vertex).

> Re the vertex id search by attribute name, I was planning use integers as
> attributes (what you termed as 'numeric vertex attribute')
In that case, you can still make use of a hash table to keep track of
igraph IDs vs your IDs. This is a nice BSD-licensed hash table data
structure in C:

http://www.cl.cam.ac.uk/~cwc22/hashtable/

Or, use a binary search tree. Of course only if you want to push down
the lookup complexity from O(n) to O(log n) or O(1).

> But if you know any alternative in C to igraph, I would be interested
> to see it.
Well, there's the LEMON graph library. It's in C++, not C, and I'm not
really familiar with its features, so it might not be suitable for you,
but I guess it's best if you check it out:

http://lemon.cs.elte.hu/trac/lemon

-- 
Tamas



reply via email to

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